Skip to content
This repository was archived by the owner on Sep 21, 2025. It is now read-only.

Commit 4486426

Browse files
authored
Merge pull request #164 from ACCESS-Community-Hub/prerelease
Release of v1.0
2 parents c90ae11 + d22f933 commit 4486426

File tree

129 files changed

+2541
-1307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+2541
-1307
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build of mopper conda package for new release
2+
3+
# Controls when the action will run.
4+
on:
5+
# Allows you to run this workflow manually from the Actions tab
6+
workflow_dispatch:
7+
8+
jobs:
9+
conda_deployment_with_new_tag:
10+
name: Test conda deployment of package with Python ${{ matrix.python-version }}
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12"]
15+
steps:
16+
- uses: actions/checkout@v4.1.7
17+
with:
18+
fetch-depth: 0
19+
- name: Set env
20+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
21+
- name: Conda environment creation and activation
22+
uses: conda-incubator/setup-miniconda@v3.0.4
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
activate-environment: mopper_env
26+
environment-file: conda/environment.yaml # Path to the build conda environment
27+
show-channel-urls: true #
28+
- name: Build but do not upload the conda packages
29+
uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0
30+
with:
31+
meta_yaml_dir: conda
32+
python-version: ${{ matrix.python-version }} # Values previously defined in `matrix`
33+
user: coecms
34+
label: auto
35+
upload: true
36+
token: ${{ secrets.ANACONDA_TOKEN }} # Replace with the right name of your secret
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: mopper-all-tests
2+
3+
#on: [push]
4+
on:
5+
push:
6+
branches:
7+
- prerelease
8+
- main
9+
pull_request:
10+
branches:
11+
- main
12+
- prerelease
13+
14+
15+
jobs:
16+
build-linux:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 60
19+
strategy:
20+
max-parallel: 5
21+
matrix:
22+
python-version: ["3.10", "3.11", "3.12"]
23+
24+
steps:
25+
- uses: actions/checkout@v4.1.7
26+
- name: Set up Python 3.10/3.11
27+
uses: actions/setup-python@v5.1.1
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
- name: Install Miniconda
31+
uses: conda-incubator/setup-miniconda@v3.0.4
32+
with:
33+
activate-environment: testenv
34+
environment-file: conda/testenv.yaml
35+
python-version: ${{ matrix.python-version }}
36+
channels: conda-forge
37+
- name: Lint with ruff
38+
shell: bash -el {0}
39+
run: |
40+
ruff check --output-format=github .
41+
continue-on-error: true
42+
43+
# making sure we are testing installed package
44+
- name: Install package
45+
shell: bash -el {0}
46+
run: |
47+
conda activate testenv
48+
pip install -e .
49+
- name: Test with pytest
50+
shell: bash -el {0}
51+
run: |
52+
conda run python -m pytest
53+
#conda run coverage run --source src -m py.test
54+
# - name: Upload to codecov
55+
# shell: bash -el {0}
56+
# if: steps.build.outcome == 'success'
57+
# run: |
58+
# curl -Os https://uploader.codecov.io/latest/linux/codecov
59+
# chmod +x codecov
60+
# ./codecov
61+
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# this workflow can be used as a template for a worklfow
2+
# that runs automatically only specific tests when pushing
3+
# to a selected branch.
4+
name: mopper-specific-tests
5+
6+
on:
7+
push:
8+
branches:
9+
- class
10+
11+
12+
jobs:
13+
build-linux:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 60
16+
strategy:
17+
max-parallel: 5
18+
matrix:
19+
python-version: ["3.10", "3.11", "3.12"]
20+
21+
steps:
22+
- uses: actions/checkout@v4.1.7
23+
- name: Set up Python 3.10/3.11
24+
uses: actions/setup-python@v5.1.1
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install Miniconda
28+
uses: conda-incubator/setup-miniconda@v3.0.4
29+
with:
30+
activate-environment: testenv
31+
environment-file: conda/testenv.yaml
32+
python-version: ${{ matrix.python-version }}
33+
channels: conda-forge
34+
- name: Lint with ruff
35+
shell: bash -el {0}
36+
run: |
37+
ruff check --output-format=github .
38+
continue-on-error: true
39+
40+
# making sure we are testing installed package
41+
- name: Install package
42+
shell: bash -el {0}
43+
run: |
44+
conda activate testenv
45+
pip install -e .
46+
- name: Test with pytest
47+
shell: bash -el {0}
48+
run: |
49+
conda run python -m pytest -q tests/test_calculations.py
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Test Build of mopper conda package
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the prerelase branch
6+
push:
7+
branches: [ prerelease ]
8+
pull_request:
9+
branches: [ prerelease ]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
jobs:
15+
conda_deployment_with_new_tag:
16+
name: Test conda deployment of package with Python ${{ matrix.python-version }}
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
python-version: ["3.10", "3.11", "3.12"]
21+
steps:
22+
- uses: actions/checkout@v4.1.7
23+
with:
24+
fetch-depth: 0
25+
- name: Set env
26+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
27+
- name: Conda environment creation and activation
28+
uses: conda-incubator/setup-miniconda@v3.0.4
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
activate-environment: mopper_env
32+
environment-file: conda/environment.yaml # Path to the build conda environment
33+
show-channel-urls: true #
34+
- name: Build but do not upload the conda packages
35+
uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0
36+
with:
37+
meta_yaml_dir: conda
38+
python-version: ${{ matrix.python-version }} # Values previously defined in `matrix`
39+
user: coecms
40+
label: auto
41+
upload: false
42+
token: ${{ secrets.ANACONDA_TOKEN }} # Replace with the right name of your secret

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
custom_app4_*.sh
21
__pycache__/
32
build/
3+
mopper_venv/
4+
*.csv
5+
*.yaml
6+
*.json
7+
localdata/
8+
src/mopper.egg-info/
9+
extras/
10+
*.txt

