Skip to content
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

Replication tool #1057

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft

Replication tool #1057

wants to merge 9 commits into from

Conversation

CBroz1
Copy link
Member

@CBroz1 CBroz1 commented Aug 6, 2024

Draft of replication tool.

TODOs:

  • Traverse aliases
  • Clean up interface
Current usage
from spyglass.common.common_session import Session
from spyglass.linearization.merge import LinearizedPositionOutput as LO
from spyglass.utils.dj_graph import ImportedGraph, RestrGraph

target_analysis = RestrGraph(
    seed_table=LO(),
    leaves={LO.full_table_name: "merge_id=X'b792accc1a26622e4d28675c7bfb5ed5'"},
    direction="up",
    verbose=True,
    cascade=True,
)


new_restr = {"nwb_file_name": "minirec20230621_.nwb"}
replicated = ImportedGraph(
    target=target_analysis,
    new_restr=new_restr,
    parent=Session(),
    child=LO(),
    direction="down",
    banned_tables=list(target_analysis.no_visit),
    verbose=True,
)
replicated.cascade(restriction=new_restr, direction="down", null_on_fail=False)
replicated.cascade_target()

@edeno edeno added the enhancement New feature or request label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants