summaryrefslogtreecommitdiff
path: root/pint/facets
Commit message (Collapse)AuthorAgeFilesLines
* Python's 3.9 compatible typing annotationsHernan Grecco2023-05-1415-94/+118
|
* Better SharedRegistryObjects creationHernan Grecco2023-05-111-5/+5
|
* Fix imports for Python 3.9Hernan Grecco2023-05-111-4/+5
|
* More typing improvementsHernan Grecco2023-05-111-5/+5
|
* Typing related fixesHernan Grecco2023-05-097-18/+19
|
* Remove deprecated usage in docs and fix introduced bug during refactoring.Hernan Grecco2023-05-051-2/+1
|
* Remove conversion to string in DimensionalityErrorHernan Grecco2023-05-051-1/+1
|
* Fixed Subscripted generics cannot be used with class and instance checksHernan Grecco2023-05-051-1/+1
|
* Large commit to make Pint more typing friendlyHernan Grecco2023-05-0531-734/+1193
| | | | | | | | | | | | | | | | | | | | | In this very large commit we tackle a few aspects of Pint that makes it difficult to do static typing. 1. Dynamic classes became static: Quantity and Unit are now (for the most part) static classes with a static inheritance. This allows mypy/pylance and other type checker to properly inspect them. 2. Added types through out all the code. (WIP) 3. Refactor minor parts of the code to make it more typing homogeneous. Catch a few potential bugs in the way. 4. Add several TODOs that need to be addressed in 0.23 5. Moved some group and system and context code out of the PlainRegistry 6. Moved certain specialized methods out of the PlainRegistry.
* Run pyupgrade --py39-plusHernan Grecco2023-05-016-6/+9
|
* Typing improvementsHernan Grecco2023-05-0111-101/+131
| | | | | | | | | | | While there is still a lot of work to do (mainly in Registry, Quantity, Unit), this large PR makes several changes all around the code. There has not been any intended functional change, but certain typing improvements required code minor code refactoring to streamline input and output types of functions. An important experimental idea is the PintScalar and PintArray protocols, and Magnitude type. This is to overcome the lack of a proper numerical hierarchy in Python.
* Reworked the Quantity, Unit, Measurement, Group and System class to be ↵Hernan Grecco2023-04-3015-61/+48
| | | | static to ease with typing
* Run pyupgrade --py39-plus in all files except _vendor (again)Hernan Grecco2023-04-292-2/+2
|
* Run refurb --python-version 3.9 in codeHernan Grecco2023-04-299-73/+73
|
* Run pyupgrade --py39-plus in all files except _vendorHernan Grecco2023-04-2916-147/+121
|
* Remove deprecated use_decimalHernan Grecco2023-04-291-28/+2
|
* Merge pull request #1594 from dopplershift/fix-trapz-tempHernan Grecco2023-04-291-3/+56
|\ | | | | Properly handle offset units for trapz
| * Fix up dot/cross wrapper for non-multiplicative unitsRyan May2023-04-271-2/+25
| |
| * Properly handle offset units for trapz (Fixes #1593)Ryan May2023-04-271-2/+32
| |
* | Merge pull request #1608 from dopplershift/fix-1584Hernan Grecco2023-04-291-1/+6
|\ \ | | | | | | Fix setitem with a masked array with multiple items (Fixes #1584)
| * \ Merge branch 'master' into fix-1584Ryan May2022-11-2819-796/+671
| |\ \
| * | | Fix setitem with a masked array with multiple items (Fixes #1584)Ryan May2022-10-141-1/+6
| | | | | | | | | | | | | | | | This was incorrectly passing through some non-masked values.
* | | | Honor non_int_type when dividing (fix bug).Hernan Grecco2023-04-281-2/+2
| | | |
* | | | Honor non_int_type when dividing.Hernan Grecco2023-04-282-3/+13
| |_|/ |/| |
* | | Honor non_int_type when a unit without a magnitude is given as string.Hernan Grecco2023-04-271-3/+3
| | | | | | | | | | | | Close #1505
* | | Fix get_compatible_units for dynamically add units/dimensionsHernan Grecco2023-04-261-1/+1
| | | | | | | | | | | | Close #1725
* | | Fixed pr/1574 conflictsHernan Grecco2023-04-252-0/+232
|\ \ \
| * | | Silence verbose mip outputblewis22022-09-231-0/+1
| | | |
| * | | Fix pre-commit problemsblewis22022-08-301-53/+72
| | | |
| * | | Add to_preferredblewis22022-08-302-0/+213
| | | |
* | | | Merge branch 'master' into masterHernan Grecco2023-04-2519-56/+28
|\ \ \ \
| * \ \ \ Merge branch 'master' into patch-type-importsHernan Grecco2023-04-2417-46/+16
| |\ \ \ \
| | * | | | Run pre-commit run --all-files . Mostly removed empty linesHernan2023-04-2416-24/+0
| | | | | |
| | * | | | Merge branch 'master' into fix-1658Hernan Grecco2023-04-243-20/+17
| | |\ \ \ \
| | | * \ \ \ Merge pull request #1741 from keewis/fix-full_likeHernan Grecco2023-04-241-9/+3
| | | |\ \ \ \ | | | | | | | | | | | | | | | | use `**kwargs` to pass along additional arguments to `ones_like`
| | | | * | | | use **kwargs to pass along additional arguments to `ones_like`Justus Magin2023-04-141-9/+3
| | | | | | | |
| | | * | | | | Merge pull request #1703 from RemDelaporteMathurin/expose_matplotlib_formatterHernan Grecco2023-04-241-0/+4
| | | |\ \ \ \ \ | | | | |/ / / / | | | |/| | | | Expose matplotlib formatter
| | | | * | | | Added mpl_formatter attribute to PlainRegistryRemDelaporteMathurin2023-01-201-0/+4
| | | | | | | |
| | | * | | | | Support numpy delete (#1699)Dennis Göries2023-03-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support numpy delete --------- Co-authored-by: Jules Chéron <43635101+jules-ch@users.noreply.github.com>
| | | * | | | | Merge pull request #1722 from dopplershift/fix-daskJules Chéron2023-03-221-11/+3
| | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | Fix __dask_postcompute__() to better preserve type
| | | | * | | | | Fix __dask_postcompute__() to better preserve typeRyan May2023-03-081-11/+3
| | | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Unidata/MetPy#2945, a call to dask's .compute() was causing the resulting type to be a different Quantity() variant (from pint.util rather than the parent registry), which resulted in isinstance() failing. This changes things to use the appropriate type from `self` rather than hard-coded class names.
| | | * | | | | add a override for `round`Justus Magin2023-03-071-0/+1
| | | | | | | |
| | | * | | | | add `min` and `max` to the array function overridesJustus Magin2023-03-071-0/+2
| | | |/ / / /
| | * | | | | Fix unit check with `atol` using np.allclose.Jules Chéron2022-11-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #1658
| * | | | | | appease lintersAustin Orr2022-12-202-2/+5
| | | | | | |
| * | | | | | patch imports during type checkAustin Orr2022-12-206-11/+10
| | |/ / / / | |/| | | |
* | | | | | Remove deprecated `alen` function from numpy_funcTy Balduf2022-12-131-1/+0
|/ / / / /
* | | | | Merge branch 'master' into fix1277Jules Chéron2022-11-281-0/+1
|\ \ \ \ \ | | |_|_|/ | |/| | |
| * | | | Add positive ufunc (#1663)andrewgsavage2022-11-281-0/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for numpy positive ufunc - Update CHANGES - Add test for `positive` Co-authored-by: Jules Chéron <43635101+jules-ch@users.noreply.github.com>
* | | | Add default preprocessor to support % symbolCarlos Pascual2022-11-231-0/+2
|/ / / | | | | | | | | | | | | Add a preprocessor to replace "%" by " percent " in order to avoid eval interpreting `%` as an operator.