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)#
Create a new case from a bundle, guiding the user through YAML modifications.
Prompts the user to update destination paths and machine settings, then optionally opens $EDITOR for deeper edits. After confirmation, creates the case and copies non-standard CESM state per the plan.
- Parameters:
cesmroot (str or Path) – Path to the CESM root for the new case.
machine (str) – Machine name for the new case.
project_number (str) – Project/account number for the new case.
new_caseroot (str or Path) – Path for the new case root.
new_inputdir (str or Path) – Path for the new input directory.
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.
- 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.bundle module#
- 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)#
- 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’s crocodash_state.json.
- 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 copy the bundle for reference. If None, no bundle is saved.
- CrocoDash.shareable.bundle.get_case_obj(caseroot)#
- CrocoDash.shareable.bundle.run_xmlquery(caseroot, param)#