Skip to content

gmtb/develop: metadata2html batch processing#223

Merged
climbfuji merged 3 commits into
NCAR:gmtb/developfrom
climbfuji:gmtb_develop_metadata2html_batchconvert
Sep 13, 2019
Merged

gmtb/develop: metadata2html batch processing#223
climbfuji merged 3 commits into
NCAR:gmtb/developfrom
climbfuji:gmtb_develop_metadata2html_batchconvert

Conversation

@climbfuji
Copy link
Copy Markdown
Collaborator

@climbfuji climbfuji commented Sep 12, 2019

This PR adds a batch processing option to the Python script metadata2html.py, which reads the host model's CCPP prebuild configuration and attempts to convert .meta files for each of the schemes and variable definition files defined.

For backward compatibility with the old metadata format, a warning is issued (instead of an exception) if the .meta cannot be found for a given file.

The technical documentation is updated to reflect these changes.

This PR requires adding a new variable to the CCPP prebuild config, see PR https://github.com/NCAR/NEMSfv3gfs/pull/246. A similar PR for SCM will be created in the next days when all SCM metadata is converted to the new format.

@climbfuji
Copy link
Copy Markdown
Collaborator Author

climbfuji commented Sep 12, 2019

The metadata2html.py script was tested for NEMSfv3gfs in conjunction with running doxygen afterwards to generate the complete scientific documentation. In addition, the CCPP prebuild script was run in both static and dynamic mode and with both debug mode turned on and off to ascertain that the small changes made in ccpp_prebuild.py do not break its functionality.

This PR can be reviewed and merged anytime.

@climbfuji climbfuji marked this pull request as ready for review September 12, 2019 14:53
@climbfuji
Copy link
Copy Markdown
Collaborator Author

@JulieSchramm @ligiabernardet I am not capable of generating the technical documentation, can someone let me know and/or test my changes to the tech doc?

Copy link
Copy Markdown
Collaborator

@gold2718 gold2718 left a comment

Choose a reason for hiding this comment

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

Did not carefully review the HTML stuff but otherwise, it looks okay.

Copy link
Copy Markdown
Collaborator

@gold2718 gold2718 left a comment

Choose a reason for hiding this comment

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

Wrong radio button in my previous "comment".


./ccpp/framework/scripts/metadata2html.py -c ccpp/config/ccpp_prebuild_config.py

Note that the options ``-c`` and ``-m`` are mutually exclusive, but that one of them is required. Option ``-m`` also requires
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 love argparse. Nice writeup of using the script.

Comment thread scripts/metadata2html.py
parser.add_argument('--outputdir', '-o', action='store',
help='directory where to write the html files',
required=True)
required='--metafile' in sys.argv or '-m' in sys.argv)
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.

Smart.

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.

... Prof. Google ...

Comment thread scripts/metadata2html.py
else:
# DH* Warn for now, raise exception later when
# old metadata format is no longer supported
logger.warn("Metadata file {} for source file {} not found, assuming old metadata format".format(
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.

The logic is that if something is still using the old metadata format, there is no need to generate a HTML table because it already exists in Doxygen-readable format, right?

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.

Yes.

Copy link
Copy Markdown
Collaborator

@grantfirl grantfirl left a comment

Choose a reason for hiding this comment

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

Lovely.

@climbfuji climbfuji merged commit 6abc50e into NCAR:gmtb/develop Sep 13, 2019
@climbfuji climbfuji deleted the gmtb_develop_metadata2html_batchconvert branch June 27, 2022 03:04
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.

3 participants