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

fesom1 to levels #77

Open
wants to merge 48 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
7c834b9
fesom1 to levels
pgierz Nov 20, 2024
ec10573
Merge branch 'main' into feat/fesom1/levels
pgierz Nov 21, 2024
fae5c1c
wip
pgierz Nov 21, 2024
fd575b3
style(load_mesh_data): flake8 nonsense
pgierz Nov 21, 2024
58d3b56
forgot half the commit, merrrrrp
pgierz Nov 21, 2024
e2cb063
test: local cache with better fixtures
pgierz Nov 21, 2024
cde10ac
Merge branch 'main' into feat/fesom1/levels
pgierz Nov 25, 2024
43cf315
test: first 'unit' test for fesom 1p4 nodes to levels
pgierz Nov 25, 2024
570cf21
typo
pgierz Nov 25, 2024
1ec1fdc
typo again
pgierz Nov 25, 2024
00963bf
wrong fixture name
pgierz Nov 25, 2024
aaf31ed
ci: adds test to see if recom data will work in general
pgierz Nov 25, 2024
6b23ec2
forgotten os import
pgierz Nov 25, 2024
53ffe4b
fix: wrong URL for download
pgierz Nov 25, 2024
e7670a2
ci: internet connectivity check on runner
pgierz Nov 25, 2024
e8ce853
ci: internet connectivity check on runner, 2
pgierz Nov 25, 2024
f05c3a6
ci: internet connectivity check on runner, 3
pgierz Nov 25, 2024
d4bc547
forgot fesom subdirectory
pgierz Nov 25, 2024
49928d1
wip
pgierz Nov 25, 2024
2f986f2
test(awicm_recom): removes local cache fixture, it seems to be broken…
pgierz Nov 25, 2024
446274d
trailing slash??
pgierz Nov 25, 2024
5e15225
test: see if mesh is there normally
pgierz Nov 25, 2024
81e831d
underscore madness
pgierz Nov 25, 2024
412b1db
test: wrong pre-compute function used in test for nodes_to_levels
pgierz Nov 25, 2024
5796efa
wip
pgierz Nov 25, 2024
4d4add4
test(nodes_to_levels): needs DataArray, not Dataset
pgierz Nov 25, 2024
7187e84
wip: works on laptop, now check on CI
pgierz Nov 25, 2024
2c7fa22
Merge branch 'main' into feat/fesom1/levels
pgierz Nov 26, 2024
78dc9e4
test: integration test for awicm_recom with nodes to levels
pgierz Nov 26, 2024
b749356
test: serial processing on awicm 1.0 recom integration test
pgierz Nov 26, 2024
c62f0bd
fix: get fesom namespace for nodes_to_levels at top level
pgierz Nov 26, 2024
d6bcd99
fix(fesom_1p4): still refactoring top-level imports
pgierz Nov 26, 2024
4e997a4
fix(fesom_1p4): wrong import name
pgierz Nov 26, 2024
0d0a822
test: only test level regridding for awicm-recom integration test
pgierz Nov 26, 2024
9144915
wip: the mysterious recursion error happens again, adding some more s…
pgierz Nov 26, 2024
4dfe648
fix: path replacement sloppiness (we need a better strategy)
pgierz Nov 26, 2024
63d9f5c
h5netcdf seems wonky with awicm_recom version of output?
pgierz Nov 26, 2024
c21b59b
wip pavan's save dataset needs file timespan to be defined, skipping …
pgierz Nov 26, 2024
970362a
Merge branch 'main' into feat/fesom1/levels
pgierz Dec 14, 2024
900c3c4
Merge branch 'main' into feat/fesom1/levels
pgierz Jan 9, 2025
c8577d8
wip
pgierz Jan 9, 2025
396c65c
test(setup.cfg): ignores CMIP7 folder for flake8
pgierz Jan 9, 2025
53aa377
ci: don't check internet speed on runners anymore
pgierz Jan 9, 2025
5d77418
test: removes test for serialization of rules, this has been extensiv…
pgierz Jan 9, 2025
062ba16
isort
pgierz Jan 9, 2025
fb341d1
test(recom): mirror more settings from cmip6 example
pgierz Jan 9, 2025
6c82486
check: fix flake8 errors in various files
pgierz Jan 9, 2025
ec33f8a
black
pgierz Jan 9, 2025
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
12 changes: 12 additions & 0 deletions .github/workflows/CI-test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

