PyWorkflowApp / visual-programming

A Python Visual Programming Workspace for Data Science
MIT License
31 stars 12 forks source link

Clean up Workflow methods; update naming for Workflow/edit endpoint #49

Closed reelmatt closed 4 years ago

reelmatt commented 4 years ago

This cleans up pyworkflow/workflow.py by removing unused methods, and condensing others. Namely, there was from_session, from_file, and from_request methods that all read in a Workflow in mostly the same way. Now, there is one from_json method that can load a Workflow from a file (via the 'open' endpoint) and from session (via the middleware).

Workflow attributes have been simplified to:

These changes should not affect the existing functionality, at least for tests that contain all the required info. One area I wasn't able to test that might be affected is cases where there is missing info. The from_json and to_session_dict methods for reading/writing the Workflow now assume valid data is provided and will raise a WorkflowException if it's not there. Previously, in some situations it would assign None to the graph if a graph was not present, but that's not really the behavior we want (I think). Something to check/look out for.

reelmatt commented 4 years ago

Good note re: UUID/naming. I moved the comment I was writing here to #51 as a way of making it a TODO.

reelmatt commented 4 years ago

Changes since PR:

I think it makes sense to merge this now, and if we want to revisit these points later on, it should be easy enough to do.