Rework the netCDF saver's createVariable keyword API
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Start by reading the netCDF save API in iris.fileformats.netcdf and the public iris.save interface, then review ChunkControl and the linked Zarr I/O design discussion (#7292). The issue describes a breaking API change that needs a deprecation path and further discussion; a concrete implementation boundary and acceptance criteria are not settled.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
(posted by Claude Opus)
Raised from @pp-mo's review of the Zarr I/O design spec: https://github.com/SciTools/iris/pull/7292#discussion_r4155142914
The problem
iris.fileformats.netcdf.save names every netCDF4 createVariable keyword in its own signature — zlib, complevel, shuffle, fletcher32, contiguous, chunksizes, endian, least_significant_digit — and threads each one down through several call layers to the point of use. All of them are also reachable from iris.save(cube, "out.nc", zlib=True).
@pp-mo's objection, in his words:
Frankly, I don't like the existing API and I wonder if all this is just bending over backwards to maintain it ??? It "would have been" better, in my (retrospective!) view, to not name all the available netCDF
createVariablekeywords in our API, and instead support any arbitrary keywords not specifically managed by Iris, as a pass-through. Although .. it is still necessary to have a mechanism for providing controls on a per-variable (i.e. per-cube) basis. Even there, I think that the CHUNK_CONTROL demonstrates a much better way of managing this kind of thing --- notably, a context-manager rather than specific 'tunnel-through' keywords passed unmodified through multiple call layers.
Three things fall out of the current shape:
- Every new netCDF4 keyword is an Iris API change, and every keyword Iris names is one it has to keep naming.
- The keywords are per-call, not per-cube, so
iris.save(cubes, "out.nc", complevel=4)applies one setting to every cube in the list. Per-variable control needs a dict-valued keyword, which is the workaround that exists today. - The values travel through functions that have no interest in them, which is the thing
CHUNK_CONTROLwas introduced to stop doing for chunking.
The suggested direction
Pass arbitrary unrecognised keywords through to createVariable rather than enumerating them, and express per-variable control the way ChunkControl does — a context manager scoped around the save, matching variables by name.
Scope and caution
This is a breaking change, and unlike most of iris.fileformats.netcdf it is not confined to super-users: iris.save(cube, "out.nc", zlib=True) is documented and ordinary. It needs its own deprecation path, and probably its own discussion before any of that.
It is explicitly out of scope for the Zarr I/O programme (#6961). That programme does take one decision in its shadow: the Zarr saver will accept Zarr-native keywords (compressors, chunks, shards) rather than translating netCDF ones onto codecs, so new API does not inherit the pattern. A netCDF keyword passed to the Zarr saver raises TypeError naming the Zarr replacement.
- Ngôn ngữ chính
- Python
- Star
- 730
- Fork
- 323
- Merge trung bình
- 3 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 16
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của SciTools/iris
-
Link Checker ReportCó thể đã có người làm @stephenworsley đã nhận 12 ngày trước. Đang mởBot Type: Bug Type: Documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
SciTools/iris#7368 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
guess_bounds(yearly=True) fails on a single point, monthly=True worksCó thể đã có người làm @pp-mo đã nhận 47 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
SciTools/iris#7311 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Agentic
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của SciTools/iris
Issue tương tự
-
flaky: test_fire_returns_thread_per_http_entry_on_head waits 5 s per dispatch worker on busy shardsĐang mởstatus/accepted type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
microsoft/apm#5309 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug vector-store
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
EverMind-AI/Raven#1413 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Tests: parallel pyinstallcheck runs oversubscribe the machine through nested TBB and BLAS poolsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
ACCESS-NRI/containerised-environments-infra#143 ·
Maintainer thường phản hồi trong vòng 2 ngày