-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Python 3.13 #338
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while here could we adopt the standard import numpy as np
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great point! actually i did ran a sonaqube code analysis scanning which also pointed that, we could have a discussion about those issues all together for improvement https://sonarcloud.io/project/issues?issueStatuses=OPEN%2CCONFIRMED&id=noman404_policyengine-core
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like there are several class methods do not have self also another standard practice
@@ -0,0 +1,6 @@ | |||
- bump: major |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this backwards-incompatible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python codeabase should be fine, cause there is no change related to python language specific code. However numpy is not compatible, there are several changes in data type like, float64, int64, inf, default type definition etc.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #338 +/- ##
==========================================
- Coverage 84.73% 84.15% -0.59%
==========================================
Files 191 194 +3
Lines 9773 9989 +216
Branches 1018 1046 +28
==========================================
+ Hits 8281 8406 +125
- Misses 1204 1290 +86
- Partials 288 293 +5 ☔ View full report in Codecov by Sentry. |
That did strike me as strange in that part of the codebase, but I believe that’s actually by design, the idea being to obscure that part of the codebase away while building variables and other objects that proliferate throughout the tax code.
… On Jan 31, 2025, at 12:54 AM, Al Noman ***@***.***> wrote:
@noman404 commented on this pull request.
On policyengine_core/taxscales/marginal_rate_tax_scale.py <#338 (comment)>:
like there are several class methods do not have self also another standard practice
—
Reply to this email directly, view it on GitHub <#338 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADSK7WZZQ4VKFNSB55ZL3632NK3TDAVCNFSM6AAAAABWDRRYYSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKOBVGM2TCMRRGQ>.
You are receiving this because you are subscribed to this thread.
|
@MaxGhenis we are stuck in a circular dependency scenario here, the test test_us on 3.13 will fail because current PE-US does not use 3.13 and PE-US also fail as current PE-Core not 3.13 |
@nikhilwoodruff @anth-volk @mikesmit any tips? |
# Conflicts: # .github/workflows/pr.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a few questions on this and would love @nikhilwoodruff's review
@@ -10,7 +10,7 @@ format: | |||
|
|||
install: | |||
pip install -e ".[dev]" --config-settings editable_mode=compat | |||
pip install policyengine-us | |||
pip install git+https://github.com/noman404/policyengine-us.git@noman404/python3.13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue, blocking: This ties us to an installation we do not want
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: @nikhilwoodruff How did we resolve the overlapping deps issue Al raised before? And is it still present?
if isinstance(this, tuple): | ||
raise TypeError("First argument must not be a tuple.") | ||
|
||
if isinstance(that, tuple): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, non-blocking: Can't we just check both of these args and have one message for both?
# because of the infinities the first sort creates positional indices | ||
# The second argsort converts these positions to ranks, thus fixes the broken sort issue | ||
first_argsort = numpy.argsort(matrix, axis=1, kind="stable") | ||
sorted_matrix = numpy.argsort(first_argsort, axis=1, kind="stable") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blocking: I'd love @nikhilwoodruff to confirm the logic here, as I'm less familiar with numpy
@@ -92,6 +92,11 @@ def concat(this: ArrayLike[str], that: ArrayLike[str]) -> ArrayType[str]: | |||
array(['this1.0', 'that2.5']...) | |||
|
|||
""" | |||
if isinstance(this, tuple): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Why can't these be tuples?
@@ -25,6 +25,7 @@ | |||
"pyvis>=0.3.2", | |||
"microdf_python>=0.4.3", | |||
"huggingface_hub>=0.25.1", | |||
"standard-imghdr", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Why do we need this package? I see no reference to it in the PR changes
@@ -66,12 +66,12 @@ def calc( | |||
# | |||
# numpy.finfo(float_).eps | |||
thresholds1 = numpy.outer( | |||
factor + numpy.finfo(numpy.float_).eps, | |||
factor + numpy.finfo(numpy.float64).eps, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documented at https://numpy.org/doc/2.1/numpy_2_0_migration_guide.html
@@ -114,5 +114,10 @@ class TypesZone(Enum): | |||
z1 = "Zone 1" | |||
z2 = "Zone 2" | |||
|
|||
zone = np.asarray([TypesZone.z1, TypesZone.z2, TypesZone.z2, TypesZone.z1]) | |||
zone = np.asarray( | |||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Why does this behavior change?
Fixes #334