summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into _decimal_decimalHernan Grecco2020-02-2131-510/+702
|\
| * Merge #1034bors[bot]2020-02-223-5/+13
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1034: fix for key error in numpy.pad r=hgrecco a=mark-boer - [x] Closes #1026 - [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: mark-boer <m.h.boer.2@gmail.com>
| | * fix for key error in numpy.padmark-boer2020-02-213-5/+13
| | |
| * | Back to development: 0.12Hernan2020-02-192-1/+7
| | |
| * | Preparing release 0.110.11Hernan2020-02-192-2/+2
| | |
| * | Include .coveragercHernan2020-02-191-1/+1
| | |
| * | Merge #1031bors[bot]2020-02-191-8/+8
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1031: Rename `ParsedDefinition` to `PreprocessedDefinition` r=hgrecco a=hgrecco Close #1010 - [x] Closes #1010 (insert issue number) - [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: Hernan <hernan.grecco@gmail.com>
| | * | Rename `ParsedDefinition` to `PreprocessedDefinition`Hernan2020-02-191-8/+8
| |/ / | | | | | | | | | Close #1010
| * | Merge #993bors[bot]2020-02-193-0/+96
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 993: WIP: compatibility checks r=hgrecco a=keewis Continuing from the issue, this is the code from #988. It is missing documentation and tests right now; I will add these later. Also, I am not sure where to put a potential top-level function. - [x] Closes #988 - [x] 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: Keewis <keewis@posteo.de>
| | * | add docstringsKeewis2020-01-173-0/+48
| | | |
| | * | import the code from the issueKeewis2020-01-173-0/+48
| | | |
| * | | Merge pull request #1020 from Jellby/scriptHernan Grecco2020-02-197-4/+227
| |\ \ \ | | | | | | | | | | Adding pint-convert script (see #1012)
| | * \ \ Merge branch 'master' into scriptHernan Grecco2020-02-1912-99/+87
| | |\ \ \ | | |/ / / | |/| | |
| * | | | Merge #1023bors[bot]2020-02-196-4/+67
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1023: Make `__str__` and `__format__` locale aware r=hgrecco a=hgrecco With this commit, all string formatting operations are locale aware >>> ureg.set_fmt_locale('fr_FR') >>> str(accel) '1.3 mètre par seconde²' >>> "%s" % accel '1.3 mètre par seconde²' >>> "{}".format(accel) '1.3 mètre par seconde²' It should not break any code as the default locale value for the Registry is `None` (meaning do not localize). Close #984 - [x] Closes #984 (insert issue number) - [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: Hernan <hernan.grecco@gmail.com> Co-authored-by: Hernan Grecco <hernan.grecco@gmail.com>
| | * \ \ \ Merge branch 'master' into developHernan Grecco2020-02-198-96/+21
| | |\ \ \ \ | | |/ / / / | |/| | | |
| * | | | | Merge #1029bors[bot]2020-02-186-94/+12
| |\ \ \ \ \ | | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1029: Remove array interface protocol fallback and NEP 18 warning r=hgrecco a=jthielen As mentioned in #1011, this PR removes the array interface protocol fallback that was deprecated in 0.10, as well as the NEP 18 warning on first array Quantity creation. - ~~Closes # (insert issue number)~~ - [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>
| | * | | | Remove array function warning on first creationJon Thielen2020-02-185-41/+6
| | | | | |
| | * | | | Remove the array interface protocol fallbackJon Thielen2020-02-185-53/+6
| |/ / / /
| * | | | Merge #1025bors[bot]2020-02-123-1/+7
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1025: Use setuptools_scm via pyproject.toml r=hgrecco a=KOLANICH - [x] Executed ``black -t py36 . && isort -rc .`` with no errors `flake8`: ``` ./pint/measurement.py:53:17: F999 '...'.format(...) has unused arguments at position(s): 0, 1 ./pint/testsuite/test_numpy.py:1051:21: F999 f-string is missing placeholders ``` But this PR doesn't touch this files. - [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: KOLANICH <kolan_n@mail.ru>
| | * | | | Use setuptools_scm via pyproject.tomlKOLANICH2020-02-123-1/+7
| |/ / / /
| | * | | Make `__str__` and `__format__` locale awareHernan2020-02-116-4/+66
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this commit, all string formatting operations are locale aware >>> ureg.set_fmt_locale('fr_FR') >>> str(accel) '1.3 mètre par seconde²' >>> "%s" % accel '1.3 mètre par seconde²' >>> "{}".format(accel) '1.3 mètre par seconde²' It should not break any code as the default locale value for the Registry is `None` (meaning do not localize). Close #984
| | * | Add pint-convert documentationJellby2020-02-104-3/+107
| | | |
| | * | Typo fixJellby2020-02-091-3/+4
| | | |
| | * | Adding pint-convert script (see #1012)Jellby2020-02-084-4/+121
| |/ /
| * | Merge #998bors[bot]2020-02-063-9/+151
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 998: Add parse_pattern function r=hgrecco a=abmyii - [X] Closes #997. - [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 - [?] Added an entry to the CHANGES file I don't like to open issues that I am able to implement myself, so I quickly made a POC implementation which seems to work quite well and is sufficient for my purposes. Parsing with regex isn't as clean as parsing with the `parse` (https://github.com/r1chardj0n3s/parse) library which I initially thought of using, but I decided that after such a long time of being fully independent of third-party libraries, you wouldn't want to begin now. Thus readability has been sacrificed at the cost of upholding the design principles. Personally I don't mind as long as the feature is usable. Thank you for this great module! Co-authored-by: Abdurrahmaan Iqbal <abdurrahmaaniqbal@hotmail.com>
| | * | Implement parse_pattern functionAbdurrahmaan Iqbal2020-02-063-9/+151
| | |/
| * | Merge #1015bors[bot]2020-02-052-4/+6
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1015: also treat NaN as a special value in pad r=hgrecco a=keewis In #994, the `np.pad` implementation was modified to fail on non-quantity `constant_values` / `end_values` arguments, with a special exception for `0`. Throughout the code base, we treat `np.nan` the same way we treat `0` so we should do that in `np.pad`, too. - [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors - [x] The change is fully covered by automated unit tests Should be ready for merging. Co-authored-by: Keewis <keewis@posteo.de>
| | * | test that passing a bare np.nan does not raiseKeewis2020-02-051-3/+5
| | | |
| | * | also allow nan as a special valueKeewis2020-02-051-1/+1
| | | |
| * | | Merge #1014bors[bot]2020-02-054-361/+12
| |\ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1014: Organizational changes r=hgrecco a=hgrecco - [x] Closes #985, #983 - [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors - [ ] ~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: Hernan <hernan.grecco@gmail.com>
| | * | Updated CHANGESHernan2020-02-051-0/+2
| | | |
| | * | Remove `default_en_0.6.txt`Hernan2020-02-041-360/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This file is no longer necessary and it can always be fetched from github if needed Closes #985
| | * | Reorganize long_descriptionHernan2020-02-042-1/+10
| |/ / | | | | | | | | | | | | | | | | | | Remove AUTHORS and CHANGES and replace them by a link to github to improve readability in PyPI Closes #983
| * | Merge #1005bors[bot]2020-02-042-10/+29
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1005: Update pandas support docs r=hgrecco a=keewis This updates the `pandas` support page to warn about the support being experimental and to help with the installation and fixes the references to `PintType` and `PintArray`. Also a few other minor documentation fixes. - [x] Closes #1001, closes #1003 - [x] 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 Edit: @hgrecco, could you reopen both of the linked issues so this can fix them? Co-authored-by: Keewis <keewis@posteo.de>
| | * | replace the note with a installation sectionKeewis2020-01-291-6/+10
| | | |
| | * | fix a reference in the numpy pageKeewis2020-01-291-1/+1
| | | |
| | * | style fixesKeewis2020-01-291-6/+6
| | | |
| | * | use pintpandas when accessing pandas functionalityKeewis2020-01-291-3/+3
| | | |
| | * | add install instructions and a warning about the status of pint-pandasKeewis2020-01-291-1/+16
| | | |
| * | | Merge #1013bors[bot]2020-02-041-1/+1
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1013: Change default datatype to np.ptype("int") in test_numpy r=hgrecco a=5igno The test function test_result_type_numpy_func checks the datatype for [[1, 2], [3, 4]] * self.ureg.m to be integer. The test originally ensured the datatype to be np.ptype("int64"), but that fails in 32 bit environments, as shown in issue #1006. Using np.ptype("int") instead ensure that the quantity is of default integer type, making numpy itself decide whether it should be np.ptype("int64") or np.ptype("int32"). - [x] Closes #1006 - [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 - [ ] Added an entry to the CHANGES file Co-authored-by: 5igno <signobox@gmail.com>
| | * | | Change default numpy datatype to np.ptype("int")5igno2020-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test function test_result_type_numpy_func checks the datatype for [[1, 2], [3, 4]] * self.ureg.m to be integer. The test originally ensured the datatype to be np.ptype("int64"), but that fails in 32 bit environments. Using np.ptype("int") instead ensure that the quantity is of default integer type, making numpy itself decide whether it should be np.ptype("int64") or np.ptype("int32"). - [x] Closes #1006 - [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~~ - [ ] Added an entry to the CHANGES file
| * | | | Merge #999bors[bot]2020-02-029-111/+237
| |\ \ \ \ | | |/ / / | | | / / | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 999: Preparing the codebase for a better Decimal support r=hgrecco a=hgrecco This is a series of three commits to prepare the codebase for a better Decimal support. These are mostly and internal clean up and should not affect any user. - [ ] ~~Closes # (insert issue number)~~ - [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors - [ ] ~~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: Hernan <hernan.grecco@gmail.com>
| * | | Merge #996bors[bot]2020-01-224-0/+9
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 996: Fix Bug Quantity to_compact r=hgrecco a=jules-ch - Handles unit in to_compact function. - Use same function infer_base_unit on Quantity based on input unit. - Add unit test in test_issues.py - [x] Closes #960 - [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors - [x] The change is fully covered by automated unit tests - [x] Added an entry to the CHANGES file Co-authored-by: Jules Chéron <jules.cheron@gmail.com>
| | * | | Fixed #960Jules Chéron2020-01-214-0/+9
| | | |/ | | |/| | | | | | | | | | | | | | | | | - Handles unit in to_compact. - Use same function infer_base_unit on Quantity based on input unit. - Add unit test in test_issues.py
| * | | Merge #994bors[bot]2020-01-222-6/+18
| |\ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 994: treat non-quantity parameters to np.pad like dimensionless r=hgrecco a=keewis - [x] Closes #992 - [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 - [ ] Added an entry to the CHANGES file Co-authored-by: Keewis <keewis@posteo.de>
| | * | remove the unneeded else:Keewis2020-01-201-7/+6
| | | |
| | * | change the implementation of `pad` to treat non-quantities as dimensionlessKeewis2020-01-202-5/+18
| |/ /
| * | Merge #989bors[bot]2020-01-164-4/+41
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 989: Allow constants in units by using leading underscore r=hgrecco a=jni See #507 for discussion. This change allows code like the following: ```python In [1]: from pint import UnitRegistry In [2]: u = UnitRegistry() In [3]: u.define('_100km = 100 * kilometer') In [4]: u.define('mpg = 1 * mile / gallon') In [5]: volt_petrol_ec = 5 * u.L / u._100km In [6]: (1 / volt_petrol_ec).to(u.mpg) Out[6]: 47.042916666666656 <Unit('mpg')> ``` - [x] Closes #507 - [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: Juan Nunez-Iglesias <juan.nunez-iglesias@monash.edu>
| | * | Ignore unassigned variables in flake8 in test suiteJuan Nunez-Iglesias2020-01-151-3/+3
| | | |
| | * | Add test for attribute _ and fix logic ;)Juan Nunez-Iglesias2020-01-152-4/+8
| | | |