-
Notifications
You must be signed in to change notification settings - Fork 13
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
Workflow validation #1223
Workflow validation #1223
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this PR a lot of workflow methods handle the graph and not workflow itself. As in previous PR I would love to see the part where the graph is a separate struct.
workflow/workflow.go
Outdated
return fmt.Errorf("non connected graph") | ||
} | ||
if !w.isMonoParental() { | ||
return fmt.Errorf("non mono-parental graph") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never see a mono-parental
word to describe a graph, can you point out the article/algorithm where they use such terminology?
return fmt.Errorf("non mono-parental graph") | |
return fmt.Errorf("the edge %s has to or more parents") |
Also, a method name can be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the right term, I couldn't find a better name. If you know any name that describes that each node should have only one parent I'm really happy to change this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed the function to maximumParentNode(max int)
that returns true when all the nodes have less than max parents.
Co-Authored-By: krhubert <[email protected]>
I agree that's why I started to move all the graph-related stuff in the algorithm file. I don't want to charge too much this PR and also I have to have a look at https://github.com/gonum/gonum/tree/master/graph that might replace all. So this will certainly change soon. |
1f81955
to
a15be27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems good except the function hasNodes
that return the opposite of what the function's name is saying. The name should also by singular hasNode
has it should true if at least 1 node exist.
14a43ff
to
cf7966d
Compare
Co-Authored-By: Nicolas Mahé <[email protected]>
Add workflow validation:
With this validation, we are allowing only directed tree graphs which is a family of DAG.
You can use the test from this PR: #1209