-
-
Notifications
You must be signed in to change notification settings - Fork 8
Adds test suite and benchmarks #69
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
base: main
Are you sure you want to change the base?
Conversation
This commit resolves a build failure that occurred when building the package with pip/nox due to pip's use of isolated and changing build environments. Problem: - CMake was using find_library() to get the absolute path to libcasadi.dylib during configuration in one temporary pip build environment - By the time the actual build ran, pip had switched to a different temporary build environment, making the hard-coded library path invalid - This caused: "No rule to make target .../libcasadi.dylib" error Solution: - Link against CasADi by library name instead of absolute path, relying on target_link_directories() to provide the search path during build - Use relative RPATH (@loader_path on macOS, $ORIGIN on Linux) so the built module can find CasADi in the same Python environment at runtime - Set BUILD_RPATH for the build environment and INSTALL_RPATH for runtime - Remove duplicate casadi link (already added in USE_PYTHON_CASADI section)
…v backend preference
…ite, integration_tests.yml uses nox session, updates docs
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.
I know that this is still WIP but thanks for taking this up, there are lots of useful additions!
# Link against casadi by name, not absolute path, to avoid issues with | ||
# pip's isolated build environments changing paths between configure and build | ||
target_link_libraries(idaklu PRIVATE casadi) |
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.
All good catches here, thanks! and sorry for the trouble here, I realise I was responsible for all this 😄
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.
Thanks @BradyPlanden :) The benchmarks and nox env look really useful. I'm not sure on the tests though. Most of them are very superficial (checking if function exists, is callable), many look like they can't possibly fail, some are repeats of other tests, and the vector tests are testing code that isn't in pybammsolvers, this is just pybind11 code. I would prefer fewer tests that actually test the internals of the C++ code that we wrote.
Yes, I fully agree. The main goal of this PR was to set up the testing suite; as such, I let Cursor throw together the unit tests. I'll open an additional PR to remove these low-quality tests and add a few useful ones. Suggestions welcome, or feel free to open a PR with pybammsolver-specific tests! |
286c6a9
to
184383c
Compare
I previously discussed this with @MarcBerliner, and we think it would be nice to have a two-way testing structure with nightlies, quoting it below:
|
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.
ok, happy to approve given the tests are being replaced later
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
056c6ca
to
a204965
Compare
I'm hitting an issue specific to intel-based MacOS runners. I've tried changing the rhs definition syntax and upgrading Casadi to 3.7.2, but neither worked. Cursor suggests it's a Casadi bug—we don't see this on pybamm-tests. We can skip these tests for macOS-intel, but fix suggestions are welcome! @agriyakhetarpal @martinjrobins @Saransh-cpp @MarcBerliner |
Hi @BradyPlanden, I am unable to see the logs for some reason (GitHub is unable to load them, nor do the raw logs work), so I've retriggered the workflow run. Let's see how it goes! |
I'm pretty sure this is an upstream issue. I'm okay with skipping the affected tests on |
This PR adds the following: