rizer.io.cross_sections.load_cross_sections#
Classes#
Dataclass to handle cross section information for each reaction. |
Functions#
|
Group items by their equation attribute, preserving first-seen order. |
|
Load the yaml file containing the link between equation and alias for each database. |
|
|
|
Filter the cross section to load, after a deepcopy. |
|
Load cross section data. |
Module Contents#
- rizer.io.cross_sections.load_cross_sections.group_by_equation[T: _HasEquation](items: list[T]) dict[str, list[T]]#
Group items by their equation attribute, preserving first-seen order.
Shared by cross-section grouping here and, for the rate-fit types, rizer.kinetics.fit.rate_fit_common.group_and_sort_rates_by_equation.
- class rizer.io.cross_sections.load_cross_sections.CrossSectionData#
Dataclass to handle cross section information for each reaction.
- rizer.io.cross_sections.load_cross_sections.load_cross_sections_summary_yaml(path_to_cross_sections_yaml: pathlib.Path = get_path_to_data('cross_sections', 'lxcat_cross_sections', 'cross_sections_summary.yaml')) dict[str, dict[str, dict[str, str]]]#
Load the yaml file containing the link between equation and alias for each database.
- Parameters:
path_to_cross_sections_yaml (
pathlib.Path, optional) – Path to yaml file. See ./data/cross_sections/lxcat_cross_sections/cross_sections_summary.yaml for more.- Returns:
Example given:
# Name of the species, and the folder as well. {“H2”: # The reaction as it will appear in the kinetic scheme. {“e- + H2 => e- + e- + H2+”: # The name of the file/database, with the corresponding process name in that file. {“Biagi.txt”: “H2 -> +ionized H2”}}}
- Return type:
- rizer.io.cross_sections.load_cross_sections.raise_type_error_on_isinstance(variable_to_test, expected_type, name_of_variable)#
- rizer.io.cross_sections.load_cross_sections.filter_cross_sections_to_load(data: dict[str, dict[str, dict[str, str]]], species_to_keep: str | list[str] | None = None, species_to_remove: str | list[str] | None = None, equations_to_keep: str | list[str] | None = None, equations_to_remove: str | list[str] | None = None) dict[str, dict[str, dict[str, str]]]#
Filter the cross section to load, after a deepcopy.
Can be useful, to avoid loading all the data if only a subsection is required.
- Parameters:
data (
dictofstrtodictofstrtodictofstrtostr) – See load_cross_sections_summary_yaml.species_to_keep (
strorlistofstrorNone, optional) – Keep only the species provided, by default None. If None, keep all. If not None, cannot be set at the same time as species_to_remove.species_to_remove (
strorlistofstrorNone, optional) – Remove the species provided, by default None. If None, no species are removed. If not None, cannot be set at the same time as species_to_keep.equations_to_keep (
strorlistofstrorNone, optional) – Keep only the equation provided, by default None. If None, keep all. If not None, cannot be set at the same time as equations_to_remove.equations_to_remove (
strorlistofstrorNone, optional) – Remove the equation provided, by default None. If None, no equation are removed If not None, cannot be set at the same time as equations_to_keep.
- Returns:
See load_cross_sections_summary_yaml.
- Return type: