API?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
@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.
- Lingua principale
- Python
- Stelle
- 120
- Fork
- 17
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di xarray-contrib/pint-xarray
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
xarray-contrib/pint-xarray#400 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
xarray-contrib/pint-xarray#362 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
xarray-contrib/pint-xarray#361 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
xarray-contrib/pint-xarray#303 · 3 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
xarray-contrib/pint-xarray#271 · 7 commenti ·
Tutte le issue di xarray-contrib/pint-xarray
Issue simili
-
[yugabyted] xcluster set_up and add_to_replication fail for database names containing - . or (Apertakind/bug priority/medium qa_automation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
yugabyte/yugabyte-db#37324 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 87/100
btclib-org/btclib-node#2260 ·
I maintainer di solito rispondono entro 1 giorno
-
ChatBedrockConverse changes the keys of JSON tool results to camelCase (`order_id` becomes `orderId`)Forse già presa @geyazheng l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
langchain-ai/langchain-aws#1469 ·
I maintainer di solito rispondono entro 1 giorno
-
GCToggler leaves collection enabled if the body re-enables itForse già presa @Gambit-Checkmate l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 7 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno