semvec/pypi-packages huggingface dataset:
pint-xarray 0.6.0
Physical units interface to xarray using Pint
Requires Python: >=3.11

[![CI](https://github.com/xarray-contrib/pint-xarray/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/xarray-contrib/pint-xarray/actions/workflows/ci.yml)
[![code coverage](https://codecov.io/gh/xarray-contrib/pint-xarray/branch/main/graph/badge.svg)](https://codecov.io/gh/xarray-contrib/pint-xarray)
[![docs](https://readthedocs.org/projects/pint-xarray/badge/?version=latest)](https://pint-xarray.readthedocs.io)
[![PyPI version](https://img.shields.io/pypi/v/pint-xarray.svg)](https://pypi.org/project/pint-xarray)
[![codestyle](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
[![conda-forge](https://img.shields.io/conda/vn/conda-forge/pint-xarray)](https://github.com/conda-forge/pint-xarray-feedstock)

# pint-xarray

A convenience wrapper for using [pint](https://pint.readthedocs.io) with
[xarray](https://xarray.pydata.org).

## Usage

To convert the variables of a `Dataset` to quantities:

```python
In [1]: import pint_xarray
   ...: import xarray as xr

In [2]: ds = xr.Dataset({"a": ("x", [0, 1, 2]), "b": ("y", [-3, 5, 1], {"units": "m"})})
   ...: ds
Out[2]:
<xarray.Dataset>
Dimensions:  (x: 3, y: 3)
Dimensions without coordinates: x, y
Data variables:
    a        (x) int64 0 1 2
    b        (y) int64 -3 5 1

In [3]: q = ds.pint.quantify(a="s")
   ...: q
Out[3]:
<xarray.Dataset>
Dimensions:  (x: 3, y: 3)
Dimensions without coordinates: x, y
Data variables:
    a        (x) int64 [s] 0 1 2
    b        (y) int64 [m] -3 5 1
```

to convert to different units:

```python
In [4]: c = q.pint.to({"a": "ms", "b": "km"})
   ...: c
Out[4]:
<xarray.Dataset>
Dimensions:  (x: 3, y: 3)
Dimensions without coordinates: x, y
Data variables:
    a        (x) float64 [ms] 0.0 1e+03 2e+03
    b        (y) float64 [km] -0.003 0.005 0.001
```

to convert back to non-quantities:

```python
In [5]: d = c.pint.dequantify()
   ...: d
Out[5]:
<xarray.Dataset>
Dimensions:  (x: 3, y: 3)
Dimensions without coordinates: x, y
Data variables:
    a        (x) float64 0.0 1e+03 2e+03
    b        (y) float64 -0.003 0.005 0.001
```

For more, see the [documentation](https://pint-xarray.readthedocs.io)
mkdocs-towncrier 0.1.5
An insanely small plugin to add towncrier changelog draft into mkdocs
Requires Python: >=3.9

<div align="center">
<h1>mkdocs-towncrier</h1>
<h4>An insanely small plugin to add towncrier changelog draft into mkdocs</h4>
<a href="https://pypi.org/project/mkdocs-towncrier"><img height="20" alt="Supported python versions" src="https://img.shields.io/pypi/pyversions/mkdocs-towncrier"></a>
<a href="https://pypi.org/project/mkdocs-towncrier"><img height="20" alt="PyPI version" src="https://img.shields.io/pypi/v/mkdocs-towncrier"></a>
<br>
<a href="https://microsoft.github.io/pyright/"><img height="20" alt="Pyright badge" src="https://microsoft.github.io/pyright/img/pyright_badge.svg"></a>
<a href="https://pypi.org/project/ruff"><img height="20" alt="Ruff badge" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json"></a>
<br>
</div>

## Installation

You can install the package from PyPI using:

```bash
pip install -U mkdocs-towncier
```

and then enabling it in your `mkdocs.yml` file:

```yaml
plugins:
  - towncrier
```

## Usage

Using mkdocs-towncrier is as easy as adding a directive to wherever you want the draft changelog
to be added:

```md
# Changelog

<!--- You can even specify the header value! (defaults to "Unreleased") -->
:: towncrier-draft Unreleased changes

--8<-- "CHANGELOG.md"
```

And that's it! Any draft fragment files will be picked up and automatically added to your pages.

## Acknowledgements

This project is heavily inspired in the wonderful
[sphinx-contrib/sphinxcontrib-towncrier](https://github.com/sphinx-contrib/sphinxcontrib-towncrier)!