Unverified Commit 8eb7b764 authored by Bharath Ramsundar's avatar Bharath Ramsundar Committed by GitHub
Browse files

Merge pull request #2460 from JainSamyak8840/master

Fix pymatgen subclasses import error
parents 70a132de c34e0117
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -319,10 +319,10 @@ class MaterialStructureFeaturizer(Featurizer):

    Parameters
    ----------
    structures: Iterable[Union[Dict, pymatgen.Structure]]
    structures: Iterable[Union[Dict, pymatgen.core.Structure]]
      Iterable sequence of pymatgen structure dictionaries
      or pymatgen.Structure. Please confirm the dictionary representations
      of pymatgen.Structure from https://pymatgen.org/pymatgen.core.structure.html.
      or pymatgen.core.Structure. Please confirm the dictionary representations
      of pymatgen.core.Structure from https://pymatgen.org/pymatgen.core.structure.html.
    log_every_n: int, default 1000
      Logging messages reported every `log_every_n` samples.

@@ -333,7 +333,7 @@ class MaterialStructureFeaturizer(Featurizer):
      `structures`.
    """
    try:
      from pymatgen import Structure
      from pymatgen.core import Structure
    except ModuleNotFoundError:
      raise ImportError("This class requires pymatgen to be installed.")

@@ -395,7 +395,7 @@ class MaterialCompositionFeaturizer(Featurizer):
      `compositions`.
    """
    try:
      from pymatgen import Composition
      from pymatgen.core import Composition
    except ModuleNotFoundError:
      raise ImportError("This class requires pymatgen to be installed.")

+5 −5
Original line number Diff line number Diff line
@@ -35,8 +35,8 @@ class CGCNNFeaturizer(MaterialStructureFeaturizer):
  Examples
  --------
  >>> import pymatgen as mg
  >>> lattice = mg.Lattice.cubic(4.2)
  >>> structure = mg.Structure(lattice, ["Cs", "Cl"], [[0, 0, 0], [0.5, 0.5, 0.5]])
  >>> lattice = mg.core.Lattice.cubic(4.2)
  >>> structure = mg.core.Structure(lattice, ["Cs", "Cl"], [[0, 0, 0], [0.5, 0.5, 0.5]])
  >>> featurizer = CGCNNFeaturizer()
  >>> features = featurizer.featurize([structure])
  >>> feature = features[0]
@@ -86,7 +86,7 @@ class CGCNNFeaturizer(MaterialStructureFeaturizer):

    Parameters
    ----------
    struct: pymatgen.Structure
    struct: pymatgen.core.Structure
      A periodic crystal composed of a lattice and a sequence of atomic
      sites with 3D coordinates and elements.

@@ -108,7 +108,7 @@ class CGCNNFeaturizer(MaterialStructureFeaturizer):

    Parameters
    ----------
    struct: pymatgen.Structure
    struct: pymatgen.core.Structure
      A periodic crystal composed of a lattice and a sequence of atomic
      sites with 3D coordinates and elements.

@@ -131,7 +131,7 @@ class CGCNNFeaturizer(MaterialStructureFeaturizer):

    Parameters
    ----------
    struct: pymatgen.Structure
    struct: pymatgen.core.Structure
      A periodic crystal composed of a lattice and a sequence of atomic
      sites with 3D coordinates and elements.

+2 −2
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ class ElementPropertyFingerprint(MaterialCompositionFeaturizer):
  Examples
  --------
  >>> import pymatgen as mg
  >>> comp = mg.Composition("Fe2O3")
  >>> comp = mg.core.Composition("Fe2O3")
  >>> featurizer = ElementPropertyFingerprint()
  >>> features = featurizer.featurize([comp])

@@ -60,7 +60,7 @@ class ElementPropertyFingerprint(MaterialCompositionFeaturizer):

    Parameters
    ----------
    composition: pymatgen.Composition object
    composition: pymatgen.core.Composition object
      Composition object.

    Returns
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ class ElemNetFeaturizer(MaterialCompositionFeaturizer):

    Parameters
    ----------
    composition: pymatgen.Composition object
    composition: pymatgen.core.Composition object
      Composition object.

    Returns
+3 −3
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ class LCNNFeaturizer(MaterialStructureFeaturizer):
  Examples
  --------
  >>> import deepchem as dc
  >>> from pymatgen import Structure
  >>> from pymatgen.core import Structure
  >>> import numpy as np
  >>> PRIMITIVE_CELL = {
  ...   "lattice": [[2.818528, 0.0, 0.0],
@@ -147,7 +147,7 @@ class LCNNFeaturizer(MaterialStructureFeaturizer):
      used down to 2 digits.
    """
    try:
      from pymatgen import Structure
      from pymatgen.core import Structure
    except:
      raise ImportError("This class requires pymatgen to be installed.")

@@ -626,7 +626,7 @@ def _get_SiteEnvironments(struct: PymatgenStructure,
    list of local_env class
  """
  try:
    from pymatgen import Molecule
    from pymatgen.core import Molecule
    from pymatgen.symmetry.analyzer import PointGroupAnalyzer
  except:
    raise ImportError("This class requires pymatgen to be installed.")
Loading