API?
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
- 20/100
Hướng nghiên cứu
Start by reviewing the proposed accessor API in pint/#849 and the checked and unchecked DataArray and Dataset methods listed here. Determine which API items remain desired and whether the accessor should eventually be renamed from pint to units; done requires an agreed scope rather than a single isolated edit.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
@jthielen proposed a rough accessor API in pint/#849, to which I've added a couple of things:
DataArray:
-
da.pint.to(...): return dataarray with converted units (#11) -
da.pint.to_base_units(): return dataarray with base units -
da.pint.units: units of quantity (as a Unit) -
da.pint.magnitude: magnitude of quantity -
da.pint.quantify(unit_registry=None, unit=None): create DataArray wrapping a Quantity based on string unit attribute of DataArray or specified unit -
da.pint.dequantify(): replace data with the Quantity's magnitude, and add back string unit attribute from Quantity's unit -
da.pint.sel(): wrap da.sel to handle indexing with Quantities (by casting to magnitude in the coordinate's units similar to how MetPy does it, since true unit-aware indexing is not available yet in xarray) -
da.pint.loc: wrap da.loc likewise -
da.pint.to_system(system): convert all variables to be expressed in the (base?) units of a different system. Might require upstream additions to pint.
Dataset:
-
ds.pint.to(...): return Dataset with converted units (#11) -
ds.pint.to_base_units(): return dataset with base units -
ds.pint.quantify(unit_registry=None): convert all data variables to quantities -
ds.pint.dequantify(): convert all data variables from quantities to magnitudes with units as an attribute -
ds.pint.sel(): wrap ds.sel to handle indexing with Quantities -
ds.pint.loc: wrap ds.loc likewise -
ds.pint.to_system(system): convert all variables to be expressed in the (base?) units of a different system.
(this may be modified as things change on xarray's and pint's end, especially involving Dask arrays (xref #883))
Anything else?
At some point when the integration is more solidified (but before official release) we should change the accessor from pint to units, to get a interface more like what's described here.
This would be:
a) More intuitive
b) Units-library agnostic
c) A good fit for potentially using an entrypoint to choose which units library you want to use. There's already an entrypoint for plotting backends in xarray, and plans to add one for storage backends too.
- Ngôn ngữ chính
- Python
- Star
- 120
- Fork
- 17
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 xarray-contrib/pint-xarray
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
xarray-contrib/pint-xarray#400 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
xarray-contrib/pint-xarray#362 · 1 bình luận ·
-
swap_dims drops coordinate unitsĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
xarray-contrib/pint-xarray#361 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
xarray-contrib/pint-xarray#303 · 3 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
xarray-contrib/pint-xarray#271 · 7 bình luận ·
Tất cả issue của xarray-contrib/pint-xarray
Issue tương tự
-
[yugabyted] xcluster set_up and add_to_replication fail for database names containing - . or (Đang mởkind/bug priority/medium qa_automation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
yugabyte/yugabyte-db#37324 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 87/100
btclib-org/btclib-node#2260 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ChatBedrockConverse changes the keys of JSON tool results to camelCase (`order_id` becomes `orderId`)Có thể đã có người làm @geyazheng đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
langchain-ai/langchain-aws#1469 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GCToggler leaves collection enabled if the body re-enables itCó thể đã có người làm @Gambit-Checkmate đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 7 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
EESSI/docs#949 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày