-
Notifications
You must be signed in to change notification settings - Fork 192
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
Corrected the graph export set expansion rules that are described at … #2632
Conversation
5e08a47
to
163baf6
Compare
@danieleongari has now done a first test Here is what we noticed:
I think the only proper way of resolving this is to have both
|
Concerning which subset of the uuid to show: git uses 7 characters for the commit hash (unless conflicts are discovered); we could use 8 characters (the first part of the uuid). Subsets of uuids are already supported in 0.12, e.g. you can do |
Thanks a lot Leopold for the testing and the feedback! Due to time constrains (and for keeping things simple), I would keep this PR to the absolutely necessary to make the export rules work correctly (the UUIDs at the graph generate were left there by accident because they were useful for debugging - but if we all like it, I can keep a shorter UUID version). The discussion on overriding the arguments can be added at another ticket and the implementation at another PR. |
Sounds good to me. Let's do both the uuid stuff and the changes to options in a separate PR (please remove the uuid changes from this one). I will review the code changes this evening. |
However, please keep the printing of selected rules in this PR (perhaps add a print "Rules on following links:" line before) |
The addition of the UUIDs at the graph will be addressed at issue #2636 |
Further discussion on the export set expansion rules can be done at #2637 |
163baf6
to
f92a78f
Compare
For me it is OK.
|
(INPUT, CREATE, RETURN and CALL) | ||
""" | ||
|
||
test_case = None |
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.
should these be class variables?
if they are just instance variables, you can remove these two lines
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 prefer to keep them for clarity - I don't like the approach of using undefined variables even if Python allows it - I find it dirty
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.
But I will document them though
@@ -1481,6 +1483,175 @@ def get_all_node_links(self): | |||
edge_project=['label', 'type'], output_of='input') | |||
return qb.all() | |||
|
|||
class ComplexGraph: |
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 file already has >1k lines
could you please move the ComplexGraph out into a separate file?
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 propose this to be done under another PR. And mainly to 1.0
There is already one created by Casper (#2702)
wc2 = WorkCalculation().store() | ||
|
||
pw1 = JobCalculation() | ||
pw1.set_computer(self.test_case.computer) |
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.
you use the test_case just to get the computer, correct?
you use the test_case
just for the computer, correct?
can you just pass the computer
to the constructor instead?
this is more explicit, while passing the test case creates a loop where the test case creates the ComplexGraph, which again has a reference to the test case, ...
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.
Good point, I will do that.
I passed the test_case since I wanted to be more generic.
But it is cleaner what you propose.
I have to stop the review now, will continue later |
f92a78f
to
7d965df
Compare
I addressed some of the comments. I would propose to merge this and apply the same changes to 1.0 (since it is important to have correct export rules) and leave the further refactoring to be done under another ticket (since there is one - and Casper has already started working on it). |
…s. Moreover they were moved to separate methods to resuce the complexity of the export method. Various tests were added: - Export tests that are based on a real workchain were added to ensure that a complex and real AiiDA graph based on workchains is exported correctly. - Export tests based on a synthetic graph were added that explicitly check every flag that changes the default behaviour of the export set expansion rules.
7d965df
to
b6c026e
Compare
I'll finish the review tonight
…On Thu, Apr 4, 2019, 20:11 szoupanos ***@***.***> wrote:
@ltalirz <https://github.com/ltalirz> @sphuber
<https://github.com/sphuber>
Can this be merged please?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2632 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABASPSizZdRoMYHtXWeP_iGnKpM-KkD_ks5vdkBRgaJpZM4cELG9>
.
|
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.
Hi @szoupanos, looks good to me - I've mainly tested functionality rather than looking at the code since you anyhow don't want to refactor here.
One remark: As mentioned before, putting just one node with -RIX
, i.e.
('input_forward: ', True)
('create_reversed: ', True)
('return_reversed: ', True)
('call_reversed: ', True)
currently seems to return basically the whole subset of a graph that is connected to the node.
I guess this is correct, since (according to Giovanni), output links must always be followed.
The recursive algorithm used here seems a bit too slow to do this in practice for a large number of connected nodes (say 10-100k), however, so we should just keep this in mind.
Thanks a lot Leo! Regarding the speed of the graph exploration algorithm, I think that it is a simple graph traversal algorithm If you find a case that you think that it is particularly slow, we can have a look at it (in case there is a bug etc). |
…issue 1102
#1102
There were problems when overriding the default behaviour of the rules. Moreover
they were moved to separate methods to resuce the complexity of the export method.
Various tests were added:
and real AiiDA graph based on workchains is exported correctly.
flag that changes the default behaviour of the export set expansion rules.