datetime support not working for cf.Data made from a scalar
還沒有人認領這個 Issue。
評估
研究方向
先重現 issue 中的純量 cf.Data 範例,並追蹤其 year 屬性如何針對給定的 noleap 日期計算。檢查純量專用的 datetime 處理,並驗證結果是整數年份 -1,而不是錯誤的字串。
由索引模型根據 Issue 內容生成。
描述
I think this should return an integer year, but actually it returns a string (whose contents is incorrect):
>>> cf.Data(-182500.0,units='days since 0001-01-01 00:00:00',calendar='noleap').year
<CF Data(): -0001-08-20 00:00:00 noleap>
I think it's because it's a scalar.
Maybe this is a bug which has been fixed since I last installed the packages (on jasmin)
>>> cf.environment(paths=False)
Platform: Linux-5.14.0-611.54.1.el9_7.x86_64-x86_64-with-glibc2.34
Python: 3.12.11
packaging: 25.0
numpy: 2.2.6
cfdm.core: 1.12.2.0
udunits2 library: /apps/jasmin/jaspy/miniforge_envs/jaspy3.12/mf3-25.3.0-3/envs/jaspy3.12-mf3-25.3.0-3-v20250704/lib/libudunits2.so.0
HDF5 library: 1.14.3
netcdf library: 4.9.2
netCDF4: 1.7.2
h5netcdf: 1.6.3
h5py: 3.13.0
zarr: 3.0.10
s3fs: 2025.5.1
scipy: 1.15.2
dask: 2025.5.1
cftime: 1.6.4
cfunits: 3.3.7
cfdm: 1.12.2.0
esmpy/ESMF: 8.8.1
psutil: 7.0.0
matplotlib: 3.10.3
cfplot: 3.4.0
cf: 3.18.0
Thanks
Jonathan
- 主要語言
- Python
- 星號
- 151
- 分支
- 23
- 平均合併
- 1 天 2 小時
- 30 天內合併 PR
- 1
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
NCAS-CMS/cf-python 的其他 Issue
-
installation
難度 4/5 3-5 天 新手友好度 45/100
-
Attempt at unsupported conservative 3D mesh regridding可能重新可做 @sadielbartholomew 於 54 天前認領,目前沒有進行中的 PR。 未關閉bug?
-
bug
難度 3/5 1-2 天 新手友好度 45/100
-
API review (4.0.0) documentation
難度 4/5 3-5 天 新手友好度 48/100
-
enhancement xarray
難度 4/5 3-5 天 新手友好度 48/100
查看 NCAS-CMS/cf-python 的全部 Issue
相似的 Issue
-
Paraxial.trace returns NaN for an object at infinity when the entrance pupil is at the first surface未關閉
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
enhancement ios launcher
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆
-
Substrait consumer doesn't recognise `shift_left` / `shift_right` from functions_arithmetic.yaml未關閉bug
難度 2/5 1-3 小時 新手友好度 76/100
apache/datafusion#27059 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 85/100
loteran/Arctis-Sound-Manager#368 ·
維護者通常 1 天內回覆
-
feed submission
難度 2/5 1-3 小時 新手友好度 65/100
MobilityData/mobility-database-catalogs#1787 ·
維護者通常 2 天內回覆