We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Labels need to be unique. it will leads failure, when there is the same labeled components. Check when adding.
The text was updated successfully, but these errors were encountered:
I think something like this would solve the problem:
class EnergySystem: (...) def add(self, *nodes): """Add :class:`nodes <oemof.network.Node>` to this energy system.""" new_nodes = {node.label: node for node in nodes} if self._nodes.keys().isdisjoint(new_nodes.keys()): self._nodes.update(new_nodes) else: common_labels = self._nodes.keys() & new_nodes.keys() raise ValueError(f"EnergySystem already contains Node(s) labeled {common_labels}.") for n in nodes: self.signals[type(self).add].send(n, EnergySystem=self)
Sorry, something went wrong.
No branches or pull requests
Labels need to be unique. it will leads failure, when there is the same labeled components. Check when adding.
The text was updated successfully, but these errors were encountered: