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

import name 'trapz' from 'scipy.integrate' #657

Closed
Norah135 opened this issue Jul 16, 2024 · 10 comments
Closed

import name 'trapz' from 'scipy.integrate' #657

Norah135 opened this issue Jul 16, 2024 · 10 comments

Comments

@Norah135
Copy link

Norah135 commented Jul 16, 2024

I am having an issue deploying the test case in Docker using TESTCASE=test_case docker-compose up. Here is an image that describes the problem(cannot import name 'trapz' from 'scipy.integrate').

Screenshot 2024-07-16 at 9 54 24 AM Do you have any suggestions on how I can fix it?"
@dhblum
Copy link
Collaborator

dhblum commented Jul 16, 2024

Hey @Norah135, I just ran $ TESTCASE=bestest_air docker-compose up using the master branch and on Ubuntu 18 running Docker version 24.0.2 and it built and deployed ok. Can you be more specific about the version of BOPTEST, Docker, and platform/OS you are deploying on, and whether you made any changes to the Dockerfile or otherwise? The version of scipy used within the test case container should be consistent across image builds.

@Norah135
Copy link
Author

Norah135 commented Jul 16, 2024

@dhblum I really appreciate your quick response. I tried using both an Apple and a Windows device running Docker version 26.1.4, but I'm facing the same issues on both. I downloaded the latest version (6) of BOPTEST from the website and haven't made any changes to the Docker file.

@Norah135
Copy link
Author

@dhblum I wanted to ask if you can help me use the BOPTEST API without running it on Docker. I'm facing issues with Docker. I found an example on Colab, but I'm a little confused about how to connect this example with a simple control algorithm to understand how the system works. I am looking for examples similar to what we have in the GitHub repository (the test case and the interface file). Sorry to bother you, but I am new to this field and using the software. I really appreciate any guidance and help from you.

@dhblum
Copy link
Collaborator

dhblum commented Jul 16, 2024

Ok I've reproduced your error on a MacBook (Intel). This needs to be looked into. I don't know why Docker would be trying to, potentially, use a different version of scipy for Mac OS vs Ubuntu.

If you open the colab of the first tutorial listed here, it will take you through using the BOPTEST public web service to test a simple controller. Using the web service, you don't need to build BOPTEST locally.

Hopefully that's helpful for you to get started and thanks again for reporting the issue.

@dhblum
Copy link
Collaborator

dhblum commented Jul 16, 2024

Ok specifying the version of scipy to 1.13.0 in this line fixes this issue. On the MacBook it was operating with scipy v1.14.0, while on Ubuntu it was operating with v1.13.0. Using pip install is the preferred approach over conda install I think as it seems to solve environments and install all the packages faster.

I could PR this fix and then treat updating package versions to a new issue. But any ideas from anyone why two different scipy versions would be installed in a Docker container depending on Platform under which Docker is operating? @kbenne @javiarrobas @EttoreZ?

This might be related to what I'm observing in #655.

@EttoreZ
Copy link
Contributor

EttoreZ commented Jul 17, 2024

Hey @dhblum maybe this link? It seems that depending on the situation, Docker may not download the latest version of the image.

@Jaap-Neven
Copy link
Contributor

Hi @dhblum, @EttoreZ and @Norah135,
I have encountered exactly the same issue using the most recent version of boptest (master branch) and v4.32.0 of docker desktop on Windows 10 OS. A couple of weeks ago, the testcases ran fine for me, so I tested the deployment with the previous version of docker desktop (v4.31.1) and now if works fine. So it should have something to do with the recent docker desktop release notes.

Hope this was helpful!

@Norah135
Copy link
Author

Norah135 commented Jul 20, 2024

Hi @dhblum
Thank you for sharing the Colab link. It was very helpful. I wanted to ask if it is possible to create my own test case for BOPTEST instead of using the predefined cases listed on the BOPTEST website.

@dhblum
Copy link
Collaborator

dhblum commented Jul 29, 2024

Thanks @Jaap-Neven your insight is helpful. In any case, I will specify the version of scipy for now to fix this issue. Looking at removing reliance on scipy in the first place will be another issue. Note this will be included in this existing PR #659, and I'll close this issue when PR is merged.

@Norah135 Here is documentation for how test cases are designed: https://ibpsa.github.io/project1-boptest/docs-design/testcasedev.html. Additionally, here is a basic tutorial for putting together a test case: https://github.com/ibpsa/project1-boptest/blob/master/docs/tutorials/tutorial1_developer/BOPTEST_Tutorial1_developer_20230416.pdf.

@dhblum dhblum closed this as completed in 3bff10e Jul 29, 2024
@dhblum
Copy link
Collaborator

dhblum commented Jul 29, 2024

Closed by #659.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants