Closed reelmatt closed 4 years ago
Latest commits don't change much from the initial PR. It does refactor a lot of node-parsing code (with check_missing_packages
being a notable duplicated method still).
The latest commits add Custom Nodes to the same GET /nodes
endpoint for the node listing. It does this through a second, separate, for loop for files within pyworkflow/custom_nodes/
.
I'm working on a refactored approach that handles Nodes differently than this PR. Closing for now, but we can revert to this state of implementation if the refactor is too problematic.
We probably want to hold off on merging until we figure some issues out, but this PR has an implementation of adding custom nodes. Other approaches/questions are discussed in #67.
What this does
POST /workflow/custom_node
endpoint that accepts a file and adds it to acustom_nodes
directory withinpyworkflow
.GET /custom_nodes
endpoint that parses any files located withincustom_nodes
. This returns a JSON-representation of the nodes similar to theGET /nodes
endpoint for "system nodes".~ Adds to the existingGET /nodes
endpoint for system nodes, but now adds searching/parsing of files located withincustom_nodes
.missing_packages
in the JSON response.node_factory
.What this does not do/things to fix
pyworkflow/custom_nodes
so that they can import theNode
class to extend. We may or may not want to stored custom nodes separately from the package, in which case we'll need a way to referenceNode
.root_dir
, or elsewhere).upload_file
methods inworkflow.py
and the Workflow view. If we want to pursue this approach, we should refactor uploading to accept different kinds of files and for different purposes.Pipfile
(like pandas), but this should be addressed.