Skip to content

Commit

Permalink
Clean up pumatgen imports so that it works with older version of
Browse files Browse the repository at this point in the history
pymatgen.
  • Loading branch information
Shyue Ping Ong committed Jul 23, 2022
1 parent 53b450c commit ab1b54e
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion m3gnet/graph/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np
import tensorflow as tf
from ase import Atoms
from pymatgen.core import Structure
from pymatgen.core.structure import Structure

from m3gnet.config import DataType
from m3gnet.type import StructureOrMolecule
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/graph/_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import numpy as np
from ase import Atoms
from pymatgen.core import Molecule, Structure
from pymatgen.core.structure import Molecule, Structure
from pymatgen.optimization.neighbors import find_points_in_spheres

from m3gnet.config import DataType
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/graph/tests/test_batch.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest

import numpy as np
from pymatgen.core import Lattice, Structure
from pymatgen.core.structure import Lattice, Structure

from m3gnet.graph import (
MaterialGraph,
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/graph/tests/test_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
import tensorflow as tf
from pymatgen.core import Lattice, Structure
from pymatgen.core.structure import Lattice, Structure

from m3gnet.graph import (
Index,
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/graph/tests/test_converters.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest

import numpy as np
from pymatgen.core import Lattice, Structure
from pymatgen.core.structure import Lattice, Structure

from m3gnet.graph import BaseGraphConverter, MaterialGraph, RadiusCutoffGraphConverter

Expand Down
2 changes: 1 addition & 1 deletion m3gnet/graph/tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
import tensorflow as tf
from pymatgen.core import Lattice, Structure
from pymatgen.core.structure import Lattice, Structure

from m3gnet.graph import Index, MaterialGraph, RadiusCutoffGraphConverter

Expand Down
3 changes: 2 additions & 1 deletion m3gnet/layers/_atom_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import numpy as np
import tensorflow as tf
from ase import Atoms
from pymatgen.core import Element, Molecule, Structure
from pymatgen.core.periodic_table import Element
from pymatgen.core.structure import Molecule, Structure

from m3gnet.config import DataType
from m3gnet.graph import Index
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/layers/tests/test_2_3_body.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest

import numpy as np
from pymatgen.core import Lattice, Molecule, Structure
from pymatgen.core.structure import Lattice, Molecule, Structure

from m3gnet.graph import RadiusCutoffGraphConverter, tf_compute_distance_angle
from m3gnet.layers import PairDistance, PairVector, SphericalBesselWithHarmonics
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/layers/tests/test_atom_ref.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest

import numpy as np
from pymatgen.core import Lattice, Structure
from pymatgen.core.structure import Lattice, Structure

from m3gnet.layers import AtomRef

Expand Down
2 changes: 1 addition & 1 deletion m3gnet/layers/tests/test_bond.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest

import numpy as np
from pymatgen.core import Lattice, Molecule, Structure
from pymatgen.core.structure import Lattice, Molecule, Structure

from m3gnet.graph import Index, RadiusCutoffGraphConverter
from m3gnet.layers import PairRadialBasisExpansion
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/layers/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
import tensorflow as tf
from pymatgen.core import Lattice, Structure
from pymatgen.core.structure import Lattice, Structure

from m3gnet.graph import RadiusCutoffGraphConverter
from m3gnet.layers import MLP, Embedding, GatedMLP, Pipe
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/layers/tests/test_gn.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest

import numpy as np
from pymatgen.core import Lattice, Molecule, Structure
from pymatgen.core.structure import Lattice, Molecule, Structure

from m3gnet.graph import MaterialGraph, RadiusCutoffGraphConverter
from m3gnet.layers import MLP
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/models/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import List, Union

import tensorflow as tf
from pymatgen.core import Molecule, Structure
from pymatgen.core.structure import Molecule, Structure

from m3gnet.config import DataType
from m3gnet.graph import Index, MaterialGraph, assemble_material_graph
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/models/_dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from ase.optimize.mdmin import MDMin
from ase.optimize.optimize import Optimizer
from ase.optimize.sciopt import SciPyFminBFGS, SciPyFminCG
from pymatgen.core import Molecule, Structure
from pymatgen.core.structure import Molecule, Structure
from pymatgen.io.ase import AseAtomsAdaptor

from ._base import Potential
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/models/tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import numpy as np
from monty.tempfile import ScratchDir
from pymatgen.core import Lattice, Molecule, Structure
from pymatgen.core.structure import Lattice, Molecule, Structure

from m3gnet.models import M3GNet, MolecularDynamics, Potential, Relaxer

Expand Down
2 changes: 1 addition & 1 deletion m3gnet/trainers/_potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import tensorflow as tf
from ase import Atoms
from pymatgen.core import Molecule, Structure
from pymatgen.core.structure import Molecule, Structure

from m3gnet.callbacks import ManualStop
from m3gnet.graph import Index, MaterialGraph, MaterialGraphBatchEnergyForceStress
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/trainers/_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import numpy as np
import tensorflow as tf
from ase import Atoms
from pymatgen.core import Molecule, Structure
from pymatgen.core.structure import Molecule, Structure

from m3gnet.callbacks import ManualStop
from m3gnet.graph import MaterialGraph, MaterialGraphBatch
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/trainers/tests/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np
import tensorflow as tf
from monty.tempfile import ScratchDir
from pymatgen.core import Structure
from pymatgen.core.structure import Structure

from m3gnet.models import M3GNet, Potential
from m3gnet.trainers import PotentialTrainer, Trainer
Expand Down
2 changes: 1 addition & 1 deletion m3gnet/type.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import numpy as np
from ase.atoms import Atoms
from pymatgen.core import Molecule, Structure
from pymatgen.core.structure import Molecule, Structure

OptStrOrCallable = Optional[Union[str, Callable[..., Any]]]
StructureOrMolecule = Union[Structure, Molecule, Atoms]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
name="m3gnet",
version=version,
install_requires=[
"pymatgen>=2022.1.1",
"pymatgen",
"tensorflow",
"numpy",
"monty",
Expand Down

0 comments on commit ab1b54e

Please sign in to comment.