Closed Dibyendu-IITKGP closed 1 month ago
Hi @Dibyendu-IITKGP, please refer to this discussion about notebooks: https://github.com/pybop-team/PyBOP/discussions/344
The develop
version of the notebook should be run with the develop
branch of PyBOP. Otherwise please use the main
version.
Interestingly, @Dibyendu-IITKGP has installed from develop. I'm reopening this to confirm if the pip install from develop is causing problems on Linux machines, or a mismatch in virtual envs. I can confirm on MacOS that pip install git+https://github.com/pybop-team/PyBOP.git@develop
in a new virtualenv allows the notebook in question to run correctly (after installing plotly).
@Dibyendu-IITKGP can you confirm you're jupyter instance is targetting the right virtualenv?
@BradyPlanden yes, the virtual environment is rightly set up. I am using vs code to run in linux. In vs code, I have selected the same venv where I installed and re-installed (as per your suggestion) PyBOP. Used this earlier today (pip install git+https://github.com/pybop-team/PyBOP.git@develop --force-reinstall).
The expected error when running the develop
version of the notebook using the main
version of PyBOP is:
TypeError Traceback (most recent call last)
Cell In[10], [line 1](vscode-notebook-cell:?execution_count=10&line=1)
----> [1](vscode-notebook-cell:?execution_count=10&line=1) sample = parameters.rvs()
[2](vscode-notebook-cell:?execution_count=10&line=2) print(sample)
[3](vscode-notebook-cell:?execution_count=10&line=3) cost_SSE(sample)
TypeError: Parameters.rvs() missing 1 required positional argument: 'n_samples'
Is this the error that you see @Dibyendu-IITKGP?
yes, it is.
Working now as per @BradyPlanden 's suggestion, replace the %pip install pybop -q
in the first cell of the notebook with: %pip install git+https://github.com/pybop-team/PyBOP.git@develop --force-reinstall
Python Version
Python 3.10.12
Describe the bug
I was running the examples from the notebook folder. All of them run ok except one. comparing_cost_functions.ipynb is throwing error while calling rvs method.
Steps to reproduce the behaviour
In the example folder go to notebook and then run comparing_cost_functions.ipynb.
Relevant log output
No response