From f4bac1adc0e7970e11b4db95739ea4b079abb093 Mon Sep 17 00:00:00 2001 From: FBumann <117816358+FBumann@users.noreply.github.com> Date: Sat, 13 Sep 2025 18:48:27 +0200 Subject: [PATCH] Change UserWarning to DeprecationWarning for Bus objects which are stored inside Flows --- flixopt/flow_system.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)