splitnc 0.1__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- splitnc-0.1.3/.github/workflows/cd.yaml +33 -0
- splitnc-0.1.3/.github/workflows/ci.yaml +33 -0
- {splitnc-0.1 → splitnc-0.1.3}/PKG-INFO +1 -1
- {splitnc-0.1 → splitnc-0.1.3}/pyproject.toml +3 -2
- {splitnc-0.1 → splitnc-0.1.3}/src/splitnc.egg-info/PKG-INFO +1 -1
- splitnc-0.1.3/src/splitnc.egg-info/SOURCES.txt +36 -0
- splitnc-0.1.3/src/splitnc.egg-info/scm_file_list.json +32 -0
- splitnc-0.1.3/src/splitnc.egg-info/scm_version.json +8 -0
- splitnc-0.1.3/test/common.py +27 -0
- splitnc-0.1.3/test/data/aiihca.pa-234501_mon.cdl +2018 -0
- splitnc-0.1.3/test/data/aiihca.pc-010101.cdl +980 -0
- splitnc-0.1.3/test/data/aiihca.pe-234501_dai.cdl +446 -0
- splitnc-0.1.3/test/data/aiihca.pi-010101_3hr.cdl +476 -0
- splitnc-0.1.3/test/data/aiihca.pj-010101_6hr.cdl +274 -0
- splitnc-0.1.3/test/data/iceh-1-mean_0272.cdl +11073 -0
- splitnc-0.1.3/test/data/iceh-1daily-mean_2345-01.cdl +366 -0
- splitnc-0.1.3/test/data/iceh-1hourly-mean_0272.cdl +11092 -0
- splitnc-0.1.3/test/data/iceh-1monthly-mean_2345-01.cdl +610 -0
- splitnc-0.1.3/test/data/iceh-1yearly-mean_0001.cdl +97 -0
- splitnc-0.1.3/test/data/iceh-1yearly-mean_0272.cdl +97 -0
- splitnc-0.1.3/test/data/iceh-2daily-mean_0272.cdl +537 -0
- splitnc-0.1.3/test/data/iceh-2hourly-mean_0272.cdl +5462 -0
- splitnc-0.1.3/test/data/iceh-2monthly-mean_0272.cdl +616 -0
- splitnc-0.1.3/test/data/simple.cdl +36 -0
- splitnc-0.1.3/test/data/simple_cellmethod_rename.cdl +37 -0
- splitnc-0.1.3/test/data/simple_circular.cdl +37 -0
- splitnc-0.1.3/test/data/simple_coords_extra_space.cdl +39 -0
- splitnc-0.1/src/splitnc.egg-info/SOURCES.txt +0 -13
- {splitnc-0.1 → splitnc-0.1.3}/LICENSE +0 -0
- {splitnc-0.1 → splitnc-0.1.3}/README.md +0 -0
- {splitnc-0.1 → splitnc-0.1.3}/setup.cfg +0 -0
- {splitnc-0.1 → splitnc-0.1.3}/src/splitnc/__init__.py +0 -0
- {splitnc-0.1 → splitnc-0.1.3}/src/splitnc/esm1p6.py +0 -0
- {splitnc-0.1 → splitnc-0.1.3}/src/splitnc/splitnc.py +0 -0
- {splitnc-0.1 → splitnc-0.1.3}/src/splitnc.egg-info/dependency_links.txt +0 -0
- {splitnc-0.1 → splitnc-0.1.3}/src/splitnc.egg-info/entry_points.txt +0 -0
- {splitnc-0.1 → splitnc-0.1.3}/src/splitnc.egg-info/requires.txt +0 -0
- {splitnc-0.1 → splitnc-0.1.3}/src/splitnc.egg-info/top_level.txt +0 -0
- {splitnc-0.1 → splitnc-0.1.3}/test/test_splitnc.py +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
on:
|
|
2
|
+
push:
|
|
3
|
+
tags:
|
|
4
|
+
- '**'
|
|
5
|
+
jobs:
|
|
6
|
+
publish_python_package:
|
|
7
|
+
uses: access-nri/actions/.github/workflows/publish-python-package.yml@main
|
|
8
|
+
secrets: inherit
|
|
9
|
+
permissions:
|
|
10
|
+
actions: write
|
|
11
|
+
|
|
12
|
+
create-github-release:
|
|
13
|
+
name: Create GitHub Release
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
needs: publish_python_package
|
|
16
|
+
permissions:
|
|
17
|
+
contents: write
|
|
18
|
+
steps:
|
|
19
|
+
- name: Download artifact
|
|
20
|
+
uses: actions/download-artifact@v5
|
|
21
|
+
with:
|
|
22
|
+
name: ${{ needs.publish_python_package.outputs.artifact-name }}
|
|
23
|
+
path: my_artifact_dir
|
|
24
|
+
|
|
25
|
+
- name: Create Release
|
|
26
|
+
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 #v2.3.3
|
|
27
|
+
with:
|
|
28
|
+
tag_name: ${{ github.ref_name }}
|
|
29
|
+
name: splitnc ${{ github.ref_name }}
|
|
30
|
+
generate_release_notes: true
|
|
31
|
+
fail_on_unmatched_files: true
|
|
32
|
+
files: |
|
|
33
|
+
my_artifact_dir/*
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Install netcdf-bin
|
|
19
|
+
run: sudo apt-get install -y netcdf-bin
|
|
20
|
+
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python-version }}
|
|
27
|
+
cache: pip
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: pip install .[test]
|
|
31
|
+
|
|
32
|
+
- name: Run tests
|
|
33
|
+
run: python -m pytest
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: splitnc
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Split multi-field ESM1.6 files into single-field files
|
|
5
5
|
Author-email: Joshua Torrance <joshua.torrance@anu.edu.au>, Spencer Wong <spencer.wong@anu.edu.au>
|
|
6
6
|
Maintainer-email: Joshua Torrance <joshua.torrance@anu.edu.au>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "splitnc"
|
|
3
|
-
|
|
3
|
+
dynamic = ["version"]
|
|
4
4
|
authors = [
|
|
5
5
|
{name = "Joshua Torrance", email="joshua.torrance@anu.edu.au"},
|
|
6
6
|
{name = "Spencer Wong", email="spencer.wong@anu.edu.au"},
|
|
@@ -34,7 +34,8 @@ splitnc = "splitnc:main"
|
|
|
34
34
|
[build-system]
|
|
35
35
|
build-backend = "setuptools.build_meta"
|
|
36
36
|
requires = [
|
|
37
|
-
"setuptools",
|
|
37
|
+
"setuptools>=80",
|
|
38
|
+
"setuptools-scm[simple]>=8"
|
|
38
39
|
]
|
|
39
40
|
|
|
40
41
|
[tool.pytest.ini_options]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: splitnc
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Split multi-field ESM1.6 files into single-field files
|
|
5
5
|
Author-email: Joshua Torrance <joshua.torrance@anu.edu.au>, Spencer Wong <spencer.wong@anu.edu.au>
|
|
6
6
|
Maintainer-email: Joshua Torrance <joshua.torrance@anu.edu.au>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
.github/workflows/cd.yaml
|
|
5
|
+
.github/workflows/ci.yaml
|
|
6
|
+
src/splitnc/__init__.py
|
|
7
|
+
src/splitnc/esm1p6.py
|
|
8
|
+
src/splitnc/splitnc.py
|
|
9
|
+
src/splitnc.egg-info/PKG-INFO
|
|
10
|
+
src/splitnc.egg-info/SOURCES.txt
|
|
11
|
+
src/splitnc.egg-info/dependency_links.txt
|
|
12
|
+
src/splitnc.egg-info/entry_points.txt
|
|
13
|
+
src/splitnc.egg-info/requires.txt
|
|
14
|
+
src/splitnc.egg-info/scm_file_list.json
|
|
15
|
+
src/splitnc.egg-info/scm_version.json
|
|
16
|
+
src/splitnc.egg-info/top_level.txt
|
|
17
|
+
test/common.py
|
|
18
|
+
test/test_splitnc.py
|
|
19
|
+
test/data/aiihca.pa-234501_mon.cdl
|
|
20
|
+
test/data/aiihca.pc-010101.cdl
|
|
21
|
+
test/data/aiihca.pe-234501_dai.cdl
|
|
22
|
+
test/data/aiihca.pi-010101_3hr.cdl
|
|
23
|
+
test/data/aiihca.pj-010101_6hr.cdl
|
|
24
|
+
test/data/iceh-1-mean_0272.cdl
|
|
25
|
+
test/data/iceh-1daily-mean_2345-01.cdl
|
|
26
|
+
test/data/iceh-1hourly-mean_0272.cdl
|
|
27
|
+
test/data/iceh-1monthly-mean_2345-01.cdl
|
|
28
|
+
test/data/iceh-1yearly-mean_0001.cdl
|
|
29
|
+
test/data/iceh-1yearly-mean_0272.cdl
|
|
30
|
+
test/data/iceh-2daily-mean_0272.cdl
|
|
31
|
+
test/data/iceh-2hourly-mean_0272.cdl
|
|
32
|
+
test/data/iceh-2monthly-mean_0272.cdl
|
|
33
|
+
test/data/simple.cdl
|
|
34
|
+
test/data/simple_cellmethod_rename.cdl
|
|
35
|
+
test/data/simple_circular.cdl
|
|
36
|
+
test/data/simple_coords_extra_space.cdl
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
"README.md",
|
|
4
|
+
"LICENSE",
|
|
5
|
+
"pyproject.toml",
|
|
6
|
+
"src/splitnc/__init__.py",
|
|
7
|
+
"src/splitnc/esm1p6.py",
|
|
8
|
+
"src/splitnc/splitnc.py",
|
|
9
|
+
"test/test_splitnc.py",
|
|
10
|
+
"test/common.py",
|
|
11
|
+
"test/data/iceh-2hourly-mean_0272.cdl",
|
|
12
|
+
"test/data/aiihca.pj-010101_6hr.cdl",
|
|
13
|
+
"test/data/iceh-2daily-mean_0272.cdl",
|
|
14
|
+
"test/data/aiihca.pa-234501_mon.cdl",
|
|
15
|
+
"test/data/aiihca.pc-010101.cdl",
|
|
16
|
+
"test/data/aiihca.pi-010101_3hr.cdl",
|
|
17
|
+
"test/data/simple_coords_extra_space.cdl",
|
|
18
|
+
"test/data/iceh-1monthly-mean_2345-01.cdl",
|
|
19
|
+
"test/data/iceh-2monthly-mean_0272.cdl",
|
|
20
|
+
"test/data/iceh-1yearly-mean_0272.cdl",
|
|
21
|
+
"test/data/iceh-1daily-mean_2345-01.cdl",
|
|
22
|
+
"test/data/simple_cellmethod_rename.cdl",
|
|
23
|
+
"test/data/iceh-1hourly-mean_0272.cdl",
|
|
24
|
+
"test/data/iceh-1yearly-mean_0001.cdl",
|
|
25
|
+
"test/data/simple_circular.cdl",
|
|
26
|
+
"test/data/simple.cdl",
|
|
27
|
+
"test/data/iceh-1-mean_0272.cdl",
|
|
28
|
+
"test/data/aiihca.pe-234501_dai.cdl",
|
|
29
|
+
".github/workflows/cd.yaml",
|
|
30
|
+
".github/workflows/ci.yaml"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
import shlex
|
|
4
|
+
import subprocess
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def runcmd(cmd, wd=None, env=None):
|
|
8
|
+
"""
|
|
9
|
+
Run a command, print stderr to stdout and optionally run in working directory
|
|
10
|
+
"""
|
|
11
|
+
cwd = Path.cwd() if wd is None else wd
|
|
12
|
+
local_env = os.environ.copy()
|
|
13
|
+
if env is not None:
|
|
14
|
+
local_env.update(env)
|
|
15
|
+
subprocess.run(
|
|
16
|
+
shlex.split(cmd), stderr=subprocess.STDOUT, cwd=cwd, env=local_env, check=True
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def make_nc(tmp_path, cdl_file):
|
|
21
|
+
nc_filename = Path(cdl_file).with_suffix(".nc").name
|
|
22
|
+
filepath = f"{tmp_path}/{nc_filename}"
|
|
23
|
+
cmd = f"ncgen -o {filepath} {cdl_file}"
|
|
24
|
+
|
|
25
|
+
runcmd(cmd)
|
|
26
|
+
|
|
27
|
+
return filepath
|