CrocoDash.shareable package#
Submodules#
CrocoDash.shareable.apply module#
- CrocoDash.shareable.apply.apply_xmlchanges_to_case(old_caseroot, xmlchangeparams)#
- CrocoDash.shareable.apply.copy_configurations_to_case(old_forcing_config, case, inputdir_ocnice)#
Copy forcing configurations from inputdir_ocnice to case.inputdir/ocnice.
- CrocoDash.shareable.apply.copy_source_mods_from_case(old_caseroot, new_caseroot, short_filepaths)#
- CrocoDash.shareable.apply.copy_user_nl_params_from_case(old_caseroot, usernlparams)#
- CrocoDash.shareable.apply.copy_xml_files_from_case(old_caseroot, new_caseroot, filenames)#
CrocoDash.shareable.fork module#
- class CrocoDash.shareable.fork.BundleDifferences(xml_files_missing_in_new: list = <factory>, user_nl_missing_params: dict = <factory>, source_mods_missing_files: list = <factory>, xmlchanges_missing: list = <factory>)#
Bases:
object- source_mods_missing_files: list#
- user_nl_missing_params: dict#
- xml_files_missing_in_new: list#
- xmlchanges_missing: list#
- class CrocoDash.shareable.fork.BundleManifest(forcing_config: dict, init_args: dict, paths: dict = <factory>, user_nl_info: dict = <factory>, sourcemods: list = <factory>, xmlchanges: dict = <factory>)#
Bases:
object- forcing_config: dict#
- init_args: dict#
- paths: dict#
- sourcemods: list#
- user_nl_info: dict#
- xmlchanges: dict#
- class CrocoDash.shareable.fork.ForkCrocoDashBundle(bundle_location)#
Bases:
objectShare a CESM case by inspecting an existing CrocoDash bundle, optionally copying non-standard components, resolving forcing configurations, and creating a new case with equivalent forcings.
- apply_copy_plan()#
- fork(cesmroot, machine, project_number, new_caseroot, new_inputdir, plan=None, compset=None, extra_configs=None, remove_configs=None, extra_forcing_args_path=None)#
Share a CESM case by inspecting an existing bundle, optionally copying non-standard components, resolving forcing configurations, and creating a new case with equivalent forcings.
- Parameters:
cesmroot (str or Path) – Path to the CESM root.
machine (str) – Machine name.
project_number (str) – Project/account number.
new_caseroot (str or Path) – Path for the new case root.
new_inputdir (str or Path) – Path for input data.
plan (dict, optional) – Which non-standard items to copy, e.g.
{"xml_files": True, "user_nl": False, "source_mods": True, "xmlchanges": True}. When omitted the user is asked interactively.compset (str, optional) – Override the compset from the bundle. When omitted the user is asked interactively.
extra_configs (list, optional) – Additional forcing configuration names to add beyond the bundle.
remove_configs (list, optional) – Forcing configuration names from the bundle to drop.
extra_forcing_args_path (str or Path, optional) – Path to a JSON file supplying arguments for any new forcing configs.
- CrocoDash.shareable.fork.ask_string(prompt: str, default='') → str#
Prompt the user for a string input and return it.
Parameters:#
- promptstr
The message to display to the user.
Returns:#
- str
The input string from the user.
- CrocoDash.shareable.fork.ask_yes_no(prompt: str, default=True) → bool#
Prompt the user with a yes/no question and return True for ‘yes’ and False for ‘no’.
Works in both command-line and Jupyter notebooks.
Parameters:#
- promptstr
The question to present to the user.
Returns:#
- bool
True if the user answers ‘yes’, False if ‘no’.
- CrocoDash.shareable.fork.create_case(init_args, caseroot, inputdir, machine, project_number, cesmroot, compset)#
- CrocoDash.shareable.fork.generate_configure_forcing_args(forcing_config, remove_configs=None)#
CrocoDash.shareable.bundle module#
Bundle is inordinately hard-coded, and probably can’t be changed. Robust testing is needed to ensure we are picking up the correct information
- class CrocoDash.shareable.bundle.BundleCrocoDashCase(caseroot)#
Bases:
objectThis class is a support case for reading CrocoDash-CESM Cases that uses CIME’s case object This design started with individual functions, and got a bit too unwieldy!
- bundle(output_folder_location, machine=None, project=None)#
- property case#
- diff(other_case)#
Diff this case (as the original) against another ReadCase (which is assumed to have been initialized the same). The diff indicates what unique features in the original are not in the new
Returns a structured diff of: - xmlchanges - xml files - user_nls - sourcemods
- duplicate_case(new_caseroot, new_inputdir, bundle_dir=None)#
- generate_manifest() → BundleManifest#
- get_user_nl_value(component, param)#
- identify_non_standard_CrocoDash_case_information(cesmroot, machine, project_number)#
- reread()#
- CrocoDash.shareable.bundle.duplicate_case(caseroot, new_caseroot, new_inputdir, bundle_dir=None)#
Duplicate a CrocoDash case to a new location. Machine, project, and cesmroot are read automatically from the original caseroot.
- Parameters:
caseroot (str or Path) – Path to the existing case to duplicate.
new_caseroot (str or Path) – Path for the new case.
new_inputdir (str or Path) – Path for the new input directory.
bundle_dir (str or Path, optional) – Where to write the intermediate bundle. Defaults to inside new_caseroot and is cleaned up automatically.
- CrocoDash.shareable.bundle.get_case_obj(caseroot)#
- CrocoDash.shareable.bundle.run_xmlquery(caseroot, param)#