gcpy.benchmark.modules.benchmark_species_changes
Generates a list of species that differ between versions, that can be printed on the GEOS-Chem wiki.
Example
$ conda activate gcpy_env
$ python gcpy.benchmark.modules.benchmark_species_changes \
--ref-label "14.4.0" \
--ref-log "gcc_14.4.0/14.4.0.log" \
--dev-label "14.5.0" \
--dev-log "gcc_14.5.0/14.5.0.log" \
--spcdb-files ["gcc_14.4.0/species_database.yml", \
"gcc_14.5.0/species_database.yml"], \
--output-file "wiki_tables.txt"
Functions
|
Copies dictionary keys from the species database to the existing dictionary. |
|
Converts a boolean True value to an "X" for printing in the wiki table. |
|
Prints a list of species with attributes that have changed between the Ref and Dev versions. |
|
Creates a wiki table containing selected species. |
|
Returns the relevant metadata for a given species, taken from a GEOS-Chem log file as well as from the species database. |
|
Parses command-line arguments. |
Creates tables of species that have been added and removed between Ref and Dev versions. |
|
|
Parses the GEOS-Chem Classic log file (plain text) with timing information and returns a dictionary with the results. |
|
Prints metadata for a given GEOS-Chem species. |
|
Writes the footer for a wiki table. |
|
Writes the header of a wiki table. |
- gcpy.benchmark.modules.benchmark_species_changes.read_one_log_file(log_file)[source]
Parses the GEOS-Chem Classic log file (plain text) with timing information and returns a dictionary with the results.
- gcpy.benchmark.modules.benchmark_species_changes.append_keys(species, species_database, keys)[source]
Copies dictionary keys from the species database to the existing dictionary.
- gcpy.benchmark.modules.benchmark_species_changes.get_species_metadata(log_file, species_database)[source]
Returns the relevant metadata for a given species, taken from a GEOS-Chem log file as well as from the species database.
- gcpy.benchmark.modules.benchmark_species_changes.bool_to_str(val)[source]
Converts a boolean True value to an “X” for printing in the wiki table.
- Parameters:
val (
bool) – Boolean value to test.
- gcpy.benchmark.modules.benchmark_species_changes.write_wiki_table_header(ofile)[source]
Writes the header of a wiki table.
- Parameters:
ofile (
io.TextIOWrapper) – Output file handle.
- gcpy.benchmark.modules.benchmark_species_changes.write_wiki_row(species, ofile)[source]
Prints metadata for a given GEOS-Chem species.
- Parameters:
species (
pd.Series) – GEOS-Chem species metadata.ofile (
file) – File object for output file.
Writes the footer for a wiki table.
- Parameters:
ofile (
io.TextIOWrapper) – Output file handle.
- gcpy.benchmark.modules.benchmark_species_changes.create_table(keys, species, ofile)[source]
Creates a wiki table containing selected species.
- Parameters:
keys (
list) – Names of species to include in table.species (
pd.DataFrame) – Species metadata.ofile (
io.TextIOWrapper) – Output file handle.
- gcpy.benchmark.modules.benchmark_species_changes.check_for_species_changes(species, ref, dev)[source]
Prints a list of species with attributes that have changed between the Ref and Dev versions.
- Parameters:
species (
list) – List of species in both Ref and Dev.ref (
pd.DataFrame) – Species metadata for the Ref version.dev (
pd.DataFrame) – Species metadata for the Dev version.
- gcpy.benchmark.modules.benchmark_species_changes.make_benchmark_species_changes_wiki_tables(ref_label, ref_log, dev_label, dev_log, spcdb_files, output_file)[source]
Creates tables of species that have been added and removed between Ref and Dev versions.
- Parameters:
ref_label (
str) – Label for the Ref version.ref_log (
str) – Path to log file for the Ref version.dev_label (
str) – Label for the Dev version.dev_log (
str) – Path to log file for the Dev version.spcdb_files (
list) – Paths to Ref & Dev species_database.yml files.output_file (
str) – Path to file with generated wiki tables.