Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
| | * | | Check for attributes containing only '_' | Juan Nunez-Iglesias | 2020-01-15 | 1 | -2/+2 | |
| | | | | ||||||
| | * | | Fix incorrect use of u instead of ureg in tests | Juan Nunez-Iglesias | 2020-01-15 | 1 | -4/+4 | |
| | | | | ||||||
| | * | | Add entry to CHANGES file | Juan Nunez-Iglesias | 2020-01-15 | 1 | -0/+2 | |
| | | | | ||||||
| | * | | Add example to documentation | Juan Nunez-Iglesias | 2020-01-15 | 1 | -0/+14 | |
| | | | | ||||||
| | * | | Format strings according to black | Juan Nunez-Iglesias | 2020-01-15 | 2 | -3/+4 | |
| | | | | ||||||
| | * | | Add test for no attribute error in _100km | Juan Nunez-Iglesias | 2020-01-15 | 1 | -0/+8 | |
| | | | | ||||||
| | * | | Update docstring for getattr_maybe_raise | Juan Nunez-Iglesias | 2020-01-15 | 1 | -3/+7 | |
| | | | | ||||||
| | * | | Don't raise error if key starts with _[digit] | Juan Nunez-Iglesias | 2020-01-15 | 1 | -1/+5 | |
| |/ / | ||||||
| * | | Merge #987 | bors[bot] | 2020-01-15 | 1 | -1/+1 | |
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 987: minor typo fix r=hgrecco a=willstott101 This is probably a pointlessly small change, but I noticed this typo whilst looking at the definitions. Co-authored-by: Will Stott <willstott101@gmail.com> | |||||
| | * | | minor typo fix | Will Stott | 2020-01-14 | 1 | -1/+1 | |
| |/ / | ||||||
| * | | Merge #986 | bors[bot] | 2020-01-14 | 2 | -1/+4 | |
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 986: Changed pytest arguments to ignores testsuite in coverage r=hgrecco a=hgrecco - [ ] ~Closes # (insert issue number)~ - [ ] ~Executed ``black -t py36 . && isort -rc . && flake8`` with no errors~ - [ ] ~The change is fully covered by automated unit tests~ - [ ] ~Documented in docs/ as appropriate~ - [ ] ~Added an entry to the CHANGES file~ Co-authored-by: Hernan <hernan.grecco@gmail.com> | |||||
* | | | | Adjusted tests to new int default for UnitsContainer and ParserHelper | Hernan | 2020-01-22 | 1 | -9/+5 | |
| | | | | ||||||
* | | | | Removed passing registry to to_units_container in Systems.from_lines | Hernan | 2020-01-22 | 1 | -3/+1 | |
| | | | | ||||||
* | | | | Add support for other numerical types at the registry level | Hernan | 2020-01-22 | 9 | -98/+1284 | |
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until this commit, `int` and `float` were special types in Pint (just as they are in Python). Numbers were parsed from strings as int/float from the definition files and from user provided strings; and exponents of units were also stored as int/float. This commit change this by adding a new argument (`non_int_type`) to classes and methods. It indicates how numeric values will be parsed and defaulted. Any numerical class can be used such as `float` (default), Decimal, Fraction. This argument will be found in the following places 1. UnitRegistry: used for parsing the definition files and any value provided as a string. 2. UnitsContainer: used to compare equality with strings, multiply and divide by strings (which is equivalent to parse the string) 3. All methods OUTSIDE the UnitRegistry/Quantity that can parse strings have a `non_int_type` argument. (e.g. Definition.from_string) Tests have been added for by duplicating most cases in `test_quantity.py`. (Some tests have been deleted such as those dealing with numpy.) The new file `test_non_int.py` run the tests for `Decimal`, `Fraction` and `float` (which is redundant but is kept as a crosscheck for the implementation of this testsuite) BREAKING CHANGE: `use_decimal` is deprecated. Use `non_int_type` keyword argument when instantiating the registry. >>> from decimal import Decimal >>> ureg = UnitRegistry(non_int_type=Decimal) | |||||
* | | | Removed unused import | Hernan | 2020-01-21 | 1 | -1/+0 | |
| | | | ||||||
* | | | Updated CHANGES | Hernan | 2020-01-21 | 1 | -0/+7 | |
| | | | ||||||
* | | | Moved pi from _after_init to the constants file | Hernan | 2020-01-21 | 3 | -4/+1 | |
| | | | | | | | | | | | | In this way, an empty registry will be really empty. | |||||
* | | | Replace 1.0 and 0.0 (floats) by 1 and 0 (integers) | Hernan | 2020-01-21 | 5 | -17/+17 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the original codebase, many accumulators, default values and so on were initialized with floats (instead fo integers). The reason behind this decision was that in Python 2 the division (/) was by default an integer division if all values were ints. Therefore, using a float ensured "the right result". Now that the codebase is Python 3, we can safely use integers everywhere. This wil be helpful when a different non integer type is desired. | |||||
* | | | Add `from_string` to all Definition subclasses. | Hernan | 2020-01-18 | 2 | -90/+213 | |
| |/ |/| | | | | | | | | | | | | | | | Until this commit, parsing a definition was done by partly `Definition.from_string` which then called the constructor of each Definition subclass. At the constructor level, each the string parsing continued. Now, each Definition subclass has a `from_string` method that handles all the parsing steps and the constructor should only be used with the parsed parts. | |||||
* | | Changed pytest arguments to ignores testsuite in coverage | Hernan | 2020-01-13 | 2 | -1/+4 | |
|/ | ||||||
* | Merge #979 | bors[bot] | 2020-01-09 | 5 | -6/+27 | |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 979: Add implementations and tests for allclose and intersect1d r=hgrecco a=jthielen Adds two recently requested NumPy function implementations (`allclose` from #978 and `intersect1d` from #976). In case it is useful, below is a quick check of what NumPy functions in the main module Pint *does not* implement yet (as of this PR): ```python import numpy as np from pint.numpy_func import HANDLED_FUNCTIONS print(sorted(set(attr for attr in dir(np) if hasattr(getattr(np, attr), '_implementation')) - set(HANDLED_FUNCTIONS))) ``` ``` ['alltrue', 'angle', 'apply_along_axis', 'apply_over_axes', 'argpartition', 'argwhere', 'array2string', 'array_equal', 'array_equiv', 'array_repr', 'array_split', 'array_str', 'asfarray', 'asscalar', 'bincount', 'broadcast_arrays', 'busday_count', 'busday_offset', 'can_cast', 'choose', 'common_type', 'convolve', 'corrcoef', 'correlate', 'cov', 'datetime_as_string', 'delete', 'diag', 'diag_indices_from', 'diagflat', 'digitize', 'dsplit', 'einsum_path', 'extract', 'fill_diagonal', 'flatnonzero', 'fliplr', 'flipud', 'fv', 'geomspace', 'histogram', 'histogram2d', 'histogram_bin_edges', 'histogramdd', 'hsplit', 'i0', 'imag', 'in1d', 'inner', 'ipmt', 'irr', 'is_busday', 'iscomplexobj', 'isneginf', 'isposinf', 'isrealobj', 'ix_', 'kron', 'lexsort', 'logspace', 'max', 'may_share_memory', 'min', 'min_scalar_type', 'mirr', 'msort', 'nanprod', 'nanquantile', 'nper', 'npv', 'outer', 'packbits', 'partition', 'piecewise', 'place', 'pmt', 'poly', 'polyadd', 'polyder', 'polydiv', 'polyfit', 'polyint', 'polymul', 'polysub', 'polyval', 'ppmt', 'prod', 'product', 'put', 'put_along_axis', 'putmask', 'pv', 'quantile', 'rank', 'rate', 'ravel_multi_index', 'real', 'real_if_close', 'repeat', 'roll', 'roots', 'round', 'row_stack', 'save', 'savetxt', 'savez', 'savez_compressed', 'select', 'setdiff1d', 'setxor1d', 'shares_memory', 'sinc', 'sometrue', 'sort_complex', 'split', 'take', 'take_along_axis', 'tensordot', 'trace', 'tril', 'tril_indices_from', 'triu', 'triu_indices_from', 'union1d', 'unique', 'unpackbits', 'unravel_index', 'vander', 'vdot', 'vsplit'] ``` - [x] Closes #976; Closes #978 - [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors - [x] The change is fully covered by automated unit tests - [x] Documented in docs/ as appropriate - [x] Added an entry to the CHANGES file Co-authored-by: Jon Thielen <github@jont.cc> | |||||
| * | Add implementations and tests for allclose and intersect1d | Jon Thielen | 2020-01-08 | 5 | -6/+27 | |
|/ | ||||||
* | Make version.py black and flake8 friendly | Hernan | 2020-01-08 | 1 | -0/+3 | |
| | ||||||
* | Back to development: 0.11 | Hernan | 2020-01-07 | 2 | -1/+7 | |
| | ||||||
* | Preparing release 0.10.10.10.1 | Hernan | 2020-01-07 | 2 | -3/+3 | |
| | ||||||
* | Updated MANIFEST.in | Hernan | 2020-01-07 | 1 | -1/+1 | |
| | ||||||
* | Revert version change to CHANGES. zest.releaser takes care of that | Hernan | 2020-01-07 | 1 | -1/+1 | |
| | ||||||
* | Merge #977 | bors[bot] | 2020-01-08 | 4 | -15/+34 | |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 977: Rename sequence-of-quantities helper, with tests for bug in issue 973 r=hgrecco a=jthielen Implements the changes discussed in #973. Also, @hgrecco, since you had mentioned in #973 wanting this solved ASAP, I took the liberty of changing the unreleased version header in the changelog to 0.10.1 (as a patch release). Hopefully that was okay! If you'd like me to undo that though, just let me know. - [x] Closes #973 - [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors - [x] The change is fully covered by automated unit tests - ~~Documented in docs/ as appropriate~~ - [x] Added an entry to the CHANGES file Co-authored-by: Jon Thielen <github@jont.cc> | |||||
| * | Update CHANGES for bugfix | Jon Thielen | 2020-01-07 | 1 | -1/+4 | |
| | | ||||||
| * | Rename sequence-of-quantities helper, with tests for size zero Quantity ↵ | Jon Thielen | 2020-01-07 | 3 | -14/+30 | |
|/ | | | | creation from ndarray by multiplication | |||||
* | Merge #975 | bors[bot] | 2020-01-08 | 3 | -1/+8 | |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 975: Fix __array__ signature r=hgrecco a=dopplershift According to [numpy docs](https://docs.scipy.org/doc/numpy/reference/arrays.classes.html#numpy.class.__array__), `__array__` can optionally be given a dtype. This fixes the signature to not error when we get one, but doesn't do anything with it--everything seems to work fine with that. - [X] Closes #974 - [X] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors - [X] The change is fully covered by automated unit tests - [X] Documented in docs/ as appropriate - [X] Added an entry to the CHANGES file Co-authored-by: Ryan May <rmay@ucar.edu> | |||||
| * | Fix __array__ signature (Fixes #974) | Ryan May | 2020-01-07 | 3 | -1/+8 | |
|/ | | | | | According to numpy docs, __array__ can optionally be given a dtype. We do don't do anything with it, but everything seems to work regardless. | |||||
* | Merge #970 | bors[bot] | 2020-01-06 | 13 | -133/+144 | |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 970: Sphinx and readthedocs fixes r=hgrecco a=crusaderky - [x] Closes #881 - [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors - [x] The change is fully covered by automated unit tests - [ ] ~~Documented in docs/ as appropriate~~ - [x] Added an entry to the CHANGES file - Added travis tests to verify that sphinx can run. Note that most sphinx warnings will result in a green light anyway. - Fixed a wealth of Sphinx errors and warnings. I could not fix all - notably there's a bunch of ``class reference target not found`` errors that I don't think are fixable with napoleon unless we moved to Python 3 typing annotations - which is a worthy thing to do, but which would also require much, much longer to implement than this PR. - fixed readthedocs CI Co-authored-by: Guido Imperiale <crusaderky@gmail.com> | |||||
| * | travis fix | Guido Imperiale | 2020-01-06 | 1 | -1/+1 | |
| | | ||||||
| * | Align travis to RTD | Guido Imperiale | 2020-01-06 | 1 | -1/+2 | |
| | | ||||||
| * | RTD fixes | Guido Imperiale | 2020-01-06 | 1 | -2/+1 | |
| | | ||||||
| * | RTD fixes | Guido Imperiale | 2020-01-06 | 2 | -14/+3 | |
| | | ||||||
| * | RTD fixes | Guido Imperiale | 2020-01-06 | 1 | -1/+5 | |
| | | ||||||
| * | CI integration bugfixes | Guido Imperiale | 2020-01-06 | 4 | -8/+12 | |
| | | ||||||
| * | CI integration | Guido Imperiale | 2020-01-06 | 4 | -4/+25 | |
| | | ||||||
| * | Sphinx fixes | Guido Imperiale | 2020-01-06 | 9 | -126/+119 | |
|/ | ||||||
* | Fixed zest releaser string convention | Hernan | 2020-01-05 | 1 | -1/+1 | |
| | ||||||
* | Back to development: 0.11 | Hernan | 2020-01-05 | 2 | -1/+7 | |
| | ||||||
* | Preparing release 0.100.10 | Hernan | 2020-01-05 | 2 | -2/+2 | |
| | ||||||
* | Add version.py to make zest.releaser work with setuptools_scm | Hernan | 2020-01-05 | 3 | -2/+8 | |
| | ||||||
* | Updated .gitignore | Hernan | 2020-01-05 | 1 | -0/+1 | |
| | ||||||
* | Release related fixes | Hernan | 2020-01-05 | 3 | -2/+12 | |
| | ||||||
* | Merge #969 | bors[bot] | 2020-01-06 | 5 | -151/+93 | |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | 969: Final commits before 0.10 r=hgrecco a=hgrecco - [ ] ~Closes # (insert issue number)~ - [ ] ~Executed ``black -t py36 . && isort -rc . && flake8`` with no errors~ - [ ] ~The change is fully covered by automated unit tests~ - [ ] ~Documented in docs/ as appropriate~ - [ ] ~Added an entry to the CHANGES file~ Co-authored-by: Hernan <hernan.grecco@gmail.com> | |||||
| * | Removed README to avoid having to keep it in sync with README.rst | Hernan | 2020-01-05 | 2 | -93/+1 | |
| | | ||||||
| * | Updated README and index.rst | Hernan | 2020-01-05 | 2 | -21/+44 | |
| | |