Use the neighborlist in signac core - #320
Conversation
bdice
left a comment
There was a problem hiding this comment.
Nice work! Can we add test coverage? (I know dashboards are hard to write tests for... maybe you can get an agent to help.) Otherwise a few small fixes should do it.
Co-authored-by: Bradley Dice <bdice@bradleydice.com>
|
I refactored some repeated code in the tests to make it easier to add tests...and caught an untested case in the |
| if value is _DictPlaceholder: | ||
| # Possible if schema is heterogeneous | ||
| continue |
There was a problem hiding this comment.
Does this indicate that the code will no longer work for some schemas? I don't mind either way, but it's worth noting
There was a problem hiding this comment.
This was moved to signac core. There, it's what allows it to detect neighbors for state points changing within heterogenous/disjoint etc project schemas, but does not detect differences of only adding/deleting a state point key.
For example
# just jobs a1 and a2 are detected as neighbors of each other
a1 = project.open_job({"a": 1}).init()
a2 = project.open_job({"a": 2}).init()
a2b1 = project.open_job({"a": 2, "b": 1}).init()
nl = project.get_neighbors()
assert nl[a1.id]["a"][2] == a2.id
assert nl[a2.id]["a"][1] == a1.id
assert nl[a2b1.id]["a"] == {}
janbridley
left a comment
There was a problem hiding this comment.
Requested a few small things to review, but overall this looks great! Very excited to have this in
Co-authored-by: Jenna Bradley <55467578+janbridley@users.noreply.github.com>
Description
Motivation and Context
This enables ignoring certain state point keys when detecting neighbors
Checklist: