Skip to content

Commit

Permalink
Merge branch 'feature/v0.4.7' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Dec 28, 2024
2 parents ec99e04 + f5d74c7 commit b6e099c
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions colour/utilities/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def __init__(
self,
name: str | None = None,
value: Any = None,
description: str | None = None,
description: str = "",
node: PortNode | None = None,
) -> None:
super().__init__()
Expand All @@ -601,8 +601,7 @@ def __init__(
self.name = optional(name, self._name)
self._value = None
self.value = optional(value, self._value)
self._description = description
self.description = optional(description, self._description)
self.description = description

@property
def name(self) -> str:
Expand Down Expand Up @@ -694,7 +693,7 @@ def value(self, value: Any) -> None:
self._value = value

@property
def description(self) -> str | None:
def description(self) -> str:
"""
Getter and setter property for the port description.
Expand All @@ -712,7 +711,7 @@ def description(self) -> str | None:
return self._description

@description.setter
def description(self, value: str | None) -> None:
def description(self, value: str) -> None:
"""Setter for the **self.description** property."""

attest(
Expand Down Expand Up @@ -990,10 +989,9 @@ class PortNode(TreeNode, MixinLogging):
2
"""

def __init__(self, name: str | None = None, description: str | None = None) -> None:
def __init__(self, name: str | None = None, description: str = "") -> None:
super().__init__(name)
self._description = description
self.description = optional(description, self._description)
self.description = description

self._input_ports = {}
self._output_ports = {}
Expand Down Expand Up @@ -1084,7 +1082,7 @@ def edges(
return input_edges, output_edges

@property
def description(self) -> str | None:
def description(self) -> str:
"""
Getter and setter property for the node description.
Expand All @@ -1102,7 +1100,7 @@ def description(self) -> str | None:
return self._description

@description.setter
def description(self, value: str | None) -> None:
def description(self, value: str) -> None:
"""Setter for the **self.description** property."""

attest(
Expand All @@ -1117,7 +1115,7 @@ def add_input_port(
self,
name: str,
value: Any = None,
description: str | None = None,
description: str = "",
port_type: Type[Port] = Port,
) -> Port:
"""
Expand Down Expand Up @@ -1191,7 +1189,7 @@ def add_output_port(
self,
name: str,
value: Any = None,
description: str | None = None,
description: str = "",
port_type: Type[Port] = Port,
) -> Port:
"""
Expand Down Expand Up @@ -1616,13 +1614,12 @@ class PortGraph(PortNode):
3
"""

def __init__(self, name: str | None = None, description: str | None = None) -> None:
def __init__(self, name: str | None = None, description: str = "") -> None:
super().__init__(name, description)

self._name: str = self.__class__.__name__
self.name = optional(name, self._name)
self._description = description
self.description = optional(description, self._description)
self.description = description

self._nodes = {}

Expand Down

0 comments on commit b6e099c

Please sign in to comment.