robocrys.featurize package

Submodules

robocrys.featurize.adapter module

This module implements a class to resolve the symbolic references in condensed structure data.

class robocrys.featurize.adapter.FeaturizerAdapter(condensed_structure, distorted_tol=0.6)[source]

Bases: BaseAdapter

Class to facilitate featurizing condensed structure data.

Parameters:

condensed_structure (dict[str, Any]) – The condensed structure data, formatted as produced by robocrys.condense.StructureCondenser.condense_structure().

all_bond_lengths()[source]
property average_anion_coordination_number

The average coordination number across anion sites.

property average_cation_coordination_number

The average coordination number across cation sites.

property average_coordination_number

The average coordination number across all sites.

property average_corner_sharing_octahedral_tilt_angle: float

The average corner-sharing octahedral tilt angle.

property component_dimensionalities: list[int]

The dimensionalities of all components.

contains_connected_geometry(connectivity, geometry)[source]

Whether the structure contains the specified connected geometry.

Parameters:
  • connectivity (str) – The connectivity (corner, edge, face)

  • geometry (str) – The geometry.

Return type:

bool

Returns:

Whether the structure contains the specified connected geometry.

property contains_corner_sharing_polyhedra: bool

Whether the structure contains corner-sharing polyhedra.

property contains_edge_sharing_polyhedra: bool

Whether the structure contains edge-sharing polyhedra.

property contains_face_sharing_polyhedra: bool

Whether the structure contains face-sharing polyhedra.

contains_geometry_type(geometry, distorted=None)[source]

Whether the structure contains a specific site geometry.

Parameters:
  • geometry (str) – The site geometry.

  • distorted (Optional[bool]) – Whether the geometry is distorted or not. If set to None, then the matching does not take into account the geometry likeness.

Return type:

bool

Returns:

Whether the structure contains a specific geometry.

contains_molecule(molecule_name)[source]

Whether the structure contains a specific molecule name.

Parameters:

molecule_name (str) – A molecule name.

Return type:

bool

Returns:

Whether the structure contains the molecule.

property contains_named_molecule: bool

Whether the structure contains any named molecules.

property contains_polyhedra: bool

Whether the structure contains any connected polyhedra.

frac_site_geometry(geometry)[source]

The fraction of sites with a specific geometry.

Parameters:

geometry (str) – The geometry.

Return type:

float

Returns:

The fraction of sites with the specified geometry.

frac_sites_n_coordinate(num_neighbors)[source]

The fraction of sites with a specific coordination number.

Parameters:

num_neighbors (str) – The number of nearest neighbors.

Return type:

float

Returns:

The fraction of sites with the specified coordination number.

property frac_sites_polyhedra: float

The percentage of sites that are connected polyhedra.

is_dimensionality(dimensionalities)[source]

Whether the structure only contains the specified dimensionalities.

Parameters:

dimensionalities (int | list[int] | set[int]) – One or more dimensionalities.

Return type:

bool

Returns:

Whether the structure only contains the specified dimensionalities.

property is_intercalated: bool

Whether the structure is intercalated.

property is_interpenetrated: bool

Whether the structure is interpenetrated.

robocrys.featurize.featurizer module

This module contains a class to obtain robocrystallographer ML features.

class robocrys.featurize.featurizer.RobocrysFeaturizer(condenser_kwargs=None, distorted_tol=0.6)[source]

Bases: BaseFeaturizer

Class to generate structure features from robocrystallographer output.

Parameters:
  • condenser_kwargs (Optional[dict]) – Keyword arguments that will be passed to robocrys.condense.StructureCondenser.

  • distorted_tol (float) – The value under which the site geometry will be classified as distorted.

citations()[source]

Citation(s) and reference(s) for this feature.

Returns:

(list) each element should be a string citation,

ideally in BibTeX format.

feature_labels()[source]

Generate attribute names.

Returns:

([str]) attribute labels.

featurize(s)[source]

Featurizes a structure using robocrystallographer.

Parameters:

s (Structure) – A structure.

Return type:

list[float | bool | str]

Returns:

The robocrystallographer features.

implementors()[source]

List of implementors of the feature.

Returns:

(list) each element should either be a string with author name (e.g.,

”Anubhav Jain”) or a dictionary with required key “name” and other keys like “email” or “institution” (e.g., {“name”: “Anubhav Jain”, “email”: “ajain@lbl.gov”, “institution”: “LBNL”}).

Module contents