Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!-- Please read all instructions, then fill out the following template.-->

<!-- If this PR includes changes to standard names, you must update the Markdown and YAML files
to be consistent with your changes to standard_names.xml.

This can be done by running the following commands:

tools/write_standard_name_table.py --output-format md standard_names.xml

This script requires the pyyaml Python package; to install with pip use command:
python -m pip install PyYaml
For conda users, environment file tools/environment.yml is provided.

Note that the above procedure assumes your changes were made to standard_names.xml If you instead
made your changes to one of the human-readable files (Metadata-standard-names.md or
Metadata-standard-names.yaml), YOU MUST UPDATE THE FILE standard_names.xml MANUALLY, otherwise your
changes may be lost.
-->

<!-- Include a short, descriptive title in the field above. If this PR is for a branch other than
`main`, include the destination branch name in brackets at the beginning, e.g.:

[release/v1] Bugfix for release/v1 branch

Tag this pull request with appropriate labels. If you do not have permission to add labels, list
the labels you’d like to include in your PR description

If this PR is not ready to be reviewed or merged, open as a draft, and include "DRAFT:" as a prefix
to the title above.

Developers listed in the CODEOWNERS file will automatically be assigned to review your Pull Request.
If your contribution should be reviewed by anyone else, assign those reviewers manually from the
menu at right, or by tagging them with @USERNAME in the Description text.

Changes to standard names and/or descriptions should be made in the standard_names.xml file. The
files Metadata-standard-names.md and Metadata-standard-names.yaml will need to be updated before
a pull request is merged; this can be done manually by the PR author using the script
tools/write_standard_name_table.py or will be done by the Code Manager prior to merging via Github
Actions.

Be sure to check in on the PR regularly to respond to comments/questions/reviews!
-->

## Description
<!-- One or more paragraphs describing the proposed changes and the reasoning behind them. -->

## Issues
<!-- Link any associated GitHub issues in this or other repositories here. -->


76 changes: 53 additions & 23 deletions .github/workflows/pull_request_ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
name: Pull request checks

