-
Notifications
You must be signed in to change notification settings - Fork 157
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
Added cbrt() and exp2() functions in Math module #1594
Conversation
Can @Thirumalai-Shaktivel @Smit-create @certik check that why these integration tests are failing?
Expected Reason (according to me): In
I think, CPython does not support these functions? |
The error is:
So I assume CPython 3.10 does not implement If so, we need some way to only run these tests with CPython 3.11. |
Yes. It was implemented in Python 3.11. So, how can we support tests with CPython 3.11? I am not sure whether CPython 3.11 supports it or not. |
Well, we might need to add this as an option in cmake to only run this in Python 3.11. For now, you can create a dedicated tests for this, and do not register them with cpython, only llvm. That way it works with LPython, but we skip testing it with CPython. We test it manually with CPython 3.11. |
@certik As I was discussing with @Thirumalai-Shaktivel and what you suggested earlier, I implemented a new backend that support Python 3.11 and updated the settings of those integration tests with Python 3.11. New Backend name is |
Yeah, I'll need to update some tester files and CI to test this which I'll do after merging this PR. This looks good to me. I'll fix the tests once this is merged. Thanks @harshsingh-24 |
integration_tests/CMakeLists.txt
Outdated
@@ -330,7 +352,7 @@ RUN(NAME test_builtin_round LABELS cpython llvm c) | |||
RUN(NAME test_builtin_divmod LABELS cpython llvm c) | |||
RUN(NAME test_builtin_sum LABELS cpython llvm c) | |||
RUN(NAME test_math1 LABELS cpython llvm c) | |||
RUN(NAME test_math_02 LABELS cpython llvm) | |||
RUN(NAME test_math_02 LABELS cpython_3_11 llvm) |
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.
This will disable this for current Python, which I would not do.
Split just the functionality that needs Python 3_11 and perhaps put into one file.
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.
Yup, @harshsingh-24 create a separate file and add the cbrt and exp2 tests there and enable cpython_3_11 for it. Leave cpython for the rest of the tests.
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.
We will not add this new option cpython_3_11
for now, see: #1594 (comment)
There is something that worries me, can we have two versions of python in the conda environment? |
I see, we cannot have it: https://stackoverflow.com/a/67595797/15913193
@harshsingh-24 do one thing, we will split the |
I have done all the changes as asked @certik @Thirumalai-Shaktivel. Can you please review it? |
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.
LGTM, will need to squash and merge.
I will do a git squash. |
No worries, we can do that while merging. |
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.
LGTM as well! Thank you
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.
Other than my comment rest looks okay.
Math Module enhancement:
cbrt()
orcube root
function associated with Math module of LPython and it's associated integration testsexp2()
orexponential of 2
function associated with Math module of LPython and it's associated integration tests