Thanks to visit codestin.com
Credit goes to github.com

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
6 changes: 3 additions & 3 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
- name: Checkout Code Repository
uses: actions/checkout@v3

- name: Set up Python 3.12
- name: Set up Python 3.13
uses: actions/setup-python@v3
with:
python-version: "3.12"
python-version: "3.13"

- name: Install and Run Pre-commit
uses: pre-commit/[email protected]
Expand All @@ -55,7 +55,7 @@ jobs:
shell: bash -l {0}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion conda-env/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
dependencies:
# Base - required for building the package.
# =========================================
- python >=3.10
- python >=3.11,<3.14
- setuptools
- cf_xarray >=0.10.6
- cftime
Expand Down
2 changes: 1 addition & 1 deletion conda-env/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
dependencies:
# Base - required for building the package.
# =========================================
- python >=3.10
- python >=3.11,<3.14
- setuptools
- cf_xarray >=0.10.6
- cftime
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "xcdat"
dynamic = ["version"]
description = "Xarray Climate Data Analysis Tools"
readme = "README.rst"
requires-python = ">=3.10"
requires-python = ">=3.11"
license = { text = "Apache-2.0" }
authors = [{ name = "xCDAT developers" }]
classifiers = [
Expand All @@ -16,7 +16,6 @@ classifiers = [
"License :: OSI Approved :: Apache-2.0 License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand Down Expand Up @@ -126,7 +125,7 @@ markers = ["flaky", "network"]

[tool.mypy]
# Docs: https://mypy.readthedocs.io/en/stable/config_file.html
python_version = "3.10"
python_version = "3.13"
check_untyped_defs = true
ignore_missing_imports = true
warn_unused_ignores = true
Expand Down
12 changes: 6 additions & 6 deletions tests/test_axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,16 @@ def test_returns_dataset_dimension_coordinate_vars_using_common_var_names(
)

result = get_dim_coords(ds, "X")
assert result.identical(ds["lon"])
xr.testing.assert_identical(result, ds["lon"])

result = get_dim_coords(ds, "Y")
assert result.identical(ds["lat"])
xr.testing.assert_identical(result, ds["lat"])

result = get_dim_coords(ds, "T")
assert result.identical(ds["time"])
xr.testing.assert_identical(result, ds["time"])

result = get_dim_coords(ds, "Z")
assert result.identical(ds["lev"])
xr.testing.assert_identical(result, ds["lev"])

def test_returns_dataset_dimension_coordinate_vars_using_axis_attr(self):
# For example, E3SM datasets might have "ilev" and "lev" dimensions
Expand All @@ -214,7 +214,7 @@ def test_returns_dataset_dimension_coordinate_vars_using_axis_attr(self):
coords={"ilev": self.ds_axis.ilev, "lev": self.ds_axis.lev}
)

assert result.identical(expected)
xr.testing.assert_identical(result, expected)

def test_returns_dataset_dimension_coordinate_vars_using_standard_name_attr(self):
# For example, E3SM datasets might have "ilev" and "lev" dimensions
Expand All @@ -223,7 +223,7 @@ def test_returns_dataset_dimension_coordinate_vars_using_standard_name_attr(self
result = get_dim_coords(self.ds_sn, "Z")
expected = xr.Dataset(coords={"ilev": self.ds_sn.ilev, "lev": self.ds_sn.lev})

assert result.identical(expected)
xr.testing.assert_identical(result, expected)

def test_returns_dataarray_dimension_coordinate_var_using_axis_attr(self):
result = get_dim_coords(self.ds_axis.hyai, "Z")
Expand Down
7 changes: 4 additions & 3 deletions xcdat/temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,9 +1398,10 @@ def _drop_incomplete_djf(self, dataset: xr.Dataset) -> xr.Dataset:
# method concatenates the time dimension to non-time dimension data
# vars, which is not a desired behavior.
ds = dataset.copy()
ds_time = ds.get([v for v in ds.data_vars if self.dim in ds[v].dims])
ds_no_time = ds.get([v for v in ds.data_vars if self.dim not in ds[v].dims])

time_vars = [v for v in ds.data_vars if self.dim in ds[v].dims]
no_time_vars = [v for v in ds.data_vars if self.dim not in ds[v].dims]
ds_time = ds[time_vars]
ds_no_time = ds[no_time_vars]
start_year, end_year = (
ds[self.dim].dt.year.values[0],
ds[self.dim].dt.year.values[-1],
Expand Down
Loading