Files
python-Pint/python-Pint.spec

90 lines
2.9 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-Pint
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Accepting request 768793 from home:TheBlackCat:branches:devel:languages:python:numeric - Update to 0.10.1 * Fixed bug introduced in 0.10 that prevented creation of size-zero Quantities from NumPy arrays by multiplication. * Fixed several Sphinx issues. Fixed intersphinx hooks to all classes missing. * Fixed __array__ signature to match numpy docs - Update to 0.10 * **BREAKING CHANGE**: Boolean value of Quantities with offsets units is ambiguous, and so, now a ValueError is raised when attempting to cast such a Quantity to boolean. * **BREAKING CHANGE**: `__array_ufunc__` has been implemented on `pint.Unit` to permit multiplication/division by units on the right of ufunc-reliant array types (like Sparse) with proper respect for the type casting hierarchy. However, until an upstream issue with NumPy is resolved, this breaks creation of Masked Array Quantities by multiplication on the right. * Documentation on Pint's array type compatibility has been added to the NumPy support page, including a graph of the duck array type casting hierarchy as understood by Pint for N-dimensional arrays. * Improved compatibility for downcast duck array types like Sparse.COO. A collection of basic tests has been added. * Improvements to wraps and check: > fail upon decoration (not execution) by checking wrapped function signature against wraps/check arguments. (might BREAK test code) > wraps only accepts strings and Units (not quantities) to avoid confusion with magnitude. (might BREAK code not conforming to documentation) > when strict=True, strings that can be parsed to quantities are accepted as arguments. * Add revolutions per second (rps) * Improved compatibility for upcast types like xarray's DataArray or Dataset, to which Pint Quantities now fully defer for arithmetic and NumPy operations. A collection of basic tests for proper deferral has been added (for full integration tests, see xarray's test suite). The list of upcast types is available at `pint.compat.upcast_types` in the API. * Moved docstrings to Numpy Docs * Added tests for immutability of the magnitude's type under common operations * Switched test configuration to pytest and added tests of Pint's matplotlib support. * Deprecate array protocol fallback except where explicitly defined (`__array__`, `__array_priority__`, `__array_function__`, `__array_ufunc__`). The fallback will remain until the next minor version, or if the environment variable `PINT_ARRAY_PROTOCOL_FALLBACK` is set to 0. * Removed eval usage when creating UnitDefinition and PrefixDefinition from string. * Added `fmt_locale` argument to registry. * Better error message when Babel is not installed. * It is now possible to redefine units within a context, and use pint for currency conversions. * NaN (any capitalization) in a definitions file is now treated as a number * Added slinch to Avoirdupois group * Fix bug where ureg.disable_contexts() would fail to fully disable throwaway contexts * Use black, flake8, and isort on the project * Auto-increase package version at every commit when pint is installed from the git tip, e.g. pip install git+https://github.com/hgrecco/pint.git. * Fix HTML (Jupyter Notebook) and LateX representation of some units * Fixed the definition of RKM unit as gf / tex * **BREAKING CHANGE**: Implement NEP-18 <https://numpy.org/neps/nep-0018-array-function-protocol.html> for Pint Quantities. Most NumPy functions that previously stripped units when applied to Pint Quantities will now return Quantities with proper units (on NumPy v1.16 with the array_function protocol enabled or v1.17+ by default) instead of ndarrays. Any non-explictly-handled functions will now raise a "no implementation found" TypeError instead of stripping units. The previous behavior is maintained for NumPy < v1.16 and when the array_function protocol is disabled. * Implementation of NumPy ufuncs has been refactored to share common utilities with NumPy function implementations * Pint Quantities now support the `@` matrix mulitiplication operator (on NumPy v1.16+), as well as the `dot`, `flatten`, `astype`, and `item` methods. * **BREAKING CHANGE**: Fix crash when applying pprint to large sets of Units. DefinitionSyntaxError is now a subclass of SyntaxError (was ValueError). DimensionalityError and OffsetUnitCalculusError are now subclasses of TypeError (was ValueError). * All Exceptions can now be pickled and can be accessed from the top-level package. * Mark regex as raw strings to avoid unnecessary warnings. * Implement registry-based string preprocessing as list of callables. * Context activation and deactivation is now instantaneous; drastically reduced memory footprint of a context (it used to be ~1.6MB per context; now it's a few bytes) * **BREAKING CHANGE**: Drop support for Python < 3.6, numpy < 1.14, and uncertainties < 3.0; if you still need them, please install pint 0.9. Pint now adheres to NEP-29 <https://numpy.org/neps/nep-0029-deprecation_policy.html> as a rolling dependencies version policy. * Show proper code location of UnitStrippedWarning exception. * Reimplement _Quantity.__iter__ to return an iterator. * Add http://www.dimensionalanalysis.org/ to README * Allow for user defined units formatting. * Quantity, Unit, and Measurement are now accessible as top-level classes (pint.Quantity, pint.Unit, pint.Measurement) and can be instantiated without explicitly creating a UnitRegistry * Contexts don't need to have a name anymore * "Board feet" unit added top default registry * New syntax to add aliases to already existing definitions * copy.deepcopy() can now copy a UnitRegistry * Enabled many tests in test_issues when numpy is not available * Document the '_' symbols found in the definitions files * Improve OffsetUnitCalculusError message. * Atomic units for intensity and electric field. * Allow np arrays of scalar quantities to be plotted. * Updated gravitational constant to CODATA 2018. * Update to new SI definition and CODATA 2018. * Allow units with aliases but no symbol. * Fix definition of dimensionless units and constants. * Added RKM unit (used in textile industry). * Remove __name__ method definition in BaseRegistry. * Added t_force, short_ton_force and long_ton_force. * Fixed error message of DefinitionSyntaxError * Expanded the potential use of Decimal type to parsing. * Fixed gram name to allow translation by babel. * Default group should only have orphan units. * Added custom constructors from_sequence and from_list. * Add quantity formatting with ndarray. * Add pint-pandas notebook docs * Use µ as default abbreviation for micro. OBS-URL: https://build.opensuse.org/request/show/768793 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-Pint?expand=0&rev=6
2020-01-30 15:50:20 +00:00
%define skip_python2 1
%define skip_python36 1
Name: python-Pint
Version: 0.18
Release: 0
Summary: Physical quantities module
License: BSD-3-Clause
URL: https://github.com/hgrecco/pint
Source: https://files.pythonhosted.org/packages/source/P/Pint/Pint-%{version}.tar.gz
BuildRequires: %{python_module importlib-metadata}
BuildRequires: %{python_module importlib-resources}
Accepting request 768793 from home:TheBlackCat:branches:devel:languages:python:numeric - Update to 0.10.1 * Fixed bug introduced in 0.10 that prevented creation of size-zero Quantities from NumPy arrays by multiplication. * Fixed several Sphinx issues. Fixed intersphinx hooks to all classes missing. * Fixed __array__ signature to match numpy docs - Update to 0.10 * **BREAKING CHANGE**: Boolean value of Quantities with offsets units is ambiguous, and so, now a ValueError is raised when attempting to cast such a Quantity to boolean. * **BREAKING CHANGE**: `__array_ufunc__` has been implemented on `pint.Unit` to permit multiplication/division by units on the right of ufunc-reliant array types (like Sparse) with proper respect for the type casting hierarchy. However, until an upstream issue with NumPy is resolved, this breaks creation of Masked Array Quantities by multiplication on the right. * Documentation on Pint's array type compatibility has been added to the NumPy support page, including a graph of the duck array type casting hierarchy as understood by Pint for N-dimensional arrays. * Improved compatibility for downcast duck array types like Sparse.COO. A collection of basic tests has been added. * Improvements to wraps and check: > fail upon decoration (not execution) by checking wrapped function signature against wraps/check arguments. (might BREAK test code) > wraps only accepts strings and Units (not quantities) to avoid confusion with magnitude. (might BREAK code not conforming to documentation) > when strict=True, strings that can be parsed to quantities are accepted as arguments. * Add revolutions per second (rps) * Improved compatibility for upcast types like xarray's DataArray or Dataset, to which Pint Quantities now fully defer for arithmetic and NumPy operations. A collection of basic tests for proper deferral has been added (for full integration tests, see xarray's test suite). The list of upcast types is available at `pint.compat.upcast_types` in the API. * Moved docstrings to Numpy Docs * Added tests for immutability of the magnitude's type under common operations * Switched test configuration to pytest and added tests of Pint's matplotlib support. * Deprecate array protocol fallback except where explicitly defined (`__array__`, `__array_priority__`, `__array_function__`, `__array_ufunc__`). The fallback will remain until the next minor version, or if the environment variable `PINT_ARRAY_PROTOCOL_FALLBACK` is set to 0. * Removed eval usage when creating UnitDefinition and PrefixDefinition from string. * Added `fmt_locale` argument to registry. * Better error message when Babel is not installed. * It is now possible to redefine units within a context, and use pint for currency conversions. * NaN (any capitalization) in a definitions file is now treated as a number * Added slinch to Avoirdupois group * Fix bug where ureg.disable_contexts() would fail to fully disable throwaway contexts * Use black, flake8, and isort on the project * Auto-increase package version at every commit when pint is installed from the git tip, e.g. pip install git+https://github.com/hgrecco/pint.git. * Fix HTML (Jupyter Notebook) and LateX representation of some units * Fixed the definition of RKM unit as gf / tex * **BREAKING CHANGE**: Implement NEP-18 <https://numpy.org/neps/nep-0018-array-function-protocol.html> for Pint Quantities. Most NumPy functions that previously stripped units when applied to Pint Quantities will now return Quantities with proper units (on NumPy v1.16 with the array_function protocol enabled or v1.17+ by default) instead of ndarrays. Any non-explictly-handled functions will now raise a "no implementation found" TypeError instead of stripping units. The previous behavior is maintained for NumPy < v1.16 and when the array_function protocol is disabled. * Implementation of NumPy ufuncs has been refactored to share common utilities with NumPy function implementations * Pint Quantities now support the `@` matrix mulitiplication operator (on NumPy v1.16+), as well as the `dot`, `flatten`, `astype`, and `item` methods. * **BREAKING CHANGE**: Fix crash when applying pprint to large sets of Units. DefinitionSyntaxError is now a subclass of SyntaxError (was ValueError). DimensionalityError and OffsetUnitCalculusError are now subclasses of TypeError (was ValueError). * All Exceptions can now be pickled and can be accessed from the top-level package. * Mark regex as raw strings to avoid unnecessary warnings. * Implement registry-based string preprocessing as list of callables. * Context activation and deactivation is now instantaneous; drastically reduced memory footprint of a context (it used to be ~1.6MB per context; now it's a few bytes) * **BREAKING CHANGE**: Drop support for Python < 3.6, numpy < 1.14, and uncertainties < 3.0; if you still need them, please install pint 0.9. Pint now adheres to NEP-29 <https://numpy.org/neps/nep-0029-deprecation_policy.html> as a rolling dependencies version policy. * Show proper code location of UnitStrippedWarning exception. * Reimplement _Quantity.__iter__ to return an iterator. * Add http://www.dimensionalanalysis.org/ to README * Allow for user defined units formatting. * Quantity, Unit, and Measurement are now accessible as top-level classes (pint.Quantity, pint.Unit, pint.Measurement) and can be instantiated without explicitly creating a UnitRegistry * Contexts don't need to have a name anymore * "Board feet" unit added top default registry * New syntax to add aliases to already existing definitions * copy.deepcopy() can now copy a UnitRegistry * Enabled many tests in test_issues when numpy is not available * Document the '_' symbols found in the definitions files * Improve OffsetUnitCalculusError message. * Atomic units for intensity and electric field. * Allow np arrays of scalar quantities to be plotted. * Updated gravitational constant to CODATA 2018. * Update to new SI definition and CODATA 2018. * Allow units with aliases but no symbol. * Fix definition of dimensionless units and constants. * Added RKM unit (used in textile industry). * Remove __name__ method definition in BaseRegistry. * Added t_force, short_ton_force and long_ton_force. * Fixed error message of DefinitionSyntaxError * Expanded the potential use of Decimal type to parsing. * Fixed gram name to allow translation by babel. * Default group should only have orphan units. * Added custom constructors from_sequence and from_list. * Add quantity formatting with ndarray. * Add pint-pandas notebook docs * Use µ as default abbreviation for micro. OBS-URL: https://build.opensuse.org/request/show/768793 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-Pint?expand=0&rev=6
2020-01-30 15:50:20 +00:00
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-importlib-metadata
Requires: python-importlib-resources
Accepting request 819258 from home:mcalabkova:branches:devel:languages:python:numeric - update to 0.14 * Changes required to support Pint-Pandas 0.1. * Reinstated support for pickle protocol 0 and 1, which is required by pytables (Issue #1036, Thanks Guido Imperiale) * Fixed bug with multiplication of Quantity by dict (Issue #1032) * Bare zeros and NaNs (not wrapped by Quantity) are now gracefully accepted by all numpy operations; e.g. np.stack([Quantity([1, 2], "m"), [0, np.nan]) is now valid, whereas np.stack([Quantity([1, 2], "m"), [3, 4]) will continue raising DimensionalityError. (Issue #1050, Thanks Guido Imperiale) * NaN is now treated the same as zero in addition, subtraction, equality, and disequality (Issue #1051, Thanks Guido Imperiale) * Fixed issue where quantities with a very large magnitude would throw an IndexError when using to_compact() * Fixed crash when a Unit with prefix is declared for the first time while a Context containing unit redefinitions is active (Issues #1062 and #1097, Thanks Guido Imperiale) * New implementation of 'Lx' String Format Type Option The old implementation treated 'Lx' as 'S' as produced by 'uncertainties' package, but that is not fully compatible with SIunitx. The new code protects SIunitx by fixing what unceratinties produces. (Issue #814) * Added link to budding `pint-xarray` interface library to the docs, next to the link to pint*pandas. (Thanks Tom Nicholas.) * Removed outdated `_dir` attribute of `UnitsRegistry`, and added `__iter__` method so that now `list(ureg)` returns a list of all units in registry. (Issue #1072, Thanks Tom Nicholas) * Replace pkg_resources.version to importlib.metadata.version. (Issue #1083) * Fix typo in docs for wraps example with optional arguments. (Issue #1088) * Add momentum as a dimension * Fixed a bug where unit exponents were only partially superscripted in HTML format OBS-URL: https://build.opensuse.org/request/show/819258 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-Pint?expand=0&rev=14
2020-07-08 06:39:29 +00:00
Requires: python-packaging
Requires: python-uncertainties >= 3.0
Recommends: python-numpy >= 1.17
BuildArch: noarch
Accepting request 768793 from home:TheBlackCat:branches:devel:languages:python:numeric - Update to 0.10.1 * Fixed bug introduced in 0.10 that prevented creation of size-zero Quantities from NumPy arrays by multiplication. * Fixed several Sphinx issues. Fixed intersphinx hooks to all classes missing. * Fixed __array__ signature to match numpy docs - Update to 0.10 * **BREAKING CHANGE**: Boolean value of Quantities with offsets units is ambiguous, and so, now a ValueError is raised when attempting to cast such a Quantity to boolean. * **BREAKING CHANGE**: `__array_ufunc__` has been implemented on `pint.Unit` to permit multiplication/division by units on the right of ufunc-reliant array types (like Sparse) with proper respect for the type casting hierarchy. However, until an upstream issue with NumPy is resolved, this breaks creation of Masked Array Quantities by multiplication on the right. * Documentation on Pint's array type compatibility has been added to the NumPy support page, including a graph of the duck array type casting hierarchy as understood by Pint for N-dimensional arrays. * Improved compatibility for downcast duck array types like Sparse.COO. A collection of basic tests has been added. * Improvements to wraps and check: > fail upon decoration (not execution) by checking wrapped function signature against wraps/check arguments. (might BREAK test code) > wraps only accepts strings and Units (not quantities) to avoid confusion with magnitude. (might BREAK code not conforming to documentation) > when strict=True, strings that can be parsed to quantities are accepted as arguments. * Add revolutions per second (rps) * Improved compatibility for upcast types like xarray's DataArray or Dataset, to which Pint Quantities now fully defer for arithmetic and NumPy operations. A collection of basic tests for proper deferral has been added (for full integration tests, see xarray's test suite). The list of upcast types is available at `pint.compat.upcast_types` in the API. * Moved docstrings to Numpy Docs * Added tests for immutability of the magnitude's type under common operations * Switched test configuration to pytest and added tests of Pint's matplotlib support. * Deprecate array protocol fallback except where explicitly defined (`__array__`, `__array_priority__`, `__array_function__`, `__array_ufunc__`). The fallback will remain until the next minor version, or if the environment variable `PINT_ARRAY_PROTOCOL_FALLBACK` is set to 0. * Removed eval usage when creating UnitDefinition and PrefixDefinition from string. * Added `fmt_locale` argument to registry. * Better error message when Babel is not installed. * It is now possible to redefine units within a context, and use pint for currency conversions. * NaN (any capitalization) in a definitions file is now treated as a number * Added slinch to Avoirdupois group * Fix bug where ureg.disable_contexts() would fail to fully disable throwaway contexts * Use black, flake8, and isort on the project * Auto-increase package version at every commit when pint is installed from the git tip, e.g. pip install git+https://github.com/hgrecco/pint.git. * Fix HTML (Jupyter Notebook) and LateX representation of some units * Fixed the definition of RKM unit as gf / tex * **BREAKING CHANGE**: Implement NEP-18 <https://numpy.org/neps/nep-0018-array-function-protocol.html> for Pint Quantities. Most NumPy functions that previously stripped units when applied to Pint Quantities will now return Quantities with proper units (on NumPy v1.16 with the array_function protocol enabled or v1.17+ by default) instead of ndarrays. Any non-explictly-handled functions will now raise a "no implementation found" TypeError instead of stripping units. The previous behavior is maintained for NumPy < v1.16 and when the array_function protocol is disabled. * Implementation of NumPy ufuncs has been refactored to share common utilities with NumPy function implementations * Pint Quantities now support the `@` matrix mulitiplication operator (on NumPy v1.16+), as well as the `dot`, `flatten`, `astype`, and `item` methods. * **BREAKING CHANGE**: Fix crash when applying pprint to large sets of Units. DefinitionSyntaxError is now a subclass of SyntaxError (was ValueError). DimensionalityError and OffsetUnitCalculusError are now subclasses of TypeError (was ValueError). * All Exceptions can now be pickled and can be accessed from the top-level package. * Mark regex as raw strings to avoid unnecessary warnings. * Implement registry-based string preprocessing as list of callables. * Context activation and deactivation is now instantaneous; drastically reduced memory footprint of a context (it used to be ~1.6MB per context; now it's a few bytes) * **BREAKING CHANGE**: Drop support for Python < 3.6, numpy < 1.14, and uncertainties < 3.0; if you still need them, please install pint 0.9. Pint now adheres to NEP-29 <https://numpy.org/neps/nep-0029-deprecation_policy.html> as a rolling dependencies version policy. * Show proper code location of UnitStrippedWarning exception. * Reimplement _Quantity.__iter__ to return an iterator. * Add http://www.dimensionalanalysis.org/ to README * Allow for user defined units formatting. * Quantity, Unit, and Measurement are now accessible as top-level classes (pint.Quantity, pint.Unit, pint.Measurement) and can be instantiated without explicitly creating a UnitRegistry * Contexts don't need to have a name anymore * "Board feet" unit added top default registry * New syntax to add aliases to already existing definitions * copy.deepcopy() can now copy a UnitRegistry * Enabled many tests in test_issues when numpy is not available * Document the '_' symbols found in the definitions files * Improve OffsetUnitCalculusError message. * Atomic units for intensity and electric field. * Allow np arrays of scalar quantities to be plotted. * Updated gravitational constant to CODATA 2018. * Update to new SI definition and CODATA 2018. * Allow units with aliases but no symbol. * Fix definition of dimensionless units and constants. * Added RKM unit (used in textile industry). * Remove __name__ method definition in BaseRegistry. * Added t_force, short_ton_force and long_ton_force. * Fixed error message of DefinitionSyntaxError * Expanded the potential use of Decimal type to parsing. * Fixed gram name to allow translation by babel. * Default group should only have orphan units. * Added custom constructors from_sequence and from_list. * Add quantity formatting with ndarray. * Add pint-pandas notebook docs * Use µ as default abbreviation for micro. OBS-URL: https://build.opensuse.org/request/show/768793 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-Pint?expand=0&rev=6
2020-01-30 15:50:20 +00:00
# SECTION test requirements
BuildRequires: %{python_module numpy >= 1.17}
Accepting request 819258 from home:mcalabkova:branches:devel:languages:python:numeric - update to 0.14 * Changes required to support Pint-Pandas 0.1. * Reinstated support for pickle protocol 0 and 1, which is required by pytables (Issue #1036, Thanks Guido Imperiale) * Fixed bug with multiplication of Quantity by dict (Issue #1032) * Bare zeros and NaNs (not wrapped by Quantity) are now gracefully accepted by all numpy operations; e.g. np.stack([Quantity([1, 2], "m"), [0, np.nan]) is now valid, whereas np.stack([Quantity([1, 2], "m"), [3, 4]) will continue raising DimensionalityError. (Issue #1050, Thanks Guido Imperiale) * NaN is now treated the same as zero in addition, subtraction, equality, and disequality (Issue #1051, Thanks Guido Imperiale) * Fixed issue where quantities with a very large magnitude would throw an IndexError when using to_compact() * Fixed crash when a Unit with prefix is declared for the first time while a Context containing unit redefinitions is active (Issues #1062 and #1097, Thanks Guido Imperiale) * New implementation of 'Lx' String Format Type Option The old implementation treated 'Lx' as 'S' as produced by 'uncertainties' package, but that is not fully compatible with SIunitx. The new code protects SIunitx by fixing what unceratinties produces. (Issue #814) * Added link to budding `pint-xarray` interface library to the docs, next to the link to pint*pandas. (Thanks Tom Nicholas.) * Removed outdated `_dir` attribute of `UnitsRegistry`, and added `__iter__` method so that now `list(ureg)` returns a list of all units in registry. (Issue #1072, Thanks Tom Nicholas) * Replace pkg_resources.version to importlib.metadata.version. (Issue #1083) * Fix typo in docs for wraps example with optional arguments. (Issue #1088) * Add momentum as a dimension * Fixed a bug where unit exponents were only partially superscripted in HTML format OBS-URL: https://build.opensuse.org/request/show/819258 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-Pint?expand=0&rev=14
2020-07-08 06:39:29 +00:00
BuildRequires: %{python_module packaging}
BuildRequires: %{python_module pytest >= 4.0}
BuildRequires: %{python_module pytest-subtests}
Accepting request 819258 from home:mcalabkova:branches:devel:languages:python:numeric - update to 0.14 * Changes required to support Pint-Pandas 0.1. * Reinstated support for pickle protocol 0 and 1, which is required by pytables (Issue #1036, Thanks Guido Imperiale) * Fixed bug with multiplication of Quantity by dict (Issue #1032) * Bare zeros and NaNs (not wrapped by Quantity) are now gracefully accepted by all numpy operations; e.g. np.stack([Quantity([1, 2], "m"), [0, np.nan]) is now valid, whereas np.stack([Quantity([1, 2], "m"), [3, 4]) will continue raising DimensionalityError. (Issue #1050, Thanks Guido Imperiale) * NaN is now treated the same as zero in addition, subtraction, equality, and disequality (Issue #1051, Thanks Guido Imperiale) * Fixed issue where quantities with a very large magnitude would throw an IndexError when using to_compact() * Fixed crash when a Unit with prefix is declared for the first time while a Context containing unit redefinitions is active (Issues #1062 and #1097, Thanks Guido Imperiale) * New implementation of 'Lx' String Format Type Option The old implementation treated 'Lx' as 'S' as produced by 'uncertainties' package, but that is not fully compatible with SIunitx. The new code protects SIunitx by fixing what unceratinties produces. (Issue #814) * Added link to budding `pint-xarray` interface library to the docs, next to the link to pint*pandas. (Thanks Tom Nicholas.) * Removed outdated `_dir` attribute of `UnitsRegistry`, and added `__iter__` method so that now `list(ureg)` returns a list of all units in registry. (Issue #1072, Thanks Tom Nicholas) * Replace pkg_resources.version to importlib.metadata.version. (Issue #1083) * Fix typo in docs for wraps example with optional arguments. (Issue #1088) * Add momentum as a dimension * Fixed a bug where unit exponents were only partially superscripted in HTML format OBS-URL: https://build.opensuse.org/request/show/819258 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-Pint?expand=0&rev=14
2020-07-08 06:39:29 +00:00
BuildRequires: %{python_module uncertainties >= 3.0}
Accepting request 768793 from home:TheBlackCat:branches:devel:languages:python:numeric - Update to 0.10.1 * Fixed bug introduced in 0.10 that prevented creation of size-zero Quantities from NumPy arrays by multiplication. * Fixed several Sphinx issues. Fixed intersphinx hooks to all classes missing. * Fixed __array__ signature to match numpy docs - Update to 0.10 * **BREAKING CHANGE**: Boolean value of Quantities with offsets units is ambiguous, and so, now a ValueError is raised when attempting to cast such a Quantity to boolean. * **BREAKING CHANGE**: `__array_ufunc__` has been implemented on `pint.Unit` to permit multiplication/division by units on the right of ufunc-reliant array types (like Sparse) with proper respect for the type casting hierarchy. However, until an upstream issue with NumPy is resolved, this breaks creation of Masked Array Quantities by multiplication on the right. * Documentation on Pint's array type compatibility has been added to the NumPy support page, including a graph of the duck array type casting hierarchy as understood by Pint for N-dimensional arrays. * Improved compatibility for downcast duck array types like Sparse.COO. A collection of basic tests has been added. * Improvements to wraps and check: > fail upon decoration (not execution) by checking wrapped function signature against wraps/check arguments. (might BREAK test code) > wraps only accepts strings and Units (not quantities) to avoid confusion with magnitude. (might BREAK code not conforming to documentation) > when strict=True, strings that can be parsed to quantities are accepted as arguments. * Add revolutions per second (rps) * Improved compatibility for upcast types like xarray's DataArray or Dataset, to which Pint Quantities now fully defer for arithmetic and NumPy operations. A collection of basic tests for proper deferral has been added (for full integration tests, see xarray's test suite). The list of upcast types is available at `pint.compat.upcast_types` in the API. * Moved docstrings to Numpy Docs * Added tests for immutability of the magnitude's type under common operations * Switched test configuration to pytest and added tests of Pint's matplotlib support. * Deprecate array protocol fallback except where explicitly defined (`__array__`, `__array_priority__`, `__array_function__`, `__array_ufunc__`). The fallback will remain until the next minor version, or if the environment variable `PINT_ARRAY_PROTOCOL_FALLBACK` is set to 0. * Removed eval usage when creating UnitDefinition and PrefixDefinition from string. * Added `fmt_locale` argument to registry. * Better error message when Babel is not installed. * It is now possible to redefine units within a context, and use pint for currency conversions. * NaN (any capitalization) in a definitions file is now treated as a number * Added slinch to Avoirdupois group * Fix bug where ureg.disable_contexts() would fail to fully disable throwaway contexts * Use black, flake8, and isort on the project * Auto-increase package version at every commit when pint is installed from the git tip, e.g. pip install git+https://github.com/hgrecco/pint.git. * Fix HTML (Jupyter Notebook) and LateX representation of some units * Fixed the definition of RKM unit as gf / tex * **BREAKING CHANGE**: Implement NEP-18 <https://numpy.org/neps/nep-0018-array-function-protocol.html> for Pint Quantities. Most NumPy functions that previously stripped units when applied to Pint Quantities will now return Quantities with proper units (on NumPy v1.16 with the array_function protocol enabled or v1.17+ by default) instead of ndarrays. Any non-explictly-handled functions will now raise a "no implementation found" TypeError instead of stripping units. The previous behavior is maintained for NumPy < v1.16 and when the array_function protocol is disabled. * Implementation of NumPy ufuncs has been refactored to share common utilities with NumPy function implementations * Pint Quantities now support the `@` matrix mulitiplication operator (on NumPy v1.16+), as well as the `dot`, `flatten`, `astype`, and `item` methods. * **BREAKING CHANGE**: Fix crash when applying pprint to large sets of Units. DefinitionSyntaxError is now a subclass of SyntaxError (was ValueError). DimensionalityError and OffsetUnitCalculusError are now subclasses of TypeError (was ValueError). * All Exceptions can now be pickled and can be accessed from the top-level package. * Mark regex as raw strings to avoid unnecessary warnings. * Implement registry-based string preprocessing as list of callables. * Context activation and deactivation is now instantaneous; drastically reduced memory footprint of a context (it used to be ~1.6MB per context; now it's a few bytes) * **BREAKING CHANGE**: Drop support for Python < 3.6, numpy < 1.14, and uncertainties < 3.0; if you still need them, please install pint 0.9. Pint now adheres to NEP-29 <https://numpy.org/neps/nep-0029-deprecation_policy.html> as a rolling dependencies version policy. * Show proper code location of UnitStrippedWarning exception. * Reimplement _Quantity.__iter__ to return an iterator. * Add http://www.dimensionalanalysis.org/ to README * Allow for user defined units formatting. * Quantity, Unit, and Measurement are now accessible as top-level classes (pint.Quantity, pint.Unit, pint.Measurement) and can be instantiated without explicitly creating a UnitRegistry * Contexts don't need to have a name anymore * "Board feet" unit added top default registry * New syntax to add aliases to already existing definitions * copy.deepcopy() can now copy a UnitRegistry * Enabled many tests in test_issues when numpy is not available * Document the '_' symbols found in the definitions files * Improve OffsetUnitCalculusError message. * Atomic units for intensity and electric field. * Allow np arrays of scalar quantities to be plotted. * Updated gravitational constant to CODATA 2018. * Update to new SI definition and CODATA 2018. * Allow units with aliases but no symbol. * Fix definition of dimensionless units and constants. * Added RKM unit (used in textile industry). * Remove __name__ method definition in BaseRegistry. * Added t_force, short_ton_force and long_ton_force. * Fixed error message of DefinitionSyntaxError * Expanded the potential use of Decimal type to parsing. * Fixed gram name to allow translation by babel. * Default group should only have orphan units. * Added custom constructors from_sequence and from_list. * Add quantity formatting with ndarray. * Add pint-pandas notebook docs * Use µ as default abbreviation for micro. OBS-URL: https://build.opensuse.org/request/show/768793 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-Pint?expand=0&rev=6
2020-01-30 15:50:20 +00:00
# /SECTION
%python_subpackages
%description
Pint is Python module/package to define, operate and manipulate physical
quantities, the product of a numerical value and a unit of measurement.
It allows arithmetic operations between them and conversions from and
to different units.
It is distributed with a comprehensive list of physical units, prefixes
and constants. Due to it's modular design, you to extend (or even rewrite!)
the complete list without changing the source code.
%prep
%setup -q -n Pint-%{version}
%build
%python_build
%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/pint-convert
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
Accepting request 768793 from home:TheBlackCat:branches:devel:languages:python:numeric - Update to 0.10.1 * Fixed bug introduced in 0.10 that prevented creation of size-zero Quantities from NumPy arrays by multiplication. * Fixed several Sphinx issues. Fixed intersphinx hooks to all classes missing. * Fixed __array__ signature to match numpy docs - Update to 0.10 * **BREAKING CHANGE**: Boolean value of Quantities with offsets units is ambiguous, and so, now a ValueError is raised when attempting to cast such a Quantity to boolean. * **BREAKING CHANGE**: `__array_ufunc__` has been implemented on `pint.Unit` to permit multiplication/division by units on the right of ufunc-reliant array types (like Sparse) with proper respect for the type casting hierarchy. However, until an upstream issue with NumPy is resolved, this breaks creation of Masked Array Quantities by multiplication on the right. * Documentation on Pint's array type compatibility has been added to the NumPy support page, including a graph of the duck array type casting hierarchy as understood by Pint for N-dimensional arrays. * Improved compatibility for downcast duck array types like Sparse.COO. A collection of basic tests has been added. * Improvements to wraps and check: > fail upon decoration (not execution) by checking wrapped function signature against wraps/check arguments. (might BREAK test code) > wraps only accepts strings and Units (not quantities) to avoid confusion with magnitude. (might BREAK code not conforming to documentation) > when strict=True, strings that can be parsed to quantities are accepted as arguments. * Add revolutions per second (rps) * Improved compatibility for upcast types like xarray's DataArray or Dataset, to which Pint Quantities now fully defer for arithmetic and NumPy operations. A collection of basic tests for proper deferral has been added (for full integration tests, see xarray's test suite). The list of upcast types is available at `pint.compat.upcast_types` in the API. * Moved docstrings to Numpy Docs * Added tests for immutability of the magnitude's type under common operations * Switched test configuration to pytest and added tests of Pint's matplotlib support. * Deprecate array protocol fallback except where explicitly defined (`__array__`, `__array_priority__`, `__array_function__`, `__array_ufunc__`). The fallback will remain until the next minor version, or if the environment variable `PINT_ARRAY_PROTOCOL_FALLBACK` is set to 0. * Removed eval usage when creating UnitDefinition and PrefixDefinition from string. * Added `fmt_locale` argument to registry. * Better error message when Babel is not installed. * It is now possible to redefine units within a context, and use pint for currency conversions. * NaN (any capitalization) in a definitions file is now treated as a number * Added slinch to Avoirdupois group * Fix bug where ureg.disable_contexts() would fail to fully disable throwaway contexts * Use black, flake8, and isort on the project * Auto-increase package version at every commit when pint is installed from the git tip, e.g. pip install git+https://github.com/hgrecco/pint.git. * Fix HTML (Jupyter Notebook) and LateX representation of some units * Fixed the definition of RKM unit as gf / tex * **BREAKING CHANGE**: Implement NEP-18 <https://numpy.org/neps/nep-0018-array-function-protocol.html> for Pint Quantities. Most NumPy functions that previously stripped units when applied to Pint Quantities will now return Quantities with proper units (on NumPy v1.16 with the array_function protocol enabled or v1.17+ by default) instead of ndarrays. Any non-explictly-handled functions will now raise a "no implementation found" TypeError instead of stripping units. The previous behavior is maintained for NumPy < v1.16 and when the array_function protocol is disabled. * Implementation of NumPy ufuncs has been refactored to share common utilities with NumPy function implementations * Pint Quantities now support the `@` matrix mulitiplication operator (on NumPy v1.16+), as well as the `dot`, `flatten`, `astype`, and `item` methods. * **BREAKING CHANGE**: Fix crash when applying pprint to large sets of Units. DefinitionSyntaxError is now a subclass of SyntaxError (was ValueError). DimensionalityError and OffsetUnitCalculusError are now subclasses of TypeError (was ValueError). * All Exceptions can now be pickled and can be accessed from the top-level package. * Mark regex as raw strings to avoid unnecessary warnings. * Implement registry-based string preprocessing as list of callables. * Context activation and deactivation is now instantaneous; drastically reduced memory footprint of a context (it used to be ~1.6MB per context; now it's a few bytes) * **BREAKING CHANGE**: Drop support for Python < 3.6, numpy < 1.14, and uncertainties < 3.0; if you still need them, please install pint 0.9. Pint now adheres to NEP-29 <https://numpy.org/neps/nep-0029-deprecation_policy.html> as a rolling dependencies version policy. * Show proper code location of UnitStrippedWarning exception. * Reimplement _Quantity.__iter__ to return an iterator. * Add http://www.dimensionalanalysis.org/ to README * Allow for user defined units formatting. * Quantity, Unit, and Measurement are now accessible as top-level classes (pint.Quantity, pint.Unit, pint.Measurement) and can be instantiated without explicitly creating a UnitRegistry * Contexts don't need to have a name anymore * "Board feet" unit added top default registry * New syntax to add aliases to already existing definitions * copy.deepcopy() can now copy a UnitRegistry * Enabled many tests in test_issues when numpy is not available * Document the '_' symbols found in the definitions files * Improve OffsetUnitCalculusError message. * Atomic units for intensity and electric field. * Allow np arrays of scalar quantities to be plotted. * Updated gravitational constant to CODATA 2018. * Update to new SI definition and CODATA 2018. * Allow units with aliases but no symbol. * Fix definition of dimensionless units and constants. * Added RKM unit (used in textile industry). * Remove __name__ method definition in BaseRegistry. * Added t_force, short_ton_force and long_ton_force. * Fixed error message of DefinitionSyntaxError * Expanded the potential use of Decimal type to parsing. * Fixed gram name to allow translation by babel. * Default group should only have orphan units. * Added custom constructors from_sequence and from_list. * Add quantity formatting with ndarray. * Add pint-pandas notebook docs * Use µ as default abbreviation for micro. OBS-URL: https://build.opensuse.org/request/show/768793 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-Pint?expand=0&rev=6
2020-01-30 15:50:20 +00:00
# Test assumes 64bit arch
# See: https://github.com/hgrecco/pint/issues/1006
%pytest -k 'not test_result_type_numpy_func'
%post
%python_install_alternative pint-convert
%postun
%python_uninstall_alternative pint-convert
%files %{python_files}
%license LICENSE
Accepting request 768793 from home:TheBlackCat:branches:devel:languages:python:numeric - Update to 0.10.1 * Fixed bug introduced in 0.10 that prevented creation of size-zero Quantities from NumPy arrays by multiplication. * Fixed several Sphinx issues. Fixed intersphinx hooks to all classes missing. * Fixed __array__ signature to match numpy docs - Update to 0.10 * **BREAKING CHANGE**: Boolean value of Quantities with offsets units is ambiguous, and so, now a ValueError is raised when attempting to cast such a Quantity to boolean. * **BREAKING CHANGE**: `__array_ufunc__` has been implemented on `pint.Unit` to permit multiplication/division by units on the right of ufunc-reliant array types (like Sparse) with proper respect for the type casting hierarchy. However, until an upstream issue with NumPy is resolved, this breaks creation of Masked Array Quantities by multiplication on the right. * Documentation on Pint's array type compatibility has been added to the NumPy support page, including a graph of the duck array type casting hierarchy as understood by Pint for N-dimensional arrays. * Improved compatibility for downcast duck array types like Sparse.COO. A collection of basic tests has been added. * Improvements to wraps and check: > fail upon decoration (not execution) by checking wrapped function signature against wraps/check arguments. (might BREAK test code) > wraps only accepts strings and Units (not quantities) to avoid confusion with magnitude. (might BREAK code not conforming to documentation) > when strict=True, strings that can be parsed to quantities are accepted as arguments. * Add revolutions per second (rps) * Improved compatibility for upcast types like xarray's DataArray or Dataset, to which Pint Quantities now fully defer for arithmetic and NumPy operations. A collection of basic tests for proper deferral has been added (for full integration tests, see xarray's test suite). The list of upcast types is available at `pint.compat.upcast_types` in the API. * Moved docstrings to Numpy Docs * Added tests for immutability of the magnitude's type under common operations * Switched test configuration to pytest and added tests of Pint's matplotlib support. * Deprecate array protocol fallback except where explicitly defined (`__array__`, `__array_priority__`, `__array_function__`, `__array_ufunc__`). The fallback will remain until the next minor version, or if the environment variable `PINT_ARRAY_PROTOCOL_FALLBACK` is set to 0. * Removed eval usage when creating UnitDefinition and PrefixDefinition from string. * Added `fmt_locale` argument to registry. * Better error message when Babel is not installed. * It is now possible to redefine units within a context, and use pint for currency conversions. * NaN (any capitalization) in a definitions file is now treated as a number * Added slinch to Avoirdupois group * Fix bug where ureg.disable_contexts() would fail to fully disable throwaway contexts * Use black, flake8, and isort on the project * Auto-increase package version at every commit when pint is installed from the git tip, e.g. pip install git+https://github.com/hgrecco/pint.git. * Fix HTML (Jupyter Notebook) and LateX representation of some units * Fixed the definition of RKM unit as gf / tex * **BREAKING CHANGE**: Implement NEP-18 <https://numpy.org/neps/nep-0018-array-function-protocol.html> for Pint Quantities. Most NumPy functions that previously stripped units when applied to Pint Quantities will now return Quantities with proper units (on NumPy v1.16 with the array_function protocol enabled or v1.17+ by default) instead of ndarrays. Any non-explictly-handled functions will now raise a "no implementation found" TypeError instead of stripping units. The previous behavior is maintained for NumPy < v1.16 and when the array_function protocol is disabled. * Implementation of NumPy ufuncs has been refactored to share common utilities with NumPy function implementations * Pint Quantities now support the `@` matrix mulitiplication operator (on NumPy v1.16+), as well as the `dot`, `flatten`, `astype`, and `item` methods. * **BREAKING CHANGE**: Fix crash when applying pprint to large sets of Units. DefinitionSyntaxError is now a subclass of SyntaxError (was ValueError). DimensionalityError and OffsetUnitCalculusError are now subclasses of TypeError (was ValueError). * All Exceptions can now be pickled and can be accessed from the top-level package. * Mark regex as raw strings to avoid unnecessary warnings. * Implement registry-based string preprocessing as list of callables. * Context activation and deactivation is now instantaneous; drastically reduced memory footprint of a context (it used to be ~1.6MB per context; now it's a few bytes) * **BREAKING CHANGE**: Drop support for Python < 3.6, numpy < 1.14, and uncertainties < 3.0; if you still need them, please install pint 0.9. Pint now adheres to NEP-29 <https://numpy.org/neps/nep-0029-deprecation_policy.html> as a rolling dependencies version policy. * Show proper code location of UnitStrippedWarning exception. * Reimplement _Quantity.__iter__ to return an iterator. * Add http://www.dimensionalanalysis.org/ to README * Allow for user defined units formatting. * Quantity, Unit, and Measurement are now accessible as top-level classes (pint.Quantity, pint.Unit, pint.Measurement) and can be instantiated without explicitly creating a UnitRegistry * Contexts don't need to have a name anymore * "Board feet" unit added top default registry * New syntax to add aliases to already existing definitions * copy.deepcopy() can now copy a UnitRegistry * Enabled many tests in test_issues when numpy is not available * Document the '_' symbols found in the definitions files * Improve OffsetUnitCalculusError message. * Atomic units for intensity and electric field. * Allow np arrays of scalar quantities to be plotted. * Updated gravitational constant to CODATA 2018. * Update to new SI definition and CODATA 2018. * Allow units with aliases but no symbol. * Fix definition of dimensionless units and constants. * Added RKM unit (used in textile industry). * Remove __name__ method definition in BaseRegistry. * Added t_force, short_ton_force and long_ton_force. * Fixed error message of DefinitionSyntaxError * Expanded the potential use of Decimal type to parsing. * Fixed gram name to allow translation by babel. * Default group should only have orphan units. * Added custom constructors from_sequence and from_list. * Add quantity formatting with ndarray. * Add pint-pandas notebook docs * Use µ as default abbreviation for micro. OBS-URL: https://build.opensuse.org/request/show/768793 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-Pint?expand=0&rev=6
2020-01-30 15:50:20 +00:00
%doc AUTHORS CHANGES README.rst
%python_alternative %{_bindir}/pint-convert
%{python_sitelib}/Pint-0*-py*.egg-info
%{python_sitelib}/pint/
%changelog