Support for Python 3.10?
還沒有人認領這個 Issue。
評估
研究方向
從 cf/regrid/regrid.py 中 2203 行附近的 mask1 指派處開始,使用 issue 中的命令在 Python 3.10 環境中重現匯入失敗。檢查 tuple 索引的替代方案是否適用於更廣泛的套件,然後驗證 cf 是否能在 Python 3.10 上成功匯入,同時不使受支援的版本發生回歸。
由索引模型根據 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 小時
- 30 天內合併 PR
- 2
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
NCAS-CMS/cf-python 的其他 Issue
-
documentation
難度 1/5 1 小時以內 新手友好度 72/100
-
Convert to/from iris cubes可能已有人在做 @davidhassell 於 3 天前認領。 未關閉enhancement
難度 5/5 一週以上 新手友好度 25/100
-
Convert from/to `xarray`可能已有人在做 @davidhassell 於 3 天前認領。 未關閉enhancement xarray
難度 5/5 一週以上 新手友好度 25/100
-
installation
難度 4/5 3-5 天 新手友好度 45/100
-
Attempt at unsupported conservative 3D mesh regridding可能重新可做 @sadielbartholomew 於 74 天前認領,目前沒有進行中的 PR。 未關閉bug?
查看 NCAS-CMS/cf-python 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
[Maintainer] task area:visualizer
難度 1/5 1 小時以內 新手友好度 78/100
RailtownAI/railtracks#1824 ·
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
apache/datafusion#27688 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 88/100
heasarc/heasarc-tutorials#317 ·
-
bug good first issue help wanted
難度 2/5 1-3 小時 新手友好度 88/100
mloda-ai/mloda-registry#1664 ·
維護者通常 1 天內回覆