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

Add explicit requirements for jupyter notebooks examples #340

Merged
merged 7 commits into from
Jun 26, 2023

Conversation

363734
Copy link
Contributor

@363734 363734 commented Jun 1, 2023

Add for all example notebooks the explicit list of Python packages the user should have (in addition to cpmpy) to make the notebooks run

@IgnaceBleukx
Copy link
Collaborator

We can also add these requirements in the requirements.txt file like this:

numpy
ortools >= 9.6
z3-solver[full, solvers]
python-sat[full, solvers]
... # whatever other solvers
jupyter[full, examples]
requests[full, examples]
pandas[full, examples]
... # whatever is needed for the examples to run

Then a user can simply do pip install cpmpy[examples] or pip install cpmpy[full] to get the required packages.
It might be somewhat far-fetched but I think it would be a nice to have as you have gone trough the trouble of checking which packages are needed anyway :)

@363734
Copy link
Contributor Author

363734 commented Jun 1, 2023

If it is possible using the requirements file, it would be the best! It would simplify the life of the users and avoid the need to search all the commands to install all the packages separately

@JoD JoD added the next release Needed for next release label Jun 19, 2023
@Wout4
Copy link
Collaborator

Wout4 commented Jun 23, 2023

The conclusion here was to not use the requirement file, since that would lead to many otherwise unneeded packages being installed (and we don't have time to figure out the optional requirements). So this should be good to merge now?

@IgnaceBleukx
Copy link
Collaborator

Btw what we can also do is to install the packages from within the notebook.
This way you do not need to put it in the requirements file, but also allows you to skip manual installation.

Actuallyt, any system-command can be executed using '!' before the command.
E.g., in the first cell of the notebook we can do ! pip install plotly geopy for example. Is this something we want?

@363734
Copy link
Contributor Author

363734 commented Jun 23, 2023

I would not recommend putting the pip install within the notebook. As the user could want to define its own conda environment to test the notebook.

It can be merge

@IgnaceBleukx
Copy link
Collaborator

IgnaceBleukx commented Jun 23, 2023

Added everything to the notebooks, and also cleaned up the assets used by all examples. This should be a little cleaner now.
Think its ready to merge.

@IgnaceBleukx IgnaceBleukx merged commit 38b6704 into master Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next release Needed for next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants