Topological Material Analysis 0.5
Analyse the structures of materials using tools from TDA
Loading...
Searching...
No Matches
toma_io Namespace Reference

Functions

 read_configuration (str configuration_file, str configuration)
 import a specified structure from a configuration file
 
 read_computation_settings (str settings_file, settings_name)
 import a specified settings from a file
 
 load_configuration_settings ()
 Load the configuration settings.
 
 load_computation_settings ()
 Load the computation settings.
 
 write_dgm_csv (dgm, file_path, plot_name="")
 Save a digram as a csv file, with the option to save a plot as well.
 
 save_plots ()
 Save plots to a directory.
 

Function Documentation

◆ load_computation_settings()

toma_io.load_computation_settings ( )

Load the computation settings.

Load computation settings from the session state

This function reads computation settings from st.session_state and loads them into the session state. It uses read_computation_settings() to parse the settings file and extract:

  • n_threads: Number of threads for Oineus to use
  • save_plots: Whether to save plots
  • kernel: Whether to compute kernel persistence
  • image: Whether to compute image persistence
  • cokernel: Whether to compute cokernel persistence
  • thickness: Thickness settings

◆ load_configuration_settings()

toma_io.load_configuration_settings ( )

Load the configuration settings.

Load configuration settings from the session state

This function reads configuration settings from st.session_state and loads them into the session state. It uses read_configuration() to parse the config file and extract:

  • atoms: ASE Atoms object containing atomic positions and types
  • radii: Dictionary mapping atom types to their radii
  • repeat_x/y/z: Number of times to repeat the cell in each direction

The settings are read from:

  • st.session_state["config_file"]: Path to configuration file
  • st.session_state["config_name"]: Name of configuration section to use

The parsed settings are stored back in st.session_state as:

  • st.session_state.atoms
  • st.session_state.radii
  • st.session_state.repeat_x/y/z

◆ read_computation_settings()

toma_io.read_computation_settings ( str settings_file,
settings_name )

import a specified settings from a file

Parameters
settings_filepath to the file to use for configurations
settings_namename of the structure to use
Returns
n_threads, save_plots, kernel, image, cokernel, thickness the number of threads for Oineus to use, wether plots should be saved, compute kernel persistence, compute image persistence, compute cokernel persistence, thickness settings

◆ read_configuration()

toma_io.read_configuration ( str configuration_file,
str configuration )

import a specified structure from a configuration file

Parameters
configuration_filepath to the file to use for configurations
configurationname of the structure to use
Returns
atoms, radii, repeat_x, repeat_y, repeat_z the atom symbols, radii to use for the atoms, repetition in x-axis, repetition in y-axis, repetition in z-axis

◆ save_plots()

toma_io.save_plots ( )

Save plots to a directory.

Save plots to a directory

This function saves plots to a specified directory. It uses the following from st.session_state:

  • st.session_state.file_path: Path to the file containing the data
  • st.session_state.sample_indices: Indices of samples to process
  • st.session_state.params: Computation settings

◆ write_dgm_csv()

toma_io.write_dgm_csv ( dgm,
file_path,
plot_name = "" )

Save a digram as a csv file, with the option to save a plot as well.

Parameters
dgmthe diagram to be saved, and plotted
dirdirectory in which to save the files
namename of the structure
save_plotsave the plots as well