Replies: 10 comments 12 replies
-
Adding typing for the unit to quantity looks like it would be a big
improvement. Astropy have got it working!
There's an array-api implementation, which I am not quite sure where it may
be helpful! It allows some scipy functions that don't use or return scalars
to work. May be helpful for dask or cupy.
…On Fri, 14 Feb 2025, 02:50 Hernan Grecco, ***@***.***> wrote:
During January I was playing with a few ideas for next Pint version (which
will come in April 2025)
As per NEP29, it will support Python 3.11+ and NumPy 1.23+. I would like
to have:
*Py3.11*: Drop support for Python 3.10.
*Better packaging/tooling/etc*: For this I propose moving to pixi/uv/ruff
as we did with https://github.com/maurosilber/poincare It works like a
charm, makes testing easier and ci faster.
*TOML*: Move the definition file from the custom format to TOML (I was
really happy to see #2127
<#2127> 🎉 )
*Composition*: The delegates and facets refactoring was the first step in
this direction. I think we can do the same thing with some other parts
making Pint easier to understand and test. And flattening the Hierarchy.
*Generics*: Something that I tried is to rework how generics are used
within Pint. The thing that worked best is to have a single generic for the
non_int_type, that is used both in the magnitude and unit exponent. Not
sure if this is the best idea.
Any other suggestions?
—
Reply to this email directly, view it on GitHub
<#2131>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADEMLEBKG3R4VEK5JTEEVXL2PVKXNAVCNFSM6AAAAABXDUG2CCVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXHE3DGNJXGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I have make a "large" PR in #2132 While I use pixi (https://pixi.sh) because is awesome, the pip or uv workflow to install, test and use should work fine. I would like to merge it ASAP to master to avoid breaking other future PRs. |
Beta Was this translation helpful? Give feedback.
-
I did a working example of a toml branch back in the day here: https://github.com/jules-ch/pint/blob/unit_toml_definitions/pint/unit.toml Need to get back to it at some point haha. I'll look into the PR |
Beta Was this translation helpful? Give feedback.
-
Astropy is using this https://github.com/astropy/astropy/blob/b817ec3f90463b4dba3ae94372792445fd4cc235/astropy/units/quantity.py#L337 to create annotated types, seems like a good idea taht we can borrow from them. That's what you're talking about @andrewgsavage ? |
Beta Was this translation helpful? Give feedback.
-
I feel like the facets as Mixins is adding quite a lot of complexity sometimes, especially when trying to typing stuff. |
Beta Was this translation helpful? Give feedback.
-
Everything seems to be working now. If I see no showstoppers, I will merge to master in a few hours and then start merging some minor commits that I already have to improve some tests and some typing issues before a large refactoring. |
Beta Was this translation helpful? Give feedback.
-
Just created a PR #2135 to fix small annoyances over many tests and be more stringent regarding some warnings/xfail. |
Beta Was this translation helpful? Give feedback.
-
Just created a PR #2136 to improve the code quality of pint-convert |
Beta Was this translation helpful? Give feedback.
-
After #2135 and #2136 are merged:
|
Beta Was this translation helpful? Give feedback.
-
Proposal for generics: something that is quite unique about Python is that we allow users to choose the Questions:
|
Beta Was this translation helpful? Give feedback.
-
During January I was playing with a few ideas for next Pint version (which will come in April 2025)
As per NEP29, it will support Python 3.11+ and NumPy 1.23+. I would like to have:
Py3.11: Drop support for Python 3.10.
Better packaging/tooling/etc: For this I propose moving to pixi/uv/ruff as we did with https://github.com/maurosilber/poincare It works like a charm, makes testing easier and ci faster.
TOML: Move the definition file from the custom format to TOML (I was really happy to see #2127 🎉 )
Composition: The delegates and facets refactoring was the first step in this direction. I think we can do the same thing with some other parts making Pint easier to understand and test. And flattening the Hierarchy.
Generics: Something that I tried is to rework how generics are used within Pint. The thing that worked best is to have a single generic for the non_int_type, that is used both in the magnitude and unit exponent. Not sure if this is the best idea.
Any other suggestions?
Beta Was this translation helpful? Give feedback.
All reactions