xbudget 0.5.0__tar.gz → 0.6.0__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.
@@ -0,0 +1,50 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ build:
13
+
14
+ runs-on: ubuntu-latest
15
+ defaults:
16
+ run:
17
+ shell: bash -l {0}
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ python-version: ['3.12', '3.13', '3.14', '3.15']
22
+
23
+ steps:
24
+ - name: Cancel previous runs
25
+ uses: styfle/cancel-workflow-action@0.7.0
26
+ with:
27
+ access_token: ${{ github.token }}
28
+ - name: Checkout source
29
+ uses: actions/checkout@v2
30
+
31
+ - name: Conda setup
32
+ uses: conda-incubator/setup-miniconda@v2
33
+ with:
34
+ channels: conda-forge
35
+ mamba-version: '*'
36
+ python-version: ${{ matrix.python-version }}
37
+ activate-environment: test_env_xbudget
38
+ auto-activate-base: false
39
+
40
+ - name: Set up conda environment
41
+ run: |
42
+ mamba env update -f ci/environment.yml
43
+ python -m pip install -e .
44
+ - name: Conda list information
45
+ run: |
46
+ conda env list
47
+ conda list
48
+ - name: Test with pytest
49
+ run: |
50
+ pytest
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xbudget
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: Helper functions and meta-data conventions for wrangling finite-volume ocean model budgets
5
5
  Project-URL: Homepage, https://github.com/hdrake/xbudget
6
6
  Project-URL: Bugs/Issues/Features, https://github.com/hdrake/xbudget/issues
@@ -9,7 +9,7 @@ License-File: LICENSE
9
9
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
10
10
  Classifier: Operating System :: OS Independent
11
11
  Classifier: Programming Language :: Python :: 3
12
- Requires-Python: >=3.8
12
+ Requires-Python: >=3.12
13
13
  Requires-Dist: numpy
14
14
  Requires-Dist: xarray
15
15
  Requires-Dist: xgcm>=0.9.0
@@ -2,7 +2,7 @@ name: test_env_xbudget
2
2
  channels:
3
3
  - conda-forge
4
4
  dependencies:
5
- - python>=3.8
5
+ - python>=3.12
6
6
  - cftime
7
7
  - netcdf4
8
8
  - pydap
@@ -2,7 +2,7 @@ name: docs_env_xbudget
2
2
  channels:
3
3
  - conda-forge
4
4
  dependencies:
5
- - python>=3.8
5
+ - python==3.12
6
6
  - cftime
7
7
  - ipython
8
8
  - jupyterlab
@@ -10,4 +10,4 @@ dependencies:
10
10
  - netcdf4
11
11
  - pydap
12
12
  - pytest
13
- - pip
13
+ - pip
@@ -6,7 +6,7 @@ authors = [
6
6
  ]
7
7
  description = "Helper functions and meta-data conventions for wrangling finite-volume ocean model budgets"
8
8
  readme = "README.md"
9
- requires-python = ">=3.8"
9
+ requires-python = ">=3.12"
10
10
  classifiers = [
11
11
  "Programming Language :: Python :: 3",
12
12
  "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
@@ -219,13 +219,15 @@ def budget_fill_dict(data, xbudget_dict, namepath):
219
219
  v_term_recursive = budget_fill_dict(data, v_term, f"{namepath}_{k}_{k_term}")
220
220
  if v_term_recursive is not None:
221
221
  op_list.append(v_term_recursive)
222
+ elif v_term.get("var") is not None and v_term.get("var") not in ds:
223
+ warnings.warn(f"Variable {v_term.get('var')} is missing from the dataset `ds`, so it is being skipped. To suppress this warning, remove {v_term.get('var')} from the `xbudget_dict`.", UserWarning)
222
224
  elif isinstance(v_term, numbers.Number):
223
225
  op_list.append(v_term)
224
226
  elif isinstance(v_term, str):
225
227
  if v_term in ds:
226
228
  op_list.append(ds[v_term])
227
229
  else:
228
- warnings.warn(f"Variable {v_term} is missing from the dataset `ds`, so it is being skipped. To suppress this warning, remove {v_term} from the `xbudget_dict`.")
230
+ warnings.warn(f"Variable {v_term} is missing from the dataset `ds`, so it is being skipped. To suppress this warning, remove {v_term} from the `xbudget_dict`.", UserWarning)
229
231
  if k=="product":
230
232
  op_list.append(0.)
231
233