Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/DM-53492.other.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added a custom __new__ method to the GenericWorkflow class so **ctrl_bps** can work when using NetworkX 3.6.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies = [
"astropy >=4.0",
"pyyaml >=5.1",
"click >= 7.0",
"networkx <3.6",
"networkx",
"lsst-daf-butler",
"lsst-pipe-base",
"lsst-ctrl-mpexec",
Expand Down
12 changes: 12 additions & 0 deletions python/lsst/ctrl/bps/generic_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,18 @@ def __init__(self, name: str, incoming_graph_data: Any | None = None, **attr: An
self.run_id = None
self._final: GenericWorkflowJob | GenericWorkflow | None = None

# Starting from ver. 3.6 of NetworkX, the DiGraph class defines its custom
# __new__ method that explicitly defines arguments it accepts. As a result,
# we need to override it to let our subclass use different ones.
#
# Notes
# -----
# Most likely overriding __new__ in this manner will prevent us from using
# different graph backends with our subclass. However, since we are not
# using any backends, this should not be a problem at the moment.
def __new__(cls, *args, **kwargs) -> "GenericWorkflow":
return object.__new__(cls)

@property
def name(self) -> str:
"""Retrieve name of generic workflow.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
click
astropy
networkx <3.6
networkx
pyyaml
lsst-daf-butler @ git+https://github.com/lsst/daf_butler@main
lsst-utils @ git+https://github.com/lsst/utils@main
Expand Down
Loading