Skip to content
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

Replace usages of math.exp2 on python older than 3.11 #145

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

ngoldbaum
Copy link
Collaborator

This makes test_sdist fail on a "full" test run: https://github.com/ngoldbaum/csp/actions/runs/8269123488/job/22623671505

I'm not sure offhand why test_math_unary_ops doesn't run in the regular tests.

@ngoldbaum ngoldbaum changed the title Replace usages of math.exp2 Replace usages of math.exp2 on python older than 3.11 Mar 13, 2024
Signed-off-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
@ngoldbaum
Copy link
Collaborator Author

I'm not sure offhand why test_math_unary_ops doesn't run in the regular tests.

It does run, but math.exp2 is fine on Python3.11 and newer, and we don't currently run tests against older pythons except on full runs. Slightly updated the PR to only use 2**x on pythons older than 3.11.

We can consider running tests against the oldest supported python version for PRs separately from this.

@ngoldbaum ngoldbaum merged commit 6cc87b5 into Point72:main Mar 13, 2024
16 checks passed
@@ -363,7 +364,10 @@ def comp(x: ts["T"]):
log2 = define_unary_op("log2", lambda x: math.log2(x))
log10 = define_unary_op("log10", lambda x: math.log10(x))
exp = define_unary_op("exp", lambda x: math.exp(x))
exp2 = define_unary_op("exp2", lambda x: math.exp2(x))
if sys.version_info < (3, 11):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need this version check? Just use 2**x

@timkpaine timkpaine added the type: bug Concrete, reproducible bugs label Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Concrete, reproducible bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants