Skip to content

Version TinkerTool 0.3.1#18

Merged
Ovewh merged 143 commits into
mainfrom
main-dev
Feb 24, 2026
Merged

Version TinkerTool 0.3.1#18
Ovewh merged 143 commits into
mainfrom
main-dev

Conversation

@Ovewh

@Ovewh Ovewh commented Jan 27, 2026

Copy link
Copy Markdown
Collaborator

This is major update to Tinkertool.

  • The changes made in general noresm version is brought into the main version of tinkertool.
  • One at the time test functionality is added
  • New method for perturbing parameters using f-strings. Closes Implement emission scalings as parameter than can be used in a PPE #16
  • generate-paramfile have been simplified, compared to the general noresm version.
  • usermods is now used to highlight scripts that have been developed for different ppe.
  • Improved documentation using mkdocs.

Johannesfjeldsaa and others added 30 commits May 26, 2025 15:24
…. Introduce env_pe and env_build as optional entries in simulation_setup. Introduce componentdict passing to clone_base_case to send correct parameter to correct component.
…file and routine for prestaging restart files if one is running hybrid or branch runs
Ovewh and others added 6 commits February 23, 2026 15:43
…ecov-settings

Revert "Configure Codecov coverage reporting"
Bumps [nbconvert](https://github.com/jupyter/nbconvert) from 7.16.6 to 7.17.0.
- [Release notes](https://github.com/jupyter/nbconvert/releases)
- [Changelog](https://github.com/jupyter/nbconvert/blob/main/CHANGELOG.md)
- [Commits](jupyter/nbconvert@v7.16.6...v7.17.0)

---
updated-dependencies:
- dependency-name: nbconvert
  dependency-version: 7.17.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Comment thread README.md Outdated
Comment thread pyproject.toml Outdated
prestage-ensemble = "tinkertool.scripts.create_ppe.main:prestage_ensemble_CLI"
submit-ppe = "tinkertool.scripts.create_ppe.main:submit_ppe_CLI"
generate-paramfile = "tinkertool.scripts.generate_paramfile.main:main"
aerosol-ppe-cam-nl = "usermods.aerosol_ppe.scripts.aerosol_ppe_cam_nl_updates:main"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should useermods be part of a release?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed might not need be defined as an installable script.

Comment thread docs/configuration.md

**namelist_control** - This section holds key-value pairs used for pointing to .ini files used to generate custom user_nl_<component> files. A valid section would be something like
## namelist_control
- This section holds key-value pairs used for pointing to .ini files used to generate the user_nl_<component> which hold settings that are shared between all ensemble members. A valid section would be something like

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont fully remember the behavior but if I remeber correctly it was program such that all things in the default namelist overwritten? If that's still the case it could be a usefull warning.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default namelist only overwritten if "f-string" parameters are used. Otherwise we only apped to the namelist file.

Comment thread docs/installation.md Outdated
Comment thread docs/usage.md
optimization=None,
avoid_scramble=False,
params=None,
assumed_esm_component='cam',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a dangerous argument.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which argument in particular?

err_msg = f"build_ppe returned 'None' but list of cases was expected since build_base_only={build_config.build_base_only}"
logging.error(err_msg)
raise RuntimeError(err_msg)
else:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else not needed if RuntimeError is raised

raise RuntimeError(err_msg)
else:
# build_base_only=True, so no cases to submit
logging.info(">> Base case built successfully. No ensemble cases to submit.")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a system for the number of ">" ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, Perhaps something to consider going forward.

Comment thread tinkertool/scripts/create_ppe/create_ppe.py Outdated

if not check_build_success:
logging.error(unsuccessful_build_msg)
return

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raise some error instead of return?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check.build does not really work that well currently. E.g. if you do clone case, then check.build will fail. How it should work is that if create_clone is used, the check for build success only in the base_case.

>> for details on the commands, run 'check-build --help', 'prestage-ensemble --help' and 'submit-ppe --help'
"""

def create_ppe(config: CreatePPEConfig):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure of the behavior of logging if log_mode is write. Does every config object, e.g. check_build_config = CheckBuildConfig(
cases=cases_for_check_build,
verbose=config.verbose,
log_dir=config.log_dir,
log_mode=config.log_mode
)

make their own log file in the log_dir or do they go for the same file? if it's the same file an log_mode is write it would overwrite?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps add docstrings to all this functions as they are a direct entry point

Comment thread tinkertool/scripts/create_ppe/create_ppe.py Outdated
log_info_detailed('tinkertool_log', f"Building ensemble {i} of {checked_config.num_sims}")
ensemble_idx = f"{i:03d}"
tempParamDataset = checked_config.paramDataset.isel({checked_config.pdim: idx})
# Special treatment for chem_mech.in changes:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps the special treatment stuff deserves another level of abstraction, i.e. pulling it out into a new function. Makes it somewhat more modular and easy to read/follow

Comment thread tinkertool/utils/check_arguments.py

@Johannesfjeldsaa Johannesfjeldsaa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done merging things! left some comments, some which is probably on my code as well. I am a little bit unsure if adding usermods to a version pr is good practice?

Also, note that I opened a PR to main-dev: #26. The changes are not that big but they are, in my opinion usefull and can be considered to be included in this version. Else I can change target to main after this one is pulled in.

@Ovewh

Ovewh commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator Author

@Johannesfjeldsaa Thanks for the review and helpfull suggestion. I'll go ahead and merge the changes into main for now. Then keep in mind the suggested improvement for the next release

@Ovewh Ovewh merged commit b8313ed into main Feb 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement emission scalings as parameter than can be used in a PPE

5 participants