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

Rename interfaces property to avoid clash with AlgorithmInterface #3733

Merged
merged 1 commit into from
Dec 6, 2024
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
2 changes: 1 addition & 1 deletion app/grandchallenge/algorithms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def remove_user(self, user):
return user.groups.remove(self.users_group)

@cached_property
def interfaces(self):
def linked_component_interfaces(self):
return (self.inputs.all() | self.outputs.all()).distinct()

@cached_property
Expand Down
2 changes: 1 addition & 1 deletion app/grandchallenge/components/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2626,7 +2626,7 @@ def values_for_interfaces(self):
return values_for_interfaces

@cached_property
def interfaces(self):
def linked_component_interfaces(self):
return ComponentInterface.objects.filter(
pk__in=self.civ_sets_related_manager.exclude(
values__isnull=True
Expand Down
2 changes: 1 addition & 1 deletion app/grandchallenge/evaluation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ def set_default_interfaces(self):
)

@cached_property
def interfaces(self):
def linked_component_interfaces(self):
return (
self.algorithm_inputs.all() | self.algorithm_outputs.all()
).distinct()
Expand Down
9 changes: 5 additions & 4 deletions app/grandchallenge/hanging_protocols/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if self.instance:
interface_slugs = [
interface.slug for interface in self.instance.interfaces
interface.slug
for interface in self.instance.linked_component_interfaces
]

if len(interface_slugs) > 0:
Expand Down Expand Up @@ -176,18 +177,18 @@ def __init__(self, *args, **kwargs):
def _get_interface_lists(self):
images = [
interface.slug
for interface in self.instance.interfaces
for interface in self.instance.linked_component_interfaces
if interface.kind == InterfaceKindChoices.IMAGE
]
mandatory_isolation_interfaces = [
interface.slug
for interface in self.instance.interfaces
for interface in self.instance.linked_component_interfaces
if interface.kind
in InterfaceKind.interface_type_mandatory_isolation()
]
overlays = [
interface.slug
for interface in self.instance.interfaces
for interface in self.instance.linked_component_interfaces
if interface.kind
not in (
*InterfaceKind.interface_type_undisplayable(),
Expand Down
Loading