How to use the smact.data_loader function in SMACT

To help you get started, we’ve selected a few SMACT 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 WMD-group / SMACT / smact / __init__.py View on Github external
def __init__(self,symbol,oxidation,coordination=4):
        Element.__init__(self,symbol)

        self.oxidation = oxidation
        self.coordination = coordination

        # Get shannon radius for the oxidation state and coordination.

        self.shannon_radius = None;

        shannon_data = data_loader.lookup_element_shannon_radius_data(symbol);

        if shannon_data:
            for dataset in shannon_data:
                if dataset['charge'] == oxidation and str(coordination) == dataset['coordination'].split('_')[0]:
                    self.shannon_radius = dataset['crystal_radius'];

        # Get ionic radius
        self.ionic_radius = None;

        if shannon_data:
            for dataset in shannon_data:
                if dataset['charge'] == oxidation and str(coordination) == dataset['coordination'].split('_')[0]:
                    self.ionic_radius = dataset['ionic_radius'];

        # Get SSE_2015 (revised) for the oxidation state.
github WMD-group / SMACT / smact / __init__.py View on Github external
if dataset['charge'] == oxidation and str(coordination) == dataset['coordination'].split('_')[0]:
                    self.shannon_radius = dataset['crystal_radius'];

        # Get ionic radius
        self.ionic_radius = None;

        if shannon_data:
            for dataset in shannon_data:
                if dataset['charge'] == oxidation and str(coordination) == dataset['coordination'].split('_')[0]:
                    self.ionic_radius = dataset['ionic_radius'];

        # Get SSE_2015 (revised) for the oxidation state.

        self.SSE_2015 = None

        sse_2015_data = data_loader.lookup_element_sse2015_data(symbol);
        if sse_2015_data:
            for dataset in sse_2015_data:
                if dataset['OxidationState'] == oxidation:
                    self.SSE_2015 = dataset['SolidStateEnergy2015']
        else:
            self.SSE_2015 = None
github WMD-group / SMACT / smact / __init__.py View on Github external
"""Initialise Element class

        Args:
            symbol (str): Chemical element symbol (e.g. 'Fe')

        """

        dataset = data_loader.lookup_element_data(symbol, copy=False)

        if dataset == None:
            raise NameError("Elemental data for {0} not found.".format(symbol))

        # Set coordination-environment data from the Shannon-radius data.
        # As above, it is safe to use copy = False with this Get* function.

        shannon_data = data_loader.lookup_element_shannon_radius_data(symbol, copy=False)

        if shannon_data != None:
            coord_envs = [row['coordination'] for row in shannon_data]
        else:
            coord_envs = None

        HHI_scores = data_loader.lookup_element_hhis(symbol)
        if HHI_scores == None:
            HHI_scores = (None, None)

        sse_data = data_loader.lookup_element_sse_data(symbol)
        if sse_data:
            sse = sse_data['SolidStateEnergy']
        else:
            sse = None
github WMD-group / SMACT / smact / __init__.py View on Github external
def __init__(self, symbol):
        """Initialise Element class

        Args:
            symbol (str): Chemical element symbol (e.g. 'Fe')

        """

        dataset = data_loader.lookup_element_data(symbol, copy=False)

        if dataset == None:
            raise NameError("Elemental data for {0} not found.".format(symbol))

        # Set coordination-environment data from the Shannon-radius data.
        # As above, it is safe to use copy = False with this Get* function.

        shannon_data = data_loader.lookup_element_shannon_radius_data(symbol, copy=False)

        if shannon_data != None:
            coord_envs = [row['coordination'] for row in shannon_data]
        else:
            coord_envs = None

        HHI_scores = data_loader.lookup_element_hhis(symbol)
        if HHI_scores == None: