Skip to content

Commit

Permalink
update pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Sode Anker authored and Andy Sode Anker committed Sep 13, 2024
1 parent 8365c3a commit 76cb16e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.7"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
Expand Down
43 changes: 30 additions & 13 deletions debyecalculator/debye_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
from functools import partial
from tqdm.auto import tqdm

from pymatgen.core import Structure
try:
from pymatgen.core import Structure
pymatgen_available = True
except ImportError:
pymatgen_available = False

# NamedTuple definitions
StructureTuple = namedtuple('StructureTuple', 'elements size occupancy xyz triu_indices unique_inverse unique_form_factors form_avg_sq structure_inverse')
Expand All @@ -61,18 +65,31 @@

ArrayLike = Union[np.ndarray, torch.Tensor]
IntArrayLike = Union[List[int], np.ndarray, torch.Tensor]
StructureSourceType = Union[
Tuple[List[str], ArrayLike],
Tuple[IntArrayLike, ArrayLike],
List[Tuple[List[str], ArrayLike]],
List[Tuple[IntArrayLike, ArrayLike]],
str,
List[str],
Atoms,
List[Atoms],
Structure,
List[Structure],
]

if pymatgen_available:
StructureSourceType = Union[
Tuple[List[str], ArrayLike],
Tuple[IntArrayLike, ArrayLike],
List[Tuple[List[str], ArrayLike]],
List[Tuple[IntArrayLike, ArrayLike]],
str,
List[str],
Atoms,
List[Atoms],
Structure,
List[Structure],
]
else:
StructureSourceType = Union[
Tuple[List[str], ArrayLike],
Tuple[IntArrayLike, ArrayLike],
List[Tuple[List[str], ArrayLike]],
List[Tuple[IntArrayLike, ArrayLike]],
str,
List[str],
Atoms,
List[Atoms],
]

class DebyeCalculator:
"""
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ packages = [
]

[tool.poetry.dependencies]
python = "^3.10,<3.12"
python = "^3.7,<3.12"
numpy = [
{version = "^1.21.5", python = "3.7"},
{version = "^1.24.3", python = "3.8"},
Expand All @@ -31,7 +31,9 @@ matplotlib = [
pyyaml = "^6.0.1"
tqdm = "^4.66.1"
ase = "^3.22.1,<3.23.0"
pymatgen = ">=2020.0.0,<2024.9.10"
pymatgen = [
{version = ">=2020.0.0,<2024.9.10", python = "^3.10"}
]
notebook = "^6.4.1"
ipywidgets = "^8.0.3"
scipy = [
Expand Down

0 comments on commit 76cb16e

Please sign in to comment.