helpfulengineering / project-data-platform

An experimental attempt to make a CLI for supply-chain modeling for Helpful Engineering's Project Data
GNU Affero General Public License v3.0
9 stars 2 forks source link

Create a Jupyter Notebook out of the current code.... #22

Closed RobertLRead closed 7 months ago

RobertLRead commented 1 year ago

Our goal here is to allow the ease that Jupyter Notebook provides for outsiders to run our code, as well as offering some graphical capability in the Notebook.

We may host this in CoCalc, but would like to make a "plain vanilla" Jupyter Notebook that can be run in many containers.

This issue is confined to the act of demonstrating the run of a "supply problem" as documented in the film in the "doc" directory in a Notebook. No doubt there will be many enhancements, but this issue is just to get us started here.

It is unclear to me if this code can be kept in the repo with a single source of truth and be used in the notebook; but figuring that out is not part of this issue.

lynnpepin commented 1 year ago

I've recently pushed new code to the jupyterification branch, making a notebook matching pd_sc.py. This makes sense, since pd_sc.py is primarily a "demo" script. Changes so far:

  1. Added a notebooks folder
  2. Added notebooks/pd_sc.ipynb, adapting the code from src/pd_sc.py (with some changes).
  3. Modified code under src to fix imports.
  4. Added an import_magic.ipynb notebook to explain a few dense lines that we use to import code from src.

It'd be good for someone with more expertise to modify the Markdown / add Markdown in the pd_sc.ipynb notebook! Other than that, the jupyterification branch should be complete.

Jbutler-helpful commented 7 months ago

We had a little luck using google colab in some testing we also took a look a github codespaces https://docs.github.com/en/codespaces

Jbutler-helpful commented 7 months ago

This is mostly done in tim's branch https://github.com/timr11/project-data-visualizations or captured in #55

lynnpepin commented 6 months ago

Hi, sorry, seeing this just now.

For local Jupyter environments, I think the best thing to do would be to install Jupyter Lab using Pip or Conda. This is the best way to set up a Jupyter environment.

There's also the standalone Jupyterlab Desktop, which combines the server application and browser client into one app. For people who are terminal-only, Jupyter Console provides an interactive TUI interface to work with notebooks.

VSCode and Pycharm Professional also have good notebook support. If you're already using either of these IDEs, then you can run your notebooks directly in it.

I would advise against relying on GitHub Codespaces or Google Colab, unless there is funding to move to paid tiers. The free tiers come with terms and conditions which are always shifting, and I don't think these can exist as free products indefinitely.