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

LFRic Apps apply upgrade macros script (Part 1) #38

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

james-bruten-mo
Copy link
Contributor

@james-bruten-mo james-bruten-mo commented Oct 15, 2024

This PR is to add the main part of the upgrade macro script for applying macros to LFRic. As described in #37 this work will be done in 2 commits, of which this is the first. This code will read through versions.py files, searching for newly added macros, and combine these macros where necessary. The 2nd part will add the rose commands to apply the upgrade macros as well as adding unit tests. Some development history and testing examples can also be seen in lfric_apps:#139 including a description of the overall approach on the details page. A PR for the working practices also exists.

This PR adds:

  • a main and parse args section
  • introduces the ApplyMacros class which is where the majority of the code is. This contains:
    • a section for sourcing required lfric_core and jules working copies (as these contain required metadata)
    • a section for reading and combining new upgrade macros (the majority)
  • some initial functions outside of the above class which provide some general functionality

The script can be tested by getting the following 2 branches:

  • fcm:lfric_apps.x_br/pkg/jamesbruten/vn1.1_macro_pkg
  • fcm:lfric.x_br/dev/jamesbruten/core1.1_core_macro_branch

And then running apply_macros.py vn1.1_t139 -a /path/to/apps -c /path/to/core. This upgrade macro is present in lfric_atm, transport, gungho and components/driver. After running the script, it should be removed from gungho and driver, combined with the existing macro in atm and transport and added to any metadata that imports any of those 4 (most of them in fact!).

@james-bruten-mo james-bruten-mo requested review from jennyhickson and t00sa and removed request for r-sharp November 11, 2024 09:23
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.

1 participant