Check warning on line 1 in .github/workflows/CI-test.yaml

View workflow job for this annotation

GitHub Actions / check_format (3.9)

1:81 [line-length] line too long (118 > 80 characters)

name: Run Basic Tests

Check warning on line 3 in .github/workflows/CI-test.yaml

View workflow job for this annotation

GitHub Actions / check_format (3.9)

3:1 [document-start] missing document start "---"
on:

Check warning on line 4 in .github/workflows/CI-test.yaml

View workflow job for this annotation

GitHub Actions / check_format (3.9)

4:1 [truthy] truthy value should be one of [false, true]
push:
branches: ["main"]
pull_request:
Expand All @@ -28,10 +28,22 @@
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if ${{ matrix.python-version == '3.12' }}; then pip install --upgrade setuptools; fi

Check warning on line 31 in .github/workflows/CI-test.yaml

View workflow job for this annotation

GitHub Actions / check_format (3.9)

31:81 [line-length] line too long (94 > 80 characters)
- name: Install package
run: |
python -m pip install .[dev]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Check internet connectivity of CI runner
# run: |
# sudo apt-get install -y curl
# curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
# sudo apt-get install -y speedtest
# speedtest --accept-license
- name: Test if data will work (Meta-Test)
run: |
export HDF5_DEBUG=1
Expand Down
1 change: 1 addition & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"tests.fixtures.config_files",
"tests.fixtures.configs",
"tests.fixtures.environment",
"tests.fixtures.example_data.awicm_recom",
"tests.fixtures.example_data.fesom_2p6_pimesh",
"tests.fixtures.example_data.pi_uxarray",
"tests.fixtures.fake_data.fesom_mesh",
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ tag_prefix = 'v'
max-line-length = 120
[flake8]
max-line-length = 120
exclude = cmip6-cmor-tables/CMIP6_CVs/src
exclude = cmip6-cmor-tables/CMIP6_CVs/src CMIP7_DReq_Software/
[isort]
profile = black
11 changes: 10 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ def read(filename):
long_description=read("README.rst"),
package_dir={"": "src"},
packages=find_packages(where="src", exclude=("tests",)),
# NOTE: Please keep this list sorted! In vim, you can use
# visual-block mode (Ctrl-V) to select the lines and then `:sort`.
# or use the vim-ism (starting anywhere in the list)::
#
# vi[:sort<CR>
#
# meaning: [v]isual [i]nside square brackets, command mode, sort, enter.
install_requires=[
"bokeh",
"cerberus",
Expand All @@ -47,8 +54,10 @@ def read(filename):
"flox",
"h5netcdf",
"imohash",
"netcdf4", # NOTE(PG): Shouldn't be a prereq for xarray?
"joblib",
"netcdf4",
"numbagg",
"numpy",
"pendulum",
"pint-xarray",
"prefect[dask]",
Expand Down
25 changes: 24 additions & 1 deletion src/pymorize/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from rich.traceback import install as rich_traceback_install
from streamlit.web import cli as stcli

from pymorize.fesom_1p4.nodes_to_levels import convert

from . import _version, caching, dev_utils
from .cmorizer import CMORizer
from .filecache import fc
Expand Down Expand Up @@ -136,7 +138,11 @@ def cache(verbose, quiet, logfile, profile_mem):
return 0


################################################################################
@click.group()
def scripts():
return 0


################################################################################
################################################################################

Expand Down Expand Up @@ -219,6 +225,22 @@ def directory(config_file, output_dir, verbose, quiet, logfile, profile_mem):
cmorizer.check_rules_for_output_dir(output_dir)


################################################################################
################################################################################
################################################################################

################################################################################
# COMMANDS FOR scripts
################################################################################


@scripts.group()
def fesom1():
pass


fesom1.add_command(convert, name="nodes-to-levels")

################################################################################
################################################################################
################################################################################
Expand Down Expand Up @@ -270,6 +292,7 @@ def populate_cache(files: List, verbose, quiet, logfile, profile_mem):
cli.add_command(validate)
cli.add_command(develop)
cli.add_command(ssh_tunnel_cli, name="ssh-tunnel")
cli.add_command(scripts)


def main():
Expand Down
3 changes: 3 additions & 0 deletions src/pymorize/fesom_1p4/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Move to top-level namespace:
from .load_mesh_data import * # noqa: F401, F403
from .nodes_to_levels import * # noqa: F401, F403
Loading
Loading