Skip to content

Commit

Permalink
Make Spglib optional dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
knc6 committed Aug 26, 2024
1 parent 5f7c55e commit 40d7389
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion jarvis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Version number."""

__version__ = "2024.5.10"
__version__ = "2024.8.10"

import os

Expand Down
12 changes: 8 additions & 4 deletions jarvis/analysis/structure/spacegroup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
"""Modules for handling crystallographic Spacegroup related operations."""

from functools import reduce
from jarvis.core.lattice import Lattice
from jarvis.core.atoms import Atoms
import spglib
from jarvis.core.specie import Specie
import numpy as np
from numpy import sin, cos
import itertools

# from fractions import gcd
from jarvis.core.utils import gcd
import os

try:
import spglib
except Exception as exp:
print(exp)
pass
# from numpy import gcd
# from math import gcd
import os
# from fractions import gcd


def unique_rows_2(a):
Expand Down
15 changes: 11 additions & 4 deletions jarvis/db/figshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
import json
import requests
from jarvis.db.jsonutils import loadjson
from jarvis.io.vasp.outputs import Vasprun
from jarvis.io.vasp.inputs import Poscar
from jarvis.io.wannier.outputs import WannierHam
from tqdm import tqdm
import matplotlib.image as mpimg
from jarvis.analysis.stm.tersoff_hamann import TersoffHamannSTM

# from jarvis.analysis.stm.tersoff_hamann import TersoffHamannSTM
# from jarvis.io.wannier.outputs import WannierHam
# from jarvis.io.vasp.outputs import Vasprun
# from jarvis.io.vasp.inputs import Poscar

# import matplotlib.pyplot as plt
# plt.switch_backend("agg")
Expand Down Expand Up @@ -598,6 +599,8 @@ def make_stm_from_prev_parchg(
jid="JVASP-667", bias="Negative", filename="stm_image.png", min_size=10
):
"""Make STM images from previously calculated PARVHG files for 2D."""
from jarvis.analysis.stm.tersoff_hamann import TersoffHamannSTM

fls = data("raw_files")
for i in fls["STM"]:
zip_name = jid + "_" + bias + ".zip"
Expand All @@ -619,6 +622,9 @@ def make_stm_from_prev_parchg(

def get_wann_electron(jid="JVASP-816"):
"""Download electron WTBH if available."""
from jarvis.io.wannier.outputs import WannierHam
from jarvis.io.vasp.inputs import Poscar

w = ""
ef = ""
fls = data("raw_files")
Expand Down Expand Up @@ -650,6 +656,7 @@ def get_wann_phonon(jid="JVASP-1002", factor=15.633302):
"""Download phonon WTBH if available."""
# Requires phonopy
from jarvis.io.phonopy.outputs import get_phonon_tb
from jarvis.io.vasp.outputs import Vasprun

fls = data("raw_files")

Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@

setup(
name="jarvis-tools",
version="2024.5.10",
version="2024.8.10",
long_description=long_d,
install_requires=[
"numpy>=1.20.1",
"scipy>=1.5.0",
"matplotlib>=3.0.0",
"spglib>=1.14.1",
"joblib>=0.14.1",
"requests>=2.23.0",
"toolz>=0.9.0",
"xmltodict>=0.11.0",
"tqdm>=4.41.1",
"scikit-learn",
"inflect",
# "spglib>=1.14.1",
# "inflect",
# "mkdocs-material>=9.0.5",
# "markdown>=3.2.1",
# "absl-py==1.4.0",
Expand Down

0 comments on commit 40d7389

Please sign in to comment.