glasspy package — GlassPy latest documentation

# glasspy package

## Subpackages

- glasspy.chemistry package
  - Submodules
  - glasspy.chemistry.convert module
    - `mol_to_wt()`
    - `rescale_array()`
    - `to_array()`
    - `to_element_array()`
    - `wt_to_mol()`
  - glasspy.chemistry.data module
  - glasspy.chemistry.featurizer module
    - `physchem_featurizer()`
  - glasspy.chemistry.types module
    - `ChemArray`
  - Module contents
    - `ChemArray`
    - `mol_to_wt()`
    - `physchem_featurizer()`
    - `rescale_array()`
    - `to_array()`
    - `to_element_array()`
    - `wt_to_mol()`
- glasspy.data package
  - Submodules
  - glasspy.data.load module
    - `SciGlass`
      - `SciGlass.data`
      - `SciGlass.available_properties()`
      - `SciGlass.available_properties_metadata()`
      - `SciGlass.elements_from_compounds()`
      - `SciGlass.get_compounds()`
      - `SciGlass.get_elements()`
      - `SciGlass.get_properties()`
      - `SciGlass.remove_duplicate_composition()`
      - `SciGlass.remove_zero_sum_columns()`
  - glasspy.data.translators module
  - Module contents
    - `SciGlass`
      - `SciGlass.data`
      - `SciGlass.available_properties()`
      - `SciGlass.available_properties_metadata()`
      - `SciGlass.elements_from_compounds()`
      - `SciGlass.get_compounds()`
      - `SciGlass.get_elements()`
      - `SciGlass.get_properties()`
      - `SciGlass.remove_duplicate_composition()`
      - `SciGlass.remove_zero_sum_columns()`
- glasspy.predict package
  - Submodules
  - glasspy.predict.base module
    - `AE`
      - `AE.configure_optimizers()`
      - `AE.distance_from_training()`
      - `AE.domain`
      - `AE.forward()`
      - `AE.get_test_dataset()`
      - `AE.get_training_dataset()`
      - `AE.get_validation_dataset()`
      - `AE.is_within_domain()`
      - `AE.learning_curve_train`
      - `AE.learning_curve_val`
      - `AE.load_training()`
      - `AE.predict()`
      - `AE.save_training()`
      - `AE.training_epoch_end()`
      - `AE.training_step()`
      - `AE.validation_epoch_end()`
      - `AE.validation_step()`
    - `Domain`
      - `Domain.compound`
      - `Domain.element`
    - `MLP`
      - `MLP.configure_optimizers()`
      - `MLP.distance_from_training()`
      - `MLP.domain`
      - `MLP.get_test_dataset()`
      - `MLP.get_training_dataset()`
      - `MLP.is_within_domain()`
      - `MLP.learning_curve_train`
      - `MLP.learning_curve_val`
      - `MLP.load_training()`
      - `MLP.on_train_epoch_end()`
      - `MLP.on_validation_epoch_end()`
      - `MLP.save_training()`
      - `MLP.training_step()`
      - `MLP.validation_step()`
    - `MTL`
      - `MTL.training_step()`
      - `MTL.validation_step()`
    - `Predict`
      - `Predict.MAE()`
      - `Predict.MSE()`
      - `Predict.MedAE()`
      - `Predict.PercAE()`
      - `Predict.R2()`
      - `Predict.RD()`
      - `Predict.RMSE()`
      - `Predict.RRMSE()`
      - `Predict.domain`
      - `Predict.get_test_dataset()`
      - `Predict.get_training_dataset()`
      - `Predict.is_within_domain()`
      - `Predict.predict()`
  - glasspy.predict.models module
    - `GlassNet`
      - `GlassNet.predict()`
    - `GlassNetMTMH`
      - `GlassNetMTMH.forward()`
      - `GlassNetMTMH.hparams`
      - `GlassNetMTMH.target_trans`
      - `GlassNetMTMH.targets`
      - `GlassNetMTMH.training_file`
    - `GlassNetMTMLP`
      - `GlassNetMTMLP.hparams`
      - `GlassNetMTMLP.target_trans`
      - `GlassNetMTMLP.targets`
      - `GlassNetMTMLP.training_file`
    - `GlassNetSTNN`
      - `GlassNetSTNN.forward()`
      - `GlassNetSTNN.hparams`
      - `GlassNetSTNN.training_step()`
      - `GlassNetSTNN.validation_step()`
    - `ViscNet`
      - `ViscNet.absolute_features`
      - `ViscNet.featurizer()`
      - `ViscNet.hparams`
      - `ViscNet.log_viscosity_fun()`
      - `ViscNet.parameters_range`
      - `ViscNet.state_dict_path`
      - `ViscNet.weighted_features`
      - `ViscNet.x_mean`
      - `ViscNet.x_std`
    - `ViscNetHuber`
    - `ViscNetVFT`
      - `ViscNetVFT.log_viscosity_fun()`
  - Module contents
    - `GlassNet`
      - `GlassNet.predict()`
    - `GlassNetMTMH`
      - `GlassNetMTMH.allow_zero_length_dataloader_with_multiple_devices`
      - `GlassNetMTMH.forward()`
      - `GlassNetMTMH.hparams`
      - `GlassNetMTMH.precision`
      - `GlassNetMTMH.prepare_data_per_node`
      - `GlassNetMTMH.target_trans`
      - `GlassNetMTMH.targets`
      - `GlassNetMTMH.training`
      - `GlassNetMTMH.training_file`
    - `GlassNetMTMLP`
      - `GlassNetMTMLP.allow_zero_length_dataloader_with_multiple_devices`
      - `GlassNetMTMLP.hparams`
      - `GlassNetMTMLP.precision`
      - `GlassNetMTMLP.prepare_data_per_node`
      - `GlassNetMTMLP.target_trans`
      - `GlassNetMTMLP.targets`
      - `GlassNetMTMLP.training`
      - `GlassNetMTMLP.training_file`
    - `GlassNetSTNN`
      - `GlassNetSTNN.allow_zero_length_dataloader_with_multiple_devices`
      - `GlassNetSTNN.forward()`
      - `GlassNetSTNN.hparams`
      - `GlassNetSTNN.precision`
      - `GlassNetSTNN.prepare_data_per_node`
      - `GlassNetSTNN.training`
      - `GlassNetSTNN.training_step()`
      - `GlassNetSTNN.validation_step()`
    - `ViscNet`
      - `ViscNet.absolute_features`
      - `ViscNet.allow_zero_length_dataloader_with_multiple_devices`
      - `ViscNet.featurizer()`
      - `ViscNet.hparams`
      - `ViscNet.log_viscosity_fun()`
      - `ViscNet.parameters_range`
      - `ViscNet.precision`
      - `ViscNet.prepare_data_per_node`
      - `ViscNet.state_dict_path`
      - `ViscNet.training`
      - `ViscNet.weighted_features`
      - `ViscNet.x_mean`
      - `ViscNet.x_std`
    - `ViscNetHuber`
    - `ViscNetVFT`
      - `ViscNetVFT.log_viscosity_fun()`