ACDD_conf.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,25 @@ cmor:
8383
grids: "ACDD_grids.json"
8484
# Additional NCI information:
8585
# NCI project to charge compute; $PROJECT = your default project
86-
# NCI queue to use; hugemem is recommended
8786
project: v45
8887
# additional NCI projects to be included in the storage flags
8988
addprojs: []
90-
# queue and memory (GB) per CPU (depends on queue)
89+
# queue and memory (GB) per CPU (depends on queue),
90+
# hugemem is reccomended for high reoslution data and/or derived variables
91+
# hugemem requires a minimum of 6 cpus this is handled by the code
9192
queue: hugemem
9293
mem_per_cpu: 32
9394
# walltime in "hh:mm:ss"
9495
walltime: '8:00:00'
9596
mode: custom
97+
# conda_env to use by default hh5 analysis3-unstable
98+
# as this has the code and all dependecies installed
99+
# you can override that by supplying the env to pass to "source"
100+
# Ex
101+
# conda_env: <custom-env-path>/bin/activate
102+
# or you can set "test: true" and modify mopper_job.sh manually
103+
conda_env: default
104+
96105
#
97106
# Global attributes: these will be added to each files comment unwanted ones
98107
# Using ACDD CV vocab to check validity of global attributes
@@ -165,4 +174,4 @@ attrs:
165174
parent: !!bool false
166175
# CMOR will add a tracking_id if you want to define a prefix add here
167176
tracking_id_prefix:
168-
comment: "post-processed using ACCESS-MOPPeR v0.6.0 https://doi.org/10.5281/zenodo.10346216"
177+
comment: "post-processed using ACCESS-MOPPeR v1.0.0 https://doi.org/10.5281/zenodo.10346216"

CMIP6_conf.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,15 @@ cmor:
8484
# additional NCI projects to be included in the storage flags
8585
addprojs: []
8686
# queue and memory (GB) per CPU (depends on queue)
87+
# hugemem is reccomended for high reoslution data and/or derived variables
88+
# hugemem requires a minimum of 6 cpus this is handled by the code
8789
queue: hugemem
8890
mem_per_cpu: 30
8991
# walltime in "hh:mm:ss"
9092
walltime: '8:00:00'
9193
mode: cmip6
94+
# conda_env: <custom-env-path>/bin/activate
95+
conda_env: default
9296

