Skip to content

Use the neighborlist in signac core - #320

Merged
cbkerr merged 20 commits into
mainfrom
neighbor-in-core
Jul 7, 2026
Merged

Use the neighborlist in signac core#320
cbkerr merged 20 commits into
mainfrom
neighbor-in-core

Conversation

@cbkerr

@cbkerr cbkerr commented Jun 22, 2026

Copy link
Copy Markdown
Member

Description

Motivation and Context

This enables ignoring certain state point keys when detecting neighbors

Checklist:

@bdice bdice left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread signac_dashboard/modules/navigator.py
Comment thread signac_dashboard/modules/navigator.py Outdated
Comment thread signac_dashboard/modules/navigator.py Outdated
@cbkerr

cbkerr commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

I refactored some repeated code in the tests to make it easier to add tests...and caught an untested case in the ignore in core! (constant state point parameters). I'm catching it in the test as an expected warning for now to document it before the next signac release

Comment thread signac_dashboard/modules/navigator.py Outdated
Comment on lines -65 to -67
if value is _DictPlaceholder:
# Possible if schema is heterogeneous
continue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this indicate that the code will no longer work for some schemas? I don't mind either way, but it's worth noting

@cbkerr cbkerr Jul 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 janbridley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested a few small things to review, but overall this looks great! Very excited to have this in

cbkerr and others added 3 commits July 2, 2026 21:37
Co-authored-by: Jenna Bradley <55467578+janbridley@users.noreply.github.com>
@cbkerr
cbkerr merged commit 0ed80a4 into main Jul 7, 2026
11 checks passed
@cbkerr
cbkerr deleted the neighbor-in-core branch July 7, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants