Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace HalfspaceIntersection import and pin scipy >= 1.8.0, sort imports #6

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions pymatgen/analysis/alloys/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,37 @@

# TODO: A `FormulaAlloySystem` is defined consisting of `FormulaAlloyPair` and specifies
# the full space accessible for a given composition.

import hashlib
import warnings
from dataclasses import dataclass, field
from itertools import chain, groupby
from pathlib import Path
from typing import Any, Callable, Dict, List, Literal, Optional, Set, Tuple, Union

import hashlib
import networkx as nx
import numpy as np
import pandas as pd
import plotly.express as px

import plotly.graph_objects as go
from monty.serialization import loadfn
from pathlib import Path
from itertools import groupby, chain
from monty.json import MSONable
from monty.serialization import loadfn
from plotly.subplots import make_subplots
from pymatgen.analysis.phase_diagram import PhaseDiagram
from scipy.spatial.qhull import HalfspaceIntersection
from scipy.constants import c, elementary_charge, h
from scipy.spatial import HalfspaceIntersection
from shapely.geometry import MultiPoint
from typing import List, Tuple, Optional, Dict, Literal, Any, Set, Callable, Union
from scipy.constants import c, h, elementary_charge

from pymatgen.core.composition import Species, Composition
from pymatgen.analysis.alloys.rgb import rgb
from pymatgen.analysis.phase_diagram import PhaseDiagram
from pymatgen.analysis.structure_matcher import ElementComparator
from pymatgen.core.composition import Composition, Species
from pymatgen.core.structure import Structure
from pymatgen.transformations.standard_transformations import (
AutoOxiStateDecorationTransformation,
ConventionalCellTransformation,
)
from pymatgen.util.string import unicodeify

from pymatgen.analysis.alloys.rgb import rgb

# structure matching parameters
LTOL: float = 0.2
STOL: float = 0.3
Expand Down
9 changes: 4 additions & 5 deletions pymatgen/analysis/alloys/tests/test_core.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from pathlib import Path
from typing import Dict

from pytest import raises
import pytest
from monty.serialization import loadfn
from pymatgen.core import Structure, Composition

from pymatgen.analysis.alloys.core import AlloyPair

from pymatgen.core import Composition, Structure

mp_661: Structure = loadfn(Path(__file__).parent / "AlN_mp-661.json")
mp_661_without_oxi_state = mp_661.copy()
Expand Down Expand Up @@ -162,7 +161,7 @@ def test_get_x():
assert pair.get_x(c1) == 0.5
assert pair.get_x(c2) == 0.5
assert pair.get_x(c3) == 2/3
with raises(ValueError):
with pytest.raises(ValueError):
pair.get_x(c4)
with raises(ValueError):
with pytest.raises(ValueError):
pair.get_x(c5)
12 changes: 11 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,18 @@
name="pymatgen-analysis-alloys",
packages=find_namespace_packages(include=["pymatgen.analysis.*"]),
version="0.0.6",
install_requires=["pymatgen>=2023.7.17", "shapely>=1.8.2"],
install_requires=[
"monty",
"networkx",
"numpy",
"pandas",
"plotly",
"pymatgen>=2023.7.17",
"scipy>=1.8.0",
"shapely>=1.8.2",
],
extras_require={},
setup_requires=["setuptools>=64"],
DanielYang59 marked this conversation as resolved.
Show resolved Hide resolved
package_data={
"pymatgen.analysis.alloys": ["*.yaml", "*.json", "*.csv"],
},
Expand Down
Loading