9397
# Global attributes: these will be added to each files comment unwanted ones
9498
# the labels CMIP6/ACDD indicates which ones are necessary to comply with respective standards
@@ -159,4 +163,4 @@ attrs:
159163
#CMOR will add a tracking_id if you want to define a prefix add here
160164
tracking_id_prefix:
161165
Conventions: "CF-1.7 CMIP-6.2"
162-
comment: "post-processed using ACCESS-MOPPeR v0.6.0 https://doi.org/10.5281/zenodo.10346216"
166+
comment: "post-processed using ACCESS-MOPPeR v1.0.0 https://doi.org/10.5281/zenodo.10346216"

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [ACCESS Model Output Post-Processor (MOPPeR)](https://access-mopper.readthedocs.io/en/latest)
22
[![Read the docs](https://readthedocs.org/projects/access-mopper/badge/?version=latest)](https://access-mopper.readthedocs.io/en/latest/)
3-
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10976467.svg)](https://doi.org/10.5281/zenodo.10976467)
3+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.12747219.svg)](https://doi.org/10.5281/zenodo.12747219)
44

55
This code is derived from the [APP4](https://doi.org/10.5281/zenodo.7703469), initially created by Peter Uhe for CMIP5, and further developed for CMIP6-era by Chloe Mackallah from CSIRO, O&A Aspendale.
66

@@ -15,12 +15,13 @@ Designed for use on ACCESS model output that has been archived using the [ACCESS
1515

1616
Although we retained a differentiation between `custom` and `cmip` mode the main workflow is the same and `mode` is now only another field in the main configuration file.
1717

18+
See [MOPPeR ReadtheDocs](https://access-mopper.readthedocs.io/en/stable/) for the full documentation.
1819

1920
### Install
2021

2122
You can install the latest version of `mopper` directly from conda (accessnri channel)::
2223

23-
conda install -c accessnri mopper
24+
conda install -c coecms mopper
2425

2526
If you want to install an unstable version or a different branch:
2627

@@ -35,6 +36,6 @@ If you want to install an unstable version or a different branch:
3536
MOPPeR is pre-installed into a Conda environment at NCI. Load it with::
3637

3738
module use /g/data3/hh5/public/modules
38-
module load conda/analysis3-unstable
39+
module load conda/analysis3
3940

4041
NB. You need to be a member of the hh5 project to load the modules.

conda/environment.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: mopper_env
2+
channels:
3+
- conda-forge
4+
- coecms
5+
- default
6+
7+
dependencies:
8+
- anaconda-client
9+
- conda-build
10+
- conda-verify

conda/meta.yaml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
{% set version = "0.6.1" %}
21
package:
32
name: mopper
4-
version: {{ version }}
3+
version: "{{ environ.get('GIT_DESCRIBE_TAG', '1.0') }}"
54

65
#source:
76
# path: ./
87

98
source:
109
#url: https://github.com/ACCESS-Hive/ACCESS-MOPPeR/archive/refs/tags/{{version}}.tar.gz
1110
git_url: https://github.com/ACCESS-Hive/ACCESS-MOPPeR.git
12-
git_rev: {{ version }}
13-
git_depth: 1 # (Defaults to -1/not shallow)
11+
#git_tag: prerelease
12+
git_rev: "{{ version }}"
13+
#git_depth: 1 # (Defaults to -1/not shallow)
1414

1515
build:
16-
number: 0
16+
number: 1
1717
noarch: python
1818
script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed"
1919
entry_points:
@@ -24,7 +24,6 @@ requirements:
2424
host:
2525
- python
2626
- pip
27-
- pbr
2827
run:
2928
- python
3029
- click
@@ -35,12 +34,29 @@ requirements:
3534
- pyyaml
3635
- cftime
3736
- python-dateutil
37+
3838
test:
39+
#imports:
40+
# - mopdb
41+
# - mopper
3942
source_files:
43+
- tests
4044
- tests/testdata
45+
requires:
46+
- cmor
47+
- xarray
48+
- numpy
49+
- dask
50+
- pyyaml
51+
- cftime
52+
- python-dateutil
53+
- pytest
54+
- pyfakefs
55+
- coverage
56+
- codecov
4157

4258
about:
4359
home: https://github.com/ACCESS-Hive/ACCESS-MOPPeR
4460
license: Apache 2.0
4561
#license_file: LICENSE.txt
46-
summary: 'ACCESS-MOPPeR post-process ACCESS raw model output to ESGF data standards'
62+
summary: 'ACCESS-MOPPeR post-process ACCESS raw model output using CMOR and pre-defined data standards'

0 commit comments

Comments
 (0)