on:
pull_request:
workflow_dispatch:
pull_request:
branches:
- main
- release/*

jobs:
check-unique-standard-names:
name: Check for duplicates in standard names
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-python@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install xmllint
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install libxml2-utils
sudo apt-get update
sudo apt-get -y install libxml2-utils

- name: Check for duplicate standard names, descriptions
run: |
Expand All @@ -32,42 +38,66 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-python@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

# Install dependencies
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install libxml2-utils


- name: Checks standard names against character rules
run: |
python3 tools/check_name_rules.py -s standard_names.xml

check-rerendered-markdown:
test-rendering:
name: Test rendering xml file to markdown and yaml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-python@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install xmllint
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install libxml2-utils
sudo apt-get update
sudo apt-get -y install libxml2-utils
python -m pip install --upgrade pip
python -m pip install PyYaml

- name: Check markdown has been rerendered
- name: Test rendering xml file to markdown
run: |
# Checks if the saved markdown matches freshly rendered markdown.
# If this fails you have likely forgotten to rerun the write script
# after adding a new name, or updating its description.
checksum=$(sha256sum Metadata-standard-names.md)
tools/write_standard_name_table.py standard_names.xml
test "$checksum" = "$(sha256sum Metadata-standard-names.md)"

# Checks if the saved markdown matches freshly rendered markdown.
# If this fails, prompt user to update
tools/write_standard_name_table.py --output-format md standard_names.xml
if ! git diff --exit-code --quiet; then
echo "❌ Detected that Metadata-standard-names.md is not consistent with standard_names.xml"
echo "✅ To fix: Run the following command locally and commit the result:"
echo " tools/write_standard_name_table.py --output-format md standard_names.xml"
echo "📘 This script requires the pyyaml Python package; to install with pip use command:"
echo " python -m pip install PyYaml"
echo "📘 For conda users, environment file tools/environment.yml is provided."
echo
exit 1
fi

- name: Test rendering xml file to yaml
run: |
tools/write_standard_name_table.py --output-format yaml standard_names.xml
if ! git diff --exit-code --quiet; then
echo "❌ Detected that Metadata-standard-names.yaml is not consistent with standard_names.xml"
echo "✅ To fix: Run the following command locally and commit the result:"
echo " tools/write_standard_name_table.py --output-format yaml standard_names.xml"
echo "📘 This script requires the pyyaml Python package; to install with pip use command:"
echo " python -m pip install PyYaml"
echo "📘 For conda users, environment file tools/environment.yml is provided."
echo
exit 1
fi

2 changes: 1 addition & 1 deletion CODEOWNERS
Copy link
Collaborator

Choose a reason for hiding this comment

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

this codeowner file contains errors, we need to fix

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added @MarekWlasak as a collaborator; this probably should have been done earlier since his name has been in the CODEOWNERS file of the main branch since March. Once he accepts the error should resolve.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# These owners will be the default owners for everything in the repo.

* @cacraigucar @climbfuji @dustinswales @gold2718 @grantfirl @mattldawson @mkavulich @mwaxmonsky @nusbaume @peverwhee @svahl991 @MayeulDestouches @ss421
* @cacraigucar @climbfuji @dustinswales @gold2718 @grantfirl @mattldawson @mkavulich @mwaxmonsky @nusbaume @peverwhee @MarekWlasak @svahl991 @ss421

# Order is important. The last matching pattern has the most precedence.
# So if a pull request only touches javascript files, only these owners
Expand Down
12 changes: 11 additions & 1 deletion Metadata-standard-names.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* [diagnostics](#diagnostics)
* [atmospheric_composition](#atmospheric_composition)
* [atmospheric_composition: GOCART aerosols](#atmospheric_composition-gocart-aerosols)
* [atmospheric_composition: GLOMAP/UKCA aerosols](#atmospheric_composition-glomapukca-aerosols)
* [emissions](#emissions)
* [Application-specific variables](#application-specific-variables)
* [system variables](#system-variables)
Expand Down Expand Up @@ -301,7 +302,7 @@ Currently, the only dimension which supports all six dimension types is horizont
* `integer`: units = index
* `vertical_index_at_top_interface`: Vertical index at top interface
* `integer`: units = index
* `number_of_openmp_threads`: Total number of OpenMP (shared-memory) parallel threads.
* `number_of_openmp_threads`: Total number of thread blocks OpenMP (shared-memory) parallel threads.
* `integer`: units = count
## constants
Constant parameters that should be identical across a full modeling system
Expand Down Expand Up @@ -686,6 +687,15 @@ Note that appending '_on_previous_timestep' to standard_names in this section yi
* `real`: units = m-1
* `volume_extinction_in_air_due_to_aerosol_particles_lambda3`: Aerosol extinction at wavelength3
* `real`: units = m-1
## atmospheric_composition: GLOMAP/UKCA aerosols
* `mass_fraction_of_dust_coarse_aerosol_particles_in_air`: Mass fraction of dust coarse aerosol particles in air
* `real(kind=kind_phys)`: units = kg kg-1
* `mass_fraction_of_dust_accumulation_aerosol_particles_in_air`: Mass fraction of dust accumulation aerosol particles in air
* `real(kind=kind_phys)`: units = kg kg-1
* `number_fraction_of_coarse_aerosol_particles_in_air`: Number fraction of coarse aerosol particles in air
* `real(kind=kind_phys)`: units = 1
* `number_fraction_of_accumulation_aerosol_particles_in_air`: Number fraction of accumulation aerosol particles in air
* `real(kind=kind_phys)`: units = 1
## emissions
Emissions variables, contributed for the Community Emissions Data System (CEDS)
* `emissions_of_co_due_to_anthropogenic_sources`: Carbon monoxide emissions from anthropogenic sources, total
Expand Down
Loading