- glasspy.viscosity package
  - Submodules
  - glasspy.viscosity.diffusion module
    - `diff_coeff_eyring()`
    - `diff_coeff_stokeseinstein()`
  - glasspy.viscosity.equilibrium module
    - `ag()`
    - `am()`
    - `am_alt()`
    - `myega()`
    - `myega_alt()`
    - `vft()`
    - `vft_alt()`
  - glasspy.viscosity.equilibrium_log module
    - `ag()`
    - `am()`
    - `am_alt()`
    - `myega()`
    - `myega_alt()`
    - `vft()`
    - `vft_alt()`
  - Module contents

## Submodules

## glasspy.support module

glasspy.support.round_number_with_error(x, error)

  Round numbers with respect of their errors.

  x:

    Array-like object with numbers. These are the values that will be rounded.

  Error

  Array-like object with numbers. These are the errors that will guid the rounding of x.

  Returns:

    Rounded values of x. .. error:: Error of x with 1 significant digit.

    text:

      String array with the values of x with error represented in parenthesis.

  Return type:

    x

  Raises:

    AssertionError – Happens when you have a negative value in the error argument. Errors must be positive.

glasspy.support.round_to_closest_base(x, base)

  Round numbers to closest base number.

  Parameters:

    - x – Array-like object with numbers.

    - base – Float to which the numbers will be rounded.

  Returns:

    Numpy array with the rounded numbers.

  Note

  Implementation by Alok Singhal found in https://stackoverflow.com/a/2272174.

glasspy.support.round_to_significant_figure(x, n)

  Round numbers to n sifnificant digits.

  Parameters:

    - x – Array-like object with numbers.

    - n – Integer representing the number of significant digits to round to. Must be the same shape as x.

  Returns:

    Numpy array with the numbers rounded to the desired significant digits.

  Note

  Implementation by Scott Gigante found in https://stackoverflow.com/a/59888924.

## Module contents