From 6cbad67e162ccb54dbf16a63643beca35f6b1b68 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Tahavori Date: Fri, 29 Mar 2024 18:13:27 +0100 Subject: [PATCH] Adding depreciation warning to Appliance method in User class to ensure the Back-compatibility with legacy code, the Appliance method of User class is present. However the method is not further maintained since the nex-gen version of the sofware. To warn the users to move towards the new method, a DeprecationWarning is added. --- ramp/core/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ramp/core/core.py b/ramp/core/core.py index e21047b2..579141e2 100644 --- a/ramp/core/core.py +++ b/ramp/core/core.py @@ -42,6 +42,7 @@ def single_appliance_daily_load_profile(args): return args[0], app.daily_use +warnings.simplefilter('always', DeprecationWarning) class UseCase: def __init__( @@ -845,6 +846,9 @@ def Appliance( ------ refer to Appliance class docs """ + + warnings.warn("This function is deprecated and not supported since version v0.4.0. Instead use the add_appliance method.", DeprecationWarning) + return self.add_appliance( number=number, power=power,