quantities 0.16.3__tar.gz → 0.16.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {quantities-0.16.3 → quantities-0.16.4}/CHANGES.txt +6 -0
- {quantities-0.16.3 → quantities-0.16.4}/PKG-INFO +1 -1
- {quantities-0.16.3 → quantities-0.16.4}/codemeta.json +1 -1
- {quantities-0.16.3 → quantities-0.16.4}/quantities/_version.py +3 -3
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/_codata.py +1 -1
- {quantities-0.16.3 → quantities-0.16.4}/quantities/quantity.py +17 -4
- {quantities-0.16.3 → quantities-0.16.4}/quantities/tests/test_arithmetic.py +11 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/tests/test_persistence.py +3 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities.egg-info/PKG-INFO +1 -1
- {quantities-0.16.3 → quantities-0.16.4}/.gitattributes +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/.github/workflows/test.yml +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/.gitignore +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/.readthedocs.yaml +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/MANIFEST.in +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/README.rst +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/conda.recipe/bld.bat +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/conda.recipe/build.sh +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/conda.recipe/format_version.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/conda.recipe/meta.yaml +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/conda.recipe/run_test.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/Makefile +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/_templates/indexsidebar.html +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/conf.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/devel/devnotes.rst +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/devel/documenting.rst +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/devel/index.rst +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/devel/release.rst +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/index.rst +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/make.bat +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/rtd-requirements.txt +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/sphinxext/ipython_console_highlighting.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/user/credits.rst +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/user/index.rst +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/user/installation.rst +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/user/issues.rst +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/user/license.rst +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/doc/user/tutorial.rst +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/pyproject.toml +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/__init__.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/NIST_codata.txt +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/__init__.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/_utils.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/alpha.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/astronomy.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/atomicunits.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/deuteron.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/electromagnetism.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/electron.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/helion.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/mathematical.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/muon.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/naturalunits.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/neutron.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/proton.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/quantum.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/relationships.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/statisticalmechanics.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/tau.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/triton.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/weak.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/constants/xray.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/decorators.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/dimensionality.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/dimensionality.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/markup.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/quantity.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/registry.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/registry.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/tests/__init__.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/tests/common.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/tests/test_comparison.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/tests/test_constants.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/tests/test_conversion.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/tests/test_dimensionality.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/tests/test_formatting.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/tests/test_methods.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/tests/test_umath.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/tests/test_uncertainty.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/tests/test_units.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/typing/__init__.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/typing/quantities.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/umath.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/uncertainquantity.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/unitquantity.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/unitquantity.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/__init__.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/acceleration.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/acceleration.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/angle.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/angle.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/area.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/area.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/compound.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/compound.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/concentration.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/concentration.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/dimensionless.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/dimensionless.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/electromagnetism.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/electromagnetism.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/energy.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/energy.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/force.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/force.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/frequency.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/frequency.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/heat.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/heat.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/information.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/information.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/length.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/length.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/mass.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/mass.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/power.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/power.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/prefixes.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/prefixes.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/pressure.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/pressure.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/radiation.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/radiation.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/substance.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/substance.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/temperature.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/temperature.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/time.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/time.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/velocity.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/velocity.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/viscosity.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/viscosity.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/volume.py +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities/units/volume.pyi +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities.egg-info/SOURCES.txt +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities.egg-info/dependency_links.txt +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities.egg-info/requires.txt +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/quantities.egg-info/top_level.txt +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/setup.cfg +0 -0
- {quantities-0.16.3 → quantities-0.16.4}/setup.py +0 -0
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"dateModified": "2026-01-16",
|
|
164
164
|
"datePublished": "2009-10-13",
|
|
165
165
|
"description": "A Python package for handling physical quantities.\n\nQuantities is designed to handle arithmetic and conversions of physical quantities, which have a magnitude, dimensionality specified by various units, and possibly an uncertainty. Quantities builds on the popular NumPy library and is designed to work with NumPy ufuncs, many of which are already supported.",
|
|
166
|
-
"downloadUrl": "https://files.pythonhosted.org/packages
|
|
166
|
+
"downloadUrl": "https://files.pythonhosted.org/packages/f2/1f/04a5078af52b1587842eccd57e805f776919ab68d9a295efa061eb8c2f58/quantities-0.16.3.tar.gz",
|
|
167
167
|
"license": "https://spdx.org/licenses/BSD-3-Clause",
|
|
168
168
|
"name": "quantities",
|
|
169
169
|
"operatingSystem": ["Linux", "Windows", "macOS"],
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.16.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 16,
|
|
31
|
+
__version__ = version = '0.16.4'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 16, 4)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g66762fd38'
|
|
@@ -388,7 +388,10 @@ class Quantity(np.ndarray):
|
|
|
388
388
|
return super().__imul__(other)
|
|
389
389
|
else:
|
|
390
390
|
cself = self.copy()
|
|
391
|
-
|
|
391
|
+
if hasattr(other, "copy"):
|
|
392
|
+
cother = other.copy()
|
|
393
|
+
else:
|
|
394
|
+
cother = other
|
|
392
395
|
res = super().__imul__(other)
|
|
393
396
|
context = (np.multiply, (cself, cother, cself), 0)
|
|
394
397
|
return self.__array_prepare__(res, context=context)
|
|
@@ -405,7 +408,10 @@ class Quantity(np.ndarray):
|
|
|
405
408
|
return super().__itruediv__(other)
|
|
406
409
|
else:
|
|
407
410
|
cself = self.copy()
|
|
408
|
-
|
|
411
|
+
if hasattr(other, "copy"):
|
|
412
|
+
cother = other.copy()
|
|
413
|
+
else:
|
|
414
|
+
cother = other
|
|
409
415
|
res = super().__itruediv__(other)
|
|
410
416
|
context = (np.true_divide, (cself, cother, cself), 0)
|
|
411
417
|
return self.__array_prepare__(res, context=context)
|
|
@@ -428,7 +434,10 @@ class Quantity(np.ndarray):
|
|
|
428
434
|
return super().__ipow__(other)
|
|
429
435
|
else:
|
|
430
436
|
cself = self.copy()
|
|
431
|
-
|
|
437
|
+
if hasattr(other, "copy"):
|
|
438
|
+
cother = other.copy()
|
|
439
|
+
else:
|
|
440
|
+
cother = other
|
|
432
441
|
res = super().__ipow__(other)
|
|
433
442
|
context = (np.power, (cself, cother, cself), 0)
|
|
434
443
|
return self.__array_prepare__(res, context=context)
|
|
@@ -735,7 +744,6 @@ class Quantity(np.ndarray):
|
|
|
735
744
|
|
|
736
745
|
@with_doc(np.nanmean)
|
|
737
746
|
def nanmean(self, axis=None, dtype=None, out=None):
|
|
738
|
-
import numpy as np
|
|
739
747
|
return Quantity(
|
|
740
748
|
np.nanmean(self.magnitude, axis, dtype, out),
|
|
741
749
|
self.dimensionality)
|
|
@@ -830,6 +838,11 @@ class Quantity(np.ndarray):
|
|
|
830
838
|
(self.__class__, np.ndarray, (0, ), 'b', ),
|
|
831
839
|
state)
|
|
832
840
|
|
|
841
|
+
def __deepcopy__(self, memo):
|
|
842
|
+
new_obj = super().__deepcopy__(memo).view(self.__class__)
|
|
843
|
+
new_obj.__dict__.update(self.__dict__)
|
|
844
|
+
memo[id(self)] = new_obj
|
|
845
|
+
return new_obj
|
|
833
846
|
|
|
834
847
|
def _reconstruct_quantity(subtype, baseclass, baseshape, basetype,):
|
|
835
848
|
"""Internal function that builds a new MaskedArray from the
|
|
@@ -377,6 +377,9 @@ class TestDTypes(TestCase):
|
|
|
377
377
|
distance *= time
|
|
378
378
|
self.assertQuantityEqual(distance, 6 * pq.m)
|
|
379
379
|
|
|
380
|
+
velocity *= 2
|
|
381
|
+
self.assertQuantityEqual(velocity, 6 * pq.m/pq.s)
|
|
382
|
+
|
|
380
383
|
def test_division(self):
|
|
381
384
|
molar = pq.UnitQuantity('M', 1000 * pq.mole/pq.m**3, u_symbol='M')
|
|
382
385
|
for subtr in [1, 1.0]:
|
|
@@ -396,6 +399,14 @@ class TestDTypes(TestCase):
|
|
|
396
399
|
a /= b
|
|
397
400
|
self.assertQuantityEqual(a, np.array([2.5, 2.5, 2.5]) * pq.s / pq.kg)
|
|
398
401
|
|
|
402
|
+
b /= 2
|
|
403
|
+
self.assertQuantityEqual(b, np.array([1, 2, 3]) * pq.kg)
|
|
404
|
+
|
|
405
|
+
c = np.array([5, 10, 15]) * pq.s
|
|
406
|
+
d = np.array([2, 4, 6])
|
|
407
|
+
c /= d
|
|
408
|
+
self.assertQuantityEqual(c, np.array([2.5, 2.5, 2.5]) * pq.s)
|
|
409
|
+
|
|
399
410
|
def test_powering(self):
|
|
400
411
|
# test raising a quantity to a power
|
|
401
412
|
self.assertQuantityEqual((5.5 * pq.cm)**5, (5.5**5) * (pq.cm**5))
|
|
@@ -79,6 +79,9 @@ class TestPersistence(TestCase):
|
|
|
79
79
|
y[0] = 100 * pq.m
|
|
80
80
|
self.assertQuantityEqual(x, [1, 2, 3] * pq.m)
|
|
81
81
|
|
|
82
|
+
# deepcopy of UnitLength
|
|
83
|
+
metre = copy.deepcopy(pq.m)
|
|
84
|
+
repr(metre) # accesses the "_definition" attribute
|
|
82
85
|
|
|
83
86
|
def test_copy_uncertainquantity(self):
|
|
84
87
|
for dtype in [float, object]:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|