dev-python/quantities: Remove old

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2023-04-05 10:17:55 +02:00
parent f9e58e1723
commit 498e4fd68b
4 changed files with 0 additions and 141 deletions

View File

@@ -1,3 +1 @@
DIST python-quantities-0.13.0.gh.tar.gz 107178 BLAKE2B f5fe69ed1d82bc90620a1cabf4c68f676330a2b09e8590bedf48ee8c46e3176d57e0dc6374d1112377056cd1138553d92f0bcaf0a68e2600e3631226e2262afc SHA512 d108b0f5bd834aeb7443693175d54b2b01fa9110cc57f0356681374ce95b5f57e39253d9c8166365aabc379f2f26bba3a827689ceb6c45595345e140b4cd7ad3
DIST python-quantities-0.14.0.gh.tar.gz 84115 BLAKE2B 549ac64583ebac9a68069e678ee82ac3d9d4462dee4ebffe631c0c20d0819996b0172ceb2cb276aae52ad4dc963e3bfad8f6082d98b90bf6f94c27f807d91565 SHA512 78696938c10e613e1fd6f98f9158d51ec4e86928f9833b73321cde776d77735c119af854aaaff5542093175cd105a33266fba16b31b9e04b51c7f14f648b1e19
DIST python-quantities-0.14.1.gh.tar.gz 84275 BLAKE2B 7760a46f9f893a87badcbfd8aaad6a5598013b0cc835f17e0b788d3329be35702532fa17dc581ab0db4064292d6521d39d3ada7819c9a6c7b0e8a9b568d343dd SHA512 16c12110c2a705e4016d9575beb7f3322c3590cd12091a2710eca48fd6927b07b0d564ef93eb8af0b21688a0e86df1e60abb45625234abfaf1fa414e8b9fd110

View File

@@ -1,68 +0,0 @@
From 29852b895d5d39006d1f129397cffae3578a694e Mon Sep 17 00:00:00 2001
From: Andrew Davison <andrew.davison@cnrs.fr>
Date: Thu, 7 Jul 2022 10:03:32 +0200
Subject: [PATCH] fix failure to handle units with floordiv
fixes #205
---
quantities/dimensionality.py | 2 +-
quantities/tests/test_arithmetic.py | 16 +++++++++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/quantities/dimensionality.py b/quantities/dimensionality.py
index cea68ca..d54f96f 100644
--- a/quantities/dimensionality.py
+++ b/quantities/dimensionality.py
@@ -238,6 +238,7 @@ def _d_divide(q1, q2, out=None):
return q2.dimensionality**-1
p_dict[np.divide] = _d_divide
p_dict[np.true_divide] = _d_divide
+p_dict[np.floor_divide] = _d_divide
def _d_check_uniform(q1, q2, out=None):
try:
@@ -273,7 +274,6 @@ p_dict[np.subtract] = _d_check_uniform
p_dict[np.mod] = _d_check_uniform
p_dict[np.fmod] = _d_check_uniform
p_dict[np.remainder] = _d_check_uniform
-p_dict[np.floor_divide] = _d_check_uniform
p_dict[np.hypot] = _d_check_uniform
p_dict[np.equal] = _d_check_uniform
p_dict[np.not_equal] = _d_check_uniform
diff --git a/quantities/tests/test_arithmetic.py b/quantities/tests/test_arithmetic.py
index fe5670e..534702c 100644
--- a/quantities/tests/test_arithmetic.py
+++ b/quantities/tests/test_arithmetic.py
@@ -52,7 +52,7 @@ class iter_dtypes:
def __init__(self):
self._i = 1
- self._typeDict = np.typeDict.copy()
+ self._typeDict = np.sctypeDict.copy()
self._typeDict[17] = int
self._typeDict[18] = long
self._typeDict[19] = float
@@ -132,6 +132,20 @@ class TestDTypes(TestCase):
self.check_rmul(x, y)
dtypes.pop(0)
+ def test_truediv(self):
+ q = Quantity([44, 40, 36, 32], units=pq.ms)
+ self.assertQuantityEqual(
+ q/(4 * pq.ms),
+ Quantity([11, 10, 9, 8], units=pq.dimensionless)
+ )
+
+ def test_floordiv(self):
+ q = Quantity([45, 43, 39, 32], units=pq.ms)
+ self.assertQuantityEqual(
+ q//(4 * pq.ms),
+ Quantity([11, 10, 9, 8], units=pq.dimensionless)
+ )
+
def test_mixed_addition(self):
self.assertQuantityEqual(1*pq.ft + 1*pq.m, 4.280839895 * pq.ft)
self.assertQuantityEqual(1*pq.ft + pq.m, 4.280839895 * pq.ft)
--
2.39.0

View File

@@ -1,35 +0,0 @@
# Copyright 2020-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{9..11} )
inherit distutils-r1
MY_P="python-quantities-${PV}"
DESCRIPTION="Support for physical quantities with units, based on numpy"
HOMEPAGE="
https://github.com/python-quantities/python-quantities/
https://pypi.org/project/quantities/
"
SRC_URI="
https://github.com/python-quantities/python-quantities/archive/v${PV}.tar.gz
-> ${MY_P}.gh.tar.gz
"
S=${WORKDIR}/${MY_P}
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 x86"
RDEPEND="
>=dev-python/numpy-1.16[$PYTHON_USEDEP]
"
distutils_enable_tests pytest
PATCHES=(
"${FILESDIR}"/${P}-numpy.patch
)

View File

@@ -1,36 +0,0 @@
# Copyright 2020-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{9..11} )
inherit distutils-r1
MY_P="python-quantities-${PV}"
DESCRIPTION="Support for physical quantities with units, based on numpy"
HOMEPAGE="
https://github.com/python-quantities/python-quantities/
https://pypi.org/project/quantities/
"
SRC_URI="
https://github.com/python-quantities/python-quantities/archive/v${PV}.tar.gz
-> ${MY_P}.gh.tar.gz
"
S=${WORKDIR}/${MY_P}
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
RDEPEND="
>=dev-python/numpy-1.19[$PYTHON_USEDEP]
"
BDEPEND="
dev-python/setuptools-scm[${PYTHON_USEDEP}]
"
distutils_enable_tests pytest
export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}