Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete support for time step modification #58

Merged
merged 10 commits into from
Sep 4, 2024

Conversation

dafyddstephenson
Copy link
Contributor

@dafyddstephenson dafyddstephenson commented Aug 30, 2024

Branched from #55 , do not merge until merging PR55.
Closes #57 .

This PR:

  • updates the commit hash of the additional code in the roms-marbl example blueprint to point to a commit with a new template namelist file containing a placeholder string in place of the time step.
  • adds logic to roms/component.py to replace this placeholder string with ROMSComponent.time_step

“Dafydd added 6 commits August 22, 2024 17:25
- Move DataSource out of base/input_dataset.py and into dedicated module base/datasource.py
- Expand DataSource to check if location is a directory or local repository
- Rename AdditionalCode.source_repo to AdditionalCode.source and change type to DataSource
- Make checkout_target an optional attribute to AdditionalCode (default None)
- Wrap existing AdditionalCode.get() inside conditional check for 'url','repository'
- Rename 'source' and 'source_repo' to 'location' in Case.from_blueprint, Case.persist, and cstar_blueprint_roms_marbl_example.yaml
Still todo:
- update docstrings
- update example notebook
- update AdditionalCode.get() to support copying local files
- swap out os for pathlib in additional_code.py and datasource.py
- fix typo in input_dataset.py
- minor changes to case.py with additional type checking
…st and modify/run with the copy (roms/component.py)

- Update pre-commit file to replace remaining instance of cstar_ocean with cstar
- Update InputDataset.local_path to point to the symlink created by InputDataset.get() after call (if dataset is local)
- Update test_roms_marb_example.py to also include local paths to additional code in 2nd case
…ional code file support

- Rename "source" (DataSource) to "location" (str) in __init__ for AdditionalCode and InputDataset.
  The method uses this arg to create the "source" attribute using source=DataSource(location).
  This avoids requiring the user to create and supply a DataSource object which itself is just
  instantiated from a location string.
- Rename "local_path" to "local_dir" in AdditionalCode.get to avoid confusion with AdditionalCode.local_path
- Add an attribute AdditionalCode.modified_namelists to keep track of edited namelists based on templates
- Add logic in AdditionalCode.get() that makes copies of any namelist files with the suffix _TEMPLATE
  to a file without this suffix and adds it to AdditionalCode.modified_namelists, e.g.:
  AdditionalCode.namelists = ["roms.in_TEMPLATE",] -> AdditionalCode.modified_namelists = ["roms.in",]
- Update ROMSComponent.pre_run() and ROMSComponent.run() to reflect this namelist handling
- Minor changes to __str__ in component.py (addressing inconsistencies)
- Update cstar_example_notebook.ipynb to reflect all of the above changes
@dafyddstephenson dafyddstephenson added the enhancement New feature or request label Aug 30, 2024
@dafyddstephenson dafyddstephenson added this to the alpha milestone Aug 30, 2024
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@dafyddstephenson dafyddstephenson merged commit 4a7d66a into CWorthy-ocean:main Sep 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Complete support for time step control
1 participant