Support for Python 3.10?
まだ誰も着手していません。
評価
調査の方向性
cf/regrid/regrid.py の 2203 行付近にある mask1 の代入から始め、issue に記載されているコマンドを使って Python 3.10 環境で import 失敗を再現してください。タプルインデックスによる回避策がパッケージ全体で機能するか確認し、その後、サポート対象バージョンでリグレッションを発生させずに、Python 3.10 で cf を正常に import できることを検証してください。
索引モデルが issue の本文から書いたものです。
説明
Firstly, thank you for maintaining this software.
The latest update of cf-python appears to break for Python 3.10.
Importing leads to a traceback detailed below.
PyPI still lists 3.10 as being supported and there is a possible fix (see below) so we presume this is a bug and not a dropping in support for Python 3.10 (not mentioned in the release notes for cf-python 3.19).
Steps to reproduce:
Create an environment with Python 3.10 and install cf-python, launch a repl, and attempt to import cf.
python3.10 -m venv cf-venv
source cf-venv/bin/activate
pip install cf-python
python
Python 3.10.19 (main, Oct 9 2025, 15:25:03) [Clang 17.0.0 (clang-1700.0.13.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cf
Expected behaviour:
cf-python imported and useable, as is the case for Python >=3.11
Actual behaviour:
Import fails due to invalid syntax
>>> import cf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jwa34/venv/lib/python3.10/site-packages/cf/__init__.py", line 215, in <module>
from .regrid import RegridOperator
File "/Users/jwa34/venv/lib/python3.10/site-packages/cf/regrid/__init__.py", line 1, in <module>
from .regrid import regrid
File "/Users/jwa34/venv/lib/python3.10/site-packages/cf/regrid/regrid.py", line 2203
mask1 = mask1[..., *partition]
^
SyntaxError: invalid syntax
Version:
Downloaded: cf_python-3.19.0.tar.gz
Working on M2 Macbook, but reproducible on linux rhel environment and GitHub Workflow.
Possible Solution/Workaround:
Editing the offending line to be a tuple of arguments allows successful import, but this is not extensively tested to you will need to confirm that it is satisfactory for the wider package.
mask1 = mask1[(..., *partition)]
cc @sjavis
- 主要言語
- Python
- スター
- 151
- フォーク
- 23
- 平均マージ
- 3日 9時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NCAS-CMS/cf-python のほかの issue
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
Convert to/from iris cubes対応中かも @davidhassell が 3 日前に担当しました。 オープンenhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
Convert from/to `xarray`対応中かも @davidhassell が 3 日前に担当しました。 オープンenhancement xarray
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
installation
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
Attempt at unsupported conservative 3D mesh regridding再び着手できるかも @sadielbartholomew が 74 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug?
NCAS-CMS/cf-python の issue をすべて見る
似ている issue
-
eegprep-lean: set channel types from the Zarr group's channel_type対応中かも @claude が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
blacklanternsecurity/bbot#3679 ·
メンテナーはふだん 2 日以内に返信
-
Link Checker ReportオープンBot Type: Bug Type: Documentation
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
speakeasy-api/speakeasy#2159 ·
メンテナーはふだん 1 日以内に返信