diff --git a/flixopt/flow_system.py b/flixopt/flow_system.py index 86fcbfe52..90913b05a 100644 --- a/flixopt/flow_system.py +++ b/flixopt/flow_system.py @@ -417,14 +417,14 @@ def _connect_network(self): # Add Bus if not already added (deprecated) if flow._bus_object is not None and flow._bus_object not in self.buses.values(): - self._add_buses(flow._bus_object) warnings.warn( f'The Bus {flow._bus_object.label} was added to the FlowSystem from {flow.label_full}.' f'This is deprecated and will be removed in the future. ' f'Please pass the Bus.label to the Flow and the Bus to the FlowSystem instead.', - UserWarning, + DeprecationWarning, stacklevel=1, ) + self._add_buses(flow._bus_object) # Connect Buses bus = self.buses.get(flow.bus)