Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for more details.
stats: The stats to include in fingerprint. See
:class:`matminer.featurizers.structure.SiteStatsFingerprint``
for more details.
prototype_match: Whether to use distance cutoffs and electron negativity
differences when calculating the structure fingerprint.
Returns:
The structure fingerprint as a :class:`numpy.ndarray`.
"""
# TODO: Add distance_cutoff option to matminer so we can user preset arg
# currently don't use SiteStatsFingerprint.from_preset as we need to pass in
# distance_cutoffs param
if prototype_match:
ssf = SiteStatsFingerprint(
CrystalNNFingerprint.from_preset(
"ops", cation_anion=False, distance_cutoffs=None,
x_diff_weight=None
),
stats=stats
)
else:
ssf = SiteStatsFingerprint(
CrystalNNFingerprint.from_preset("ops", cation_anion=False),
stats=stats)
return np.array(ssf.featurize(structure))
The structure fingerprint as a :class:`numpy.ndarray`.
"""
# TODO: Add distance_cutoff option to matminer so we can user preset arg
# currently don't use SiteStatsFingerprint.from_preset as we need to pass in
# distance_cutoffs param
if prototype_match:
ssf = SiteStatsFingerprint(
CrystalNNFingerprint.from_preset(
"ops", cation_anion=False, distance_cutoffs=None,
x_diff_weight=None
),
stats=stats
)
else:
ssf = SiteStatsFingerprint(
CrystalNNFingerprint.from_preset("ops", cation_anion=False),
stats=stats)
return np.array(ssf.featurize(structure))