IBM / dse-do-dashboard

Plotly/Dash dashboard for Decision Optimization projects in IBM Cloud Pak for Data
Apache License 2.0
4 stars 3 forks source link

Feature: run local DO model (under development) #3

Open victorterpstra opened 2 years ago

victorterpstra commented 2 years ago

Run a DO model based on a local class or notebook. This allows us to use the dashboard for development and debugging of a DO model.

To run a notebook:

victorterpstra commented 2 years ago

Some additional notes on running a script:

  1. Extract code from notebook (using nbconvert or nbformat)
  2. Run the extracted script using exec:
    with open("somefile.py") as f:
    code = compile(f.read(), "somefile.py", 'exec')
    exec(code, global_vars, local_vars)

See https://stackoverflow.com/questions/436198/what-is-an-alternative-to-execfile-in-python-3 https://docs.python.org/release/3.2.3/library/functions.html#exec