Unyt

Latest version: v3.0.2

Safety actively analyzes 631044 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 6

2.2.2

------------------

* Fix erroneous conversions of E&M units to their "native" unit system,
for example, converting Gauss to CGS units would return Tesla and converting
Tesla to MKS units would return Gauss. See `PR 96
<https://github.com/yt-project/unyt/pull/96>`_.

2.2.1

------------------

* Add support for loading JSON unit registries saved by ``yt.units``.
See `PR 93 <https://github.com/yt-project/unyt/pull/93>`_.
* Correct the value of the ``light_year`` unit.
See `PR 93 <https://github.com/yt-project/unyt/pull/93>`_.
* It is now possible to define a ``UnitSystem`` object with a quantity.
See `PR 86 <https://github.com/yt-project/unyt/pull/86>`_.
* Incorrect units for Planck units have been fixed.
See `PR 85 <https://github.com/yt-project/unyt/pull/85>`_. Thank you to
Nathan Musoke (musoke on GitHub) for the contribution.
* Updated value of Newton's constant to latest CODATA value.
See `PR 84 <https://github.com/yt-project/unyt/pull/84>`_.

2.2.0

------------------

* Several performance optimizations. This includes a slight change to the behavior
of MKS/CGS E&M unit conversions that makes the conversion rules slightly more relaxed.
See `PR 82 <https://github.com/yt-project/unyt/pull/82>`_.

2.1.1

------------------

* Fixed an issue with restoring unit registries from JSON output. See `PR 81
<https://github.com/yt-project/unyt/pull/81>`_.

2.1.0

------------------

This release includes a few minor new features and bugfixes for the 2.0.0 release.

* Added support for the matmul ` operator. See `PR 80
<https://github.com/yt-project/unyt/pull/80>`_.
* Allow defining unit systems using ``Unit`` instances instead of string unit
names. See `PR 71 <https://github.com/yt-project/unyt/pull/71>`_. Thank you
to Josh Borrow (JBorrow on GitHub) for the contribution.
* Fix incorrect behavior when ``uhstack`` is called with the ``axis``
argument. See `PR 73 <https://github.com/yt-project/unyt/pull/73>`_.
* Add ``"rsun"``, ``"lsun"``, and ``"au"`` as alternate spellings for the
``"Rsun"``, ``"Lsun"``, and ``"AU"`` units. See `PR 77
<https://github.com/yt-project/unyt/pull/77>`_.
* Improvements for working with code unit systems. See `PR 78
<https://github.com/yt-project/unyt/pull/78>`_.
* Reduce impact of floating point round-off noise on unit comparisons. See `PR
79 <https://github.com/yt-project/unyt/pull/79>`_.

2.0.0

bugfixes. There are some small backwards incompatible changes in this release
related to automatic unit simplification and handling of dtypes. Please see the
release notes below for more details. If you are upgrading from ``unyt 1.x`` we
suggest testing to make sure these changes do not siginificantly impact you. If
you run into issues please let us know by `opening an issue on GitHub
<https://github.com/yt-project/unyt/issues/new>`_.

* Dropped support for Python 2.7 and Python 3.4. Added support for Python 3.7.
* Added ``Unit.simplify()``, which cancels pairs of terms in a unit expression
that have inverse dimensions and made it so the results of ``unyt_array``
multiplication and division will automatically simplify units. This means
operations that combine distinct dimensionally equivalent units will cancel in
many situations. For example

.. code-block::

>>> from unyt import kg, g
>>> print((12 * kg) / (4 * g))
3000.0 dimensionless

older versions of ``unyt`` would have returned ``4.0 kg/g``. See `PR 58
<https://github.com/yt-project/unyt/pull/58>`_ for more details. This change
may cause the units of operations to have different, equivalent simplified
units than they did with older versions of ``unyt``.
* Added the ability to resolve non-canonical unit names to the equivalent
canonical unit names. This means it is now possible to refer to a unit name
using an alternative non-canonical unit name when importing the unit from the
``unyt`` namespace as well as when a unit name is passed as a string to
``unyt``. For example:

.. code-block::

>>> from unyt import meter, second
>>> data = 1000.0 * meter / second
>>> data.to("kilometer/second")
unyt_quantity(1., 'km/s')
>>> data.to("metre/s")
unyt_quantity(1000., 'm/s')

The documentation now has a table of units recognized by ``unyt`` along with
known alternative spellings for each unit.
* Added support for unicode unit names, including ``μm`` for micrometer and ``Ω``
for ohm. See `PR 59 <https://github.com/yt-project/unyt/pull/59>`_.
* Substantially improved support for data that does not have a ``float64``
dtype. Rather than coercing all data to ``float64`` ``unyt`` will now preserve
the dtype of data. Data that is not already a numpy array will be coerced to a
dtype by calling ``np.array`` internally. Converting integer data to a new
unit will convert the data to floats, if this causes a loss of precision then
a warning message will be printed. See `PR 55
<https://github.com/yt-project/unyt/pull/55>`_ for details. This change may
cause data to be loaded into ``unyt`` with a different dtype. On Windows the
default integer dtype is ``int32``, so data may begin to be recognized as
``int32`` or converted to ``float32`` where before it was interpreted as
``float64`` by default.
* Unit registries are now associated with a unit system. This means that it's
possible to create a unit registry that is associated with a non-MKS unit
system so that conversions to "base" units will end up in that non-MKS
system. For example:

.. code-block::

>>> from unyt import UnitRegistry, unyt_quantity
>>> ureg = UnitRegistry(unit_system="cgs")
>>> data = unyt_quantity(12, "N", registry=ureg)
>>> data.in_base()
unyt_quantity(1200000., 'dyn')

See `PR 62 <https://github.com/yt-project/unyt/pull/62>`_ for details.
* Added two new utility functions, ``unyt.unit_systems.add_constants`` and
``unyt.unit_systems.add_symbols`` that can populate a namespace with a set of
unit symbols in the same way that the top-level ``unyt`` namespace is
populated. For example, the author of a library making use of ``unyt`` could
create an object that users can use to access unit data like this:

.. code-block::

>>> from unyt.unit_systems import add_symbols
>>> from unyt.unit_registry import UnitRegistry
>>> class UnitContainer:
... def __init__(self):
... add_symbols(vars(self), registry=UnitRegistry())
...
>>> units = UnitContainer()
>>> units.kilometer
km
>>> units.microsecond
μs

See `PR 68 <https://github.com/yt-project/unyt/pull/68>`_.
* The ``unyt`` codebase is now automatically formatted by `black
<https://github.com/ambv/black>`_. See `PR #57
<https://github.com/yt-project/unyt/pull/57>`_.
* Add missing "microsecond" name from top-level ``unyt`` namespace. See `PR
48 <https://github.com/yt-project/unyt/pull/48>`_.
* Add support for ``numpy.argsort`` by defining ``unyt_array.argsort``. See `PR
52 <https://github.com/yt-project/unyt/pull/52>`_.
* Add Farad unit and fix issues with conversions between MKS and CGS
electromagnetic units. See `PR 54
<https://github.com/yt-project/unyt/pull/54>`_.
* Fixed incorrect conversions between inverse velocities and ``statohm``. See
`PR 61 <https://github.com/yt-project/unyt/pull/61>`_.
* Fixed issues with installing ``unyt`` from source with newer versions of
``pip``. See `PR 63 <https://github.com/yt-project/unyt/pull/62>`_.
* Fixed bug when using ``define_unit`` that caused crashes when using a custom
unit registry. Thank you to Bili Dong (qobilidob on GitHub) for the pull
request. See `PR 64 <https://github.com/yt-project/unyt/pull/64>`_.

We would also like to thank Daniel Gomez (dangom), Britton Smith
(brittonsmith), Lee Johnston (l-johnston), Meagan Lang (langmm), Eric Chen
(ericchen), Justin Gilmer (justinGilmer), and Andy Perez (sharkweek) for
reporting issues.

Page 4 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.