Featurizers

descriptorDefinitions.KS2022

class pysipfenn.descriptorDefinitions.KS2022.LocalAttributeGenerator(struct, local_env_func, nn_generator=VoronoiNN())[source]

Bases: object

A wrapper class which contains an instance of an NN generator (the default is a VoronoiNN), a structure, and a function which computes the local environment attributes.

generate_local_attributes(n)[source]
pysipfenn.descriptorDefinitions.KS2022.cite()[source]

Citation/s for the descriptor.

Return type:

List[str]

pysipfenn.descriptorDefinitions.KS2022.generate_descriptor(struct)[source]

Main functionality. Generates the KS2022 descriptor for a given structure.

Parameters:

struct (Structure) – A pymatgen Structure object.

Return type:

ndarray

Returns:

A 271-lenght numpy array of the descriptor.

pysipfenn.descriptorDefinitions.KS2022.generate_voronoi_attributes(struct, local_funct=<function local_env_function>)[source]

Generates the local environment attributes for a given structure using a VoronoiNN generator.

Parameters:
  • struct – A pymatgen Structure object.

  • local_funct – A function which computes the local environment attributes for a given site.

pysipfenn.descriptorDefinitions.KS2022.get_equivalentSitesMultiplicities(struct)[source]
pysipfenn.descriptorDefinitions.KS2022.local_env_function(local_env, site)[source]

A prototype function which computes a weighted average over neighbors, weighted by the area of the voronoi cell between them.

Parameters:
  • local_env – A dictionary of the local environment of a site, as returned by a VoronoiNN generator.

  • site – The site number for which the local environment is being computed.

  • element_dict – A dictionary of the elements in the structure.

Returns:

A list of the local environment attributes.

pysipfenn.descriptorDefinitions.KS2022.magpie_mode(attribute_properties, axis=0)[source]

Calculates the attributes corresponding to the most common elements.

pysipfenn.descriptorDefinitions.KS2022.onlyStructural(descriptor)[source]

Returns the structure-dependent part of the KS2022descriptor.

Parameters:

descriptor (ndarray) – A 256-length numpy array of the KS2022 descriptor.

Return type:

ndarray

Returns:

A 103-length numpy array of the structure-dependent part of the KS2022 descriptor. Useful in cases where the descriptor is used as a fingerprint to compare polymorphs of the same compound.

pysipfenn.descriptorDefinitions.KS2022.profile(test='JVASP-10001', nRuns=10)[source]

Profiles the descriptor in series using one of the test structures.

pysipfenn.descriptorDefinitions.KS2022.profileParallel(test='JVASP-10001', nRuns=1000)[source]

Profiles the descriptor in parallel using one of the test structures.

descriptorDefinitions.KS2022_dilute

class pysipfenn.descriptorDefinitions.KS2022_dilute.LocalAttributeGenerator(struct, local_env_func, nn_generator=VoronoiNN())[source]

Bases: object

generate_local_attributes(n)[source]
generate_local_attributes_diluteSite(n)[source]
pysipfenn.descriptorDefinitions.KS2022_dilute.cite()[source]
pysipfenn.descriptorDefinitions.KS2022_dilute.findDilute(struct)[source]
pysipfenn.descriptorDefinitions.KS2022_dilute.generate_descriptor(struct, baseStruct='pure')[source]
pysipfenn.descriptorDefinitions.KS2022_dilute.generate_voronoi_attributes(struct, baseStruct='pure', local_funct=<function local_env_function>)[source]
pysipfenn.descriptorDefinitions.KS2022_dilute.local_env_function(local_env, site, struct)[source]
pysipfenn.descriptorDefinitions.KS2022_dilute.magpie_mode(attribute_properties, axis=0)[source]
pysipfenn.descriptorDefinitions.KS2022_dilute.profile(test='JVASP-10001', nRuns=10)[source]
pysipfenn.descriptorDefinitions.KS2022_dilute.profileParallel(test='JVASP-10001', nRuns=1000)[source]

descriptorDefinitions.Ward2017

class pysipfenn.descriptorDefinitions.Ward2017.LocalAttributeGenerator(struct, local_env_func, element_dict, nn_generator=VoronoiNN())[source]

Bases: object

A wrapper class which contains an instance of an NN generator (the default is a VoronoiNN), a structure, and a function which computes the local environment attributes.

generate_local_attributes(n)[source]

Generates the local environment attributes for a given site in the structure.

pysipfenn.descriptorDefinitions.Ward2017.cite()[source]

Citation/s for the descriptor.

Return type:

List[str]

pysipfenn.descriptorDefinitions.Ward2017.generate_WC_attributes(strc, neighbor_dict_raw, levels)[source]

Generates the WC attributes for a given structure. The WC attributes are the ordering parameters for each shell of the Voronoi tessellation. Slightly different than what is implemented by Ward-Wolverton. Only considers immediate backtracking.

Parameters:
  • strc (Structure) – A pymatgen Structure object.

  • neighbor_dict_raw – A dictionary of the neighbors of each site in the structure.

  • levels – The number of shells to consider.

Return type:

List[float]

pysipfenn.descriptorDefinitions.Ward2017.generate_descriptor(struct)[source]

Main functionality. Generates the Ward2017 descriptor for a given structure.

Parameters:

struct (Structure) – A pymatgen Structure object.

Return type:

ndarray

Returns:

A 271-lenght numpy array of the descriptor.

pysipfenn.descriptorDefinitions.Ward2017.generate_voronoi_attributes(struct, local_funct=<function local_env_function>)[source]
Generates the local environment attributes for a given structure using a VoronoiNN generator.

The local environment attributes consist of averages over the neighbors of each site in the structure.

Parameters:
  • struct (Structure) – A pymatgen Structure object.

  • local_funct – A function which computes the local environment attributes for a given site.

pysipfenn.descriptorDefinitions.Ward2017.local_env_function(local_env, site, element_dict)[source]

A prototype function which computes a weighted average over neighbors, weighted by the area of the voronoi cell between them.

Parameters:
  • local_env – A dictionary of the local environment of a site, as returned by a VoronoiNN generator.

  • site – The site number for which the local environment is being computed.

Return type:

list

Returns:

A list of the local environment attributes.

pysipfenn.descriptorDefinitions.Ward2017.magpie_mode(attribute_properties, axis=0)[source]

Calculates the attributes corresponding to the most common elements.

pysipfenn.descriptorDefinitions.Ward2017.profile(test='JVASP-10001', nRuns=10)[source]

Profiles the descriptor in series using one of the test structures.

pysipfenn.descriptorDefinitions.Ward2017.profileParallel(test='JVASP-10001', nRuns=1000)[source]

Profiles the descriptor in parallel using one of the test structures.