Skip to content

Commit

Permalink
update: use topo_sort() in datajoint 0.14.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
ttngu207 committed Oct 14, 2024
1 parent 9e433fe commit 0cd7666
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion datajoint_utilities/dj_data_copy/db_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def migrate_schema(

tbl_names = [
tbl_name.split(".")[-1]
for tbl_name in dj.Diagram(origin_schema).topological_sort()
for tbl_name in dj.Diagram(origin_schema).topo_sort()
]
tbl_names = [
".".join(
Expand Down
8 changes: 4 additions & 4 deletions datajoint_utilities/dj_data_copy/pipeline_cloning.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def find_part_table_ancestors(table, ancestors={}, verbose=False):
ancestors[table.full_table_name] = free_table
for part_table in free_table.parts(as_objects=True):
ancestors_diagram = dj.Diagram(part_table) - 999
for full_table_name in ancestors_diagram.topological_sort():
for full_table_name in ancestors_diagram.topo_sort():
if full_table_name.isdigit():
continue
if (
Expand Down Expand Up @@ -68,7 +68,7 @@ def get_restricted_diagram_tables(

# walk up to search for all ancestors
ancestors_diagram = diagram - 999
for ancestor_table_name in ancestors_diagram.topological_sort():
for ancestor_table_name in ancestors_diagram.topo_sort():
if ancestor_table_name.isdigit():
continue
if verbose:
Expand All @@ -88,7 +88,7 @@ def get_restricted_diagram_tables(
# walk down to find all descendants
if not ancestors_only:
descendants_diagram = diagram + 999
for descendant_table_name in descendants_diagram.topological_sort():
for descendant_table_name in descendants_diagram.topo_sort():
if descendant_table_name.isdigit():
continue
if verbose:
Expand Down Expand Up @@ -275,7 +275,7 @@ def find_restricted_diagram(self):
# walk up to search for all ancestors
ancestors = {}
ancestors_diagram = self.input_diagram - 999
for ancestor_table_name in ancestors_diagram.topological_sort():
for ancestor_table_name in ancestors_diagram.topo_sort():
if ancestor_table_name.isdigit():
continue
if self.verbose:
Expand Down
2 changes: 1 addition & 1 deletion datajoint_utilities/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Package metadata."""

__version__ = "0.3.0"
__version__ = "0.4.0"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
datajoint @ git+https://github.com/datajoint/datajoint-python.git
datajoint>=0.14.3
termcolor
slack-sdk
python-dotenv
Expand Down

0 comments on commit 0cd7666

Please sign in to comment.