From f50c5f464ce99ca0bd05be95407fc540535b4dfa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 19:05:10 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - [github.com/psf/black: 23.9.1 → 23.12.1](https://github.com/psf/black/compare/23.9.1...23.12.1) - [github.com/PyCQA/isort: 5.12.0 → 5.13.2](https://github.com/PyCQA/isort/compare/5.12.0...5.13.2) - [github.com/pre-commit/mirrors-prettier: v3.0.3 → v4.0.0-alpha.8](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.3...v4.0.0-alpha.8) - [github.com/pre-commit/mirrors-mypy: v1.5.1 → v1.8.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.5.1...v1.8.0) --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5a6d70f..e2e3155 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -14,7 +14,7 @@ repos: - id: check-yaml - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.12.1 hooks: - id: black-jupyter @@ -27,17 +27,17 @@ repos: hooks: - id: seed-isort-config - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.3 + rev: v4.0.0-alpha.8 hooks: - id: prettier - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.5.1 + rev: v1.8.0 hooks: - id: mypy additional_dependencies: [ From 5dbd411001c236e31e74db70cbfcfe3a9b1dea47 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Tue, 2 Jan 2024 12:11:02 +1300 Subject: [PATCH 2/2] Use dict(batch.sizes) instead of batch.sizes.mapping To fix `error: "Mapping[Hashable, int]" has no attribute "mapping" [attr-defined]`, due to incorrect type hint in upstream xarray. --- xbatcher/testing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbatcher/testing.py b/xbatcher/testing.py index 36de58f..dd2139d 100644 --- a/xbatcher/testing.py +++ b/xbatcher/testing.py @@ -183,7 +183,7 @@ def validate_batch_dimensions( # Check the names and lengths of the dimensions are equal TestCase().assertDictEqual( - expected_dims, batch.sizes.mapping, msg="Dimension names and/or lengths differ" + expected_dims, dict(batch.sizes), msg="Dimension names and/or lengths differ" ) # Check the dimension order is equal for var in batch.data_vars: