def _add_external(self, fset): # Prevent import errors require_external = [] if torch and cgcnn: require_external.append(sf.CGCNNFeaturizer()) if dscribe: require_external.append(sf.SOAP()) return fset + require_external
def __init__(self, exclude=None): super(StructureFeaturizers, self).__init__(exclude=exclude) self._fast_featurizers = [ sf.DensityFeatures(), sf.GlobalSymmetryFeatures(), sf.EwaldEnergy(), sf.SineCoulombMatrix(flatten=True) ] ssf = sf.SiteStatsFingerprint self._slow_featurizers = [ ssf.from_preset('CrystalNNFingerprint_ops'), ssf.from_preset("BondLength-dejong2016"), ssf.from_preset("BondAngle-dejong2016"), ssf.from_preset("Composition-dejong2016_SD"), ssf.from_preset("Composition-dejong2016_AD"), ssf.from_preset("CoordinationNumber_ward-prb-2017"), ssf.from_preset("LocalPropertyDifference_ward-prb-2017"), sf.ChemicalOrdering(), sf.StructuralHeterogeneity(), sf.MaximumPackingEfficiency(), sf.XRDPowderPattern(), sf.Dimensionality(), sf.OrbitalFieldMatrix(flatten=True), sf.JarvisCFID(), ] # Prevent import errors self._require_external = [] if torch and cgcnn: self._require_external.append(sf.CGCNNFeaturizer()) if dscribe: self._require_external.append(sf.SOAP()) self._need_fitting_featurizers = [ sf.PartialRadialDistributionFunction(), sf.BondFractions(), sf.BagofBonds(coulomb_matrix=sf.CoulombMatrix()), sf.BagofBonds(coulomb_matrix=sf.SineCoulombMatrix()), ] self._matrix_featurizers = [ sf.CoulombMatrix(flatten=False), sf.RadialDistributionFunction(), # returns dict sf.MinimumRelativeDistances(), # returns a list sf.ElectronicRadialDistributionFunction() ] # these are the same as _need_fitting_featurizers self._many_features_featurizers = [ sf.PartialRadialDistributionFunction(), sf.BondFractions(approx_bonds=False), sf.BagofBonds(coulomb_matrix=sf.CoulombMatrix()), sf.BagofBonds(coulomb_matrix=sf.SineCoulombMatrix()), sf.OrbitalFieldMatrix(flatten=True), sf.JarvisCFID() ]