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

New project item: Jupyter Notebook #1185

Open
spine-o-bot opened this issue Feb 4, 2021 · 2 comments
Open

New project item: Jupyter Notebook #1185

spine-o-bot opened this issue Feb 4, 2021 · 2 comments
Assignees
Labels
Feature Possible new feature Project items
Milestone

Comments

@spine-o-bot
Copy link

spine-o-bot commented Feb 4, 2021

As discussed in the Spine Engine meeting, it could be interesting to create a new project item to embed a Jupyter Notebook that could be used both for data cleaning or for data visualisation.
The notebook embedded as project item can be a parametric notebook. A parametric notebook can be executed as a node and it accepts datastreams/parameters as input and outputs data as output parameters.
A Jupyter Notebook can be parameterised using the package called Papermill (https://papermill.readthedocs.io/en/latest/). The input parameters are the output of the previous node, while the output parameters will be the input to the following node.
Implementing such a project item can increase the flexibility of the spine workflow, allow users to create their own visualisations/data cleaning pipeline and can also open Spine to more case studies.
Parametric notebooks are supported in Dagster using a feature called Dagstermill, so the workflow can be executed by the spine engine without any problem (https://docs.dagster.io/docs/apidocs/libraries/dagstermill).
Let me know what you think.

@ptsavol ptsavol added this to the V0.6 milestone Mar 23, 2021
@ptsavol ptsavol added Feature Possible new feature Project items labels Mar 23, 2021
@spine-tools spine-tools deleted a comment from spine-o-bot Mar 23, 2021
@ptsavol ptsavol changed the title New project item: Jupyter Notebook [REPLACEMENT ISSUE] New project item: Jupyter Notebook Mar 23, 2021
@ptsavol
Copy link
Member

ptsavol commented Apr 9, 2021

Hi @RichieBrady. Can you merge the latest master into the notebook branch and make a pull request. Easier to see the changes that way. I got it working by installing the specific versions of spinetoolbox, spinedb_api, and spine_engine that the spine_item notebook branch now requires but it's very awkward. Also, there's this new dependency papermill. I think this should be added as a dependency of spine_engine by adding it to the install_requires list in spine_engine/setup.py. Also also, when you drag a blank notebook item to Design View, this happens

2021-04-09 13:18:40 ERROR: Category name Notebooks not found in ['Data Stores', 'Data Connections', 'Tools', 'Views', 'Importers', 'Exporters', 'Manipulators']
Traceback (most recent call last):
  File "C:\Users\ttepsa\OneDrive - Teknologian Tutkimuskeskus VTT\Documents\GIT\SPINETOOLBOX\spinetoolbox\project_commands.py", line 151, in redo
    category_ind, *project_tree_items, set_selected=self.set_selected, verbosity=self.verbosity
  File "C:\Users\ttepsa\OneDrive - Teknologian Tutkimuskeskus VTT\Documents\GIT\SPINETOOLBOX\spinetoolbox\project.py", line 267, in do_add_project_tree_items
    self._project_item_model.insert_item(project_tree_item, category_ind)
  File "C:\Users\ttepsa\OneDrive - Teknologian Tutkimuskeskus VTT\Documents\GIT\SPINETOOLBOX\spinetoolbox\mvcmodels\project_item_model.py", line 222, in insert_item
    parent_item = self.item(parent)
  File "C:\Users\ttepsa\OneDrive - Teknologian Tutkimuskeskus VTT\Documents\GIT\SPINETOOLBOX\spinetoolbox\mvcmodels\project_item_model.py", line 141, in item
    if not index.isValid():
AttributeError: 'NoneType' object has no attribute 'isValid'

But I suggest to do the merge first and see if this disappears.

@RichieBrady
Copy link
Contributor

Hi @PekkaSavolainen I just pushed an update to the notebook_executor branch which has fixed bugs related to updating to the latest toolbox, engine, and spine_items. I will make a pull request later today and get the ball rolling with the merge.

The error you are getting is related to the toolbox which requires a small update to category,py and ui_main.py I will make a pull request for that as well.

@ptsavol ptsavol modified the milestones: V0.6, V0.7 Aug 13, 2021
@ptsavol ptsavol modified the milestones: V0.7, V0.8 Sep 14, 2021
@ptsavol ptsavol self-assigned this Sep 14, 2021
@jkiviluo jkiviluo modified the milestones: V0.8, V1.0 Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Possible new feature Project items
Projects
None yet
Development

No branches or pull requests

4 participants