Skip to content

Commit

Permalink
Remove __slots__ and corresponding test
Browse files Browse the repository at this point in the history
__slots__ in network have no (positive) effect anyway,
as just subclasses are used.
  • Loading branch information
p-snft committed Dec 14, 2023
1 parent 4f5973f commit 4e82677
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
11 changes: 0 additions & 11 deletions src/oemof/network/network/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,8 @@ class Entity:
custom_properties: `dict`
This dictionary that can be used to store information that can be used
to easily attach custom information to any Entity.
Attributes
----------
__slots__: str or iterable of str
See the Python documentation on `__slots__
<https://docs.python.org/3/reference/datamodel.html#slots>`_ for more
information.
"""

__slots__ = [
"_label",
"custom_properties",
]

def __init__(self, label=None, *, custom_properties=None, **kwargs):
self._label = label
Expand Down
2 changes: 0 additions & 2 deletions src/oemof/network/network/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class Node(Entity):
A dictionary mapping output nodes to corresponding outflows.
"""

__slots__ = ["_in_edges", "_inputs", "_outputs"]

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

Expand Down
5 changes: 0 additions & 5 deletions tests/test_network_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ class TestsNode:
def setup_method(self):
self.energysystem = EnSys()

def test_that_attributes_cannot_be_added(self):
entity = Entity()
with pytest.raises(AttributeError):
entity.foo = "bar"

def test_symmetric_input_output_assignment(self):
n1 = Node(label="<N1>")

Expand Down

0 comments on commit 4e82677

Please sign in to comment.