How to use the matminer.featurizers.conversions.StructureToOxidStructure function in matminer

To help you get started, we’ve selected a few matminer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hackingmaterials / automatminer / automatminer / featurization / core.py View on Github external
"".format(featurizer_type, type(type_tester))
                    )
                dto = DictToObject(
                    overwrite_data=True, target_col_id=featurizer_type
                )
                dto.set_n_jobs(self.n_jobs)
                df = dto.featurize_dataframe(df, featurizer_type, inplace=False)

            # Decorate with oxidstates
            if featurizer_type == self.structure_col and self.guess_oxistates:
                logger.info(
                    self._log_prefix
                    + "Guessing oxidation states of structures if they were "
                    "not present in input."
                )
                sto = StructureToOxidStructure(
                    target_col_id=featurizer_type,
                    overwrite_data=True,
                    return_original_on_error=True,
                    max_sites=30,
                )
                sto.set_n_jobs(self.n_jobs)
                try:
                    df = sto.featurize_dataframe(
                        df,
                        featurizer_type,
                        multiindex=self.multiindex,
                        inplace=False,
                    )
                except Exception as e:
                    logger.info(
                        self._log_prefix