Skip to main content

xarray-quantity

PyPI Python Test License

xarray extension which supports astropy quantities.

Features

This library provides:

  • xarray DataArray and Dataset with units.

Installation

pip install xarray-quantity

Usage

QuantityArray

To create a DataArray with units, use QuantityArray class. The arguments are compatible with DataArray, except the keyword argument unit.

>>> qa = QuantityArray([1, 2, 3, 4, 5], unit="km")
>>> qa.data
[1, 2, 3, 4, 5] km
>>> qa.unit
km

QuantitySet

To create a Dataset with units, use QuantitySet class. This class also has compatibility with xarray's Dataset.

>>> arrays = {
...     "qa1": QuantityArray([1, 2, 3, 4, 5], unit="km/s"),
...     "qa2": QuantityArray([11, 12, 13, 14, 15]),
...     "da3": xr.DataArray([111, 112, 113, 114, 115])
... }
>>> qs = QuantitySet(arrays)
>>> qs.qa1.data
[1, 2, 3, 4, 5] km / s
>>> qs.qa2
xarray.QuantityArray 'qa2' (dim_0: 5)
<Quantity [11., 12., 13., 14., 15.] km / s>
Coordinates: (0)
Attributes: (0)

This library is using Semantic Versioning.

Metadata

Release files for xarray-quantity 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xarray-quantity 0.1.5
File Size Uploaded Provenance Actions
xarray-quantity-0.1.5.tar.gz 3.5 kB Without provenance Details for xarray-quantity-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xarray-quantity 0.1.5
File Interpreter ABI Platform Actions
xarray_quantity-0.1.5-py3-none-any.whl Python 3 none any Details for xarray_quantity-0.1.5-py3-none-any.whl

Total release size: 7.6 kB

Release files / xarray-quantity-0.1.5.tar.gz

Download URL xarray-quantity-0.1.5.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2bcba2b20b8a284fb7fa8bb13e3383d9d76bd889c2aa9d91854da340ad9253af
BLAKE2b-256 checksum
How to use checksums
1fcbe641afb705cd2ff18c6ccb6a6ebdb6033b2f857cb8c6d7a1110426c74c42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.8.13 Linux/5.15.0-1014-azure

Release files / xarray_quantity-0.1.5-py3-none-any.whl

Download URL xarray_quantity-0.1.5-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb527a10c0135eb7599d9085fe335fdb954f5dfae48d3a569de85ccd68dc3def
BLAKE2b-256 checksum
How to use checksums
101b3ee842ed1593b2a5a5621a9b0395d54fb49842d179a7be0c89585ad0c930
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.8.13 Linux/5.15.0-1014-azure

Security for xarray-quantity 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page