summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | Check for attributes containing only '_'Juan Nunez-Iglesias2020-01-151-2/+2
| | | |
| | * | Fix incorrect use of u instead of ureg in testsJuan Nunez-Iglesias2020-01-151-4/+4
| | | |
| | * | Add entry to CHANGES fileJuan Nunez-Iglesias2020-01-151-0/+2
| | | |
| | * | Add example to documentationJuan Nunez-Iglesias2020-01-151-0/+14
| | | |
| | * | Format strings according to blackJuan Nunez-Iglesias2020-01-152-3/+4
| | | |
| | * | Add test for no attribute error in _100kmJuan Nunez-Iglesias2020-01-151-0/+8
| | | |
| | * | Update docstring for getattr_maybe_raiseJuan Nunez-Iglesias2020-01-151-3/+7
| | | |
| | * | Don't raise error if key starts with _[digit]Juan Nunez-Iglesias2020-01-151-1/+5
| |/ /
| * | Merge #987bors[bot]2020-01-151-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 fixWill Stott2020-01-141-1/+1
| |/ /
| * | Merge #986bors[bot]2020-01-142-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 ParserHelperHernan2020-01-221-9/+5
| | | |
* | | | Removed passing registry to to_units_container in Systems.from_linesHernan2020-01-221-3/+1
| | | |
* | | | Add support for other numerical types at the registry levelHernan2020-01-229-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 importHernan2020-01-211-1/+0
| | |
* | | Updated CHANGESHernan2020-01-211-0/+7
| | |
* | | Moved pi from _after_init to the constants fileHernan2020-01-213-4/+1
| | | | | | | | | | | | In this way, an empty registry will be really empty.
* | | Replace 1.0 and 0.0 (floats) by 1 and 0 (integers)Hernan2020-01-215-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.Hernan2020-01-182-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 coverageHernan2020-01-132-1/+4
|/
* Merge #979bors[bot]2020-01-095-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 intersect1dJon Thielen2020-01-085-6/+27
|/
* Make version.py black and flake8 friendlyHernan2020-01-081-0/+3
|
* Back to development: 0.11Hernan2020-01-072-1/+7
|
* Preparing release 0.10.10.10.1Hernan2020-01-072-3/+3
|
* Updated MANIFEST.inHernan2020-01-071-1/+1
|
* Revert version change to CHANGES. zest.releaser takes care of thatHernan2020-01-071-1/+1
|
* Merge #977bors[bot]2020-01-084-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 bugfixJon Thielen2020-01-071-1/+4
| |
| * Rename sequence-of-quantities helper, with tests for size zero Quantity ↵Jon Thielen2020-01-073-14/+30
|/ | | | creation from ndarray by multiplication
* Merge #975bors[bot]2020-01-083-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 May2020-01-073-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 #970bors[bot]2020-01-0613-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 fixGuido Imperiale2020-01-061-1/+1
| |
| * Align travis to RTDGuido Imperiale2020-01-061-1/+2
| |
| * RTD fixesGuido Imperiale2020-01-061-2/+1
| |
| * RTD fixesGuido Imperiale2020-01-062-14/+3
| |
| * RTD fixesGuido Imperiale2020-01-061-1/+5
| |
| * CI integration bugfixesGuido Imperiale2020-01-064-8/+12
| |
| * CI integrationGuido Imperiale2020-01-064-4/+25
| |
| * Sphinx fixesGuido Imperiale2020-01-069-126/+119
|/
* Fixed zest releaser string conventionHernan2020-01-051-1/+1
|
* Back to development: 0.11Hernan2020-01-052-1/+7
|
* Preparing release 0.100.10Hernan2020-01-052-2/+2
|
* Add version.py to make zest.releaser work with setuptools_scmHernan2020-01-053-2/+8
|
* Updated .gitignoreHernan2020-01-051-0/+1
|
* Release related fixesHernan2020-01-053-2/+12
|
* Merge #969bors[bot]2020-01-065-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.rstHernan2020-01-052-93/+1
| |
| * Updated README and index.rstHernan2020-01-052-21/+44
| |