Closed reelmatt closed 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.
Changes since PR:
path()
instance methodroot_dir
logic to a new WorkflowUtils
classgenerate_file_name
, retrieve_node_data
, and store_node_data
as-is, but these may be due for changes later on as we figure more of the passing of data between nodes.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.
This cleans up
pyworkflow/workflow.py
by removing unused methods, and condensing others. Namely, there wasfrom_session
,from_file
, andfrom_request
methods that all read in a Workflow in mostly the same way. Now, there is onefrom_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:
model.options.id
passed in from the front-end). An 'edit_workflow' endpoint has also been added to make this a more user-friendly name.pyworkflow
to increase modularity of the package.Workflow.path()
now handles creating valid path names for reading/saving files.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
andto_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 assignNone
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.