From 2e868f9f181cea2ce0246b26584a3ce83578dc08 Mon Sep 17 00:00:00 2001 From: "pierre-francois.duc" Date: Wed, 15 May 2024 13:07:37 +0200 Subject: [PATCH] Lint with black --- docs/notebooks/example_figure_joss.ipynb | 22 +++++++++++----------- ramp/core/core.py | 8 ++++++-- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/docs/notebooks/example_figure_joss.ipynb b/docs/notebooks/example_figure_joss.ipynb index 50db22d5..2d9bc0bc 100644 --- a/docs/notebooks/example_figure_joss.ipynb +++ b/docs/notebooks/example_figure_joss.ipynb @@ -64,9 +64,7 @@ "uc = UseCase(\"JOSS-paper-figure\", users=[LMI, LI], random_seed=20240110)\n", "uc.initialize(num_days=1)\n", "\n", - "profiles = uc.generate_daily_load_profiles(\n", - " cases=[1,2,3,4,5]\n", - ")" + "profiles = uc.generate_daily_load_profiles(cases=[1, 2, 3, 4, 5])" ] }, { @@ -109,21 +107,23 @@ "import matplotlib.pyplot as plt\n", "import matplotlib.dates as mdates\n", "\n", - "plt.rcParams.update({'font.size': 22})\n", + "plt.rcParams.update({\"font.size\": 22})\n", "\n", - "fig, ax1 = profiles.shadow( figsize=(16, 8))\n", - "for ln in range(0,len(profiles.columns)+1):\n", - " ax1.get_lines()[ln].set_color('royalblue') # edits the defualt colour of the shadow-plot lines\n", - "ax1.legend(['5-day average', 'Single days(s)'])\n", + "fig, ax1 = profiles.shadow(figsize=(16, 8))\n", + "for ln in range(0, len(profiles.columns) + 1):\n", + " ax1.get_lines()[ln].set_color(\n", + " \"royalblue\"\n", + " ) # edits the defualt colour of the shadow-plot lines\n", + "ax1.legend([\"5-day average\", \"Single days(s)\"])\n", "ax1.margins(0)\n", "\n", "ax1.set_xticks(ax1.get_xticks()[1:])\n", "\n", - "myFmt = mdates.DateFormatter('%H:%M')\n", + "myFmt = mdates.DateFormatter(\"%H:%M\")\n", "ax1.xaxis.set_major_formatter(myFmt)\n", "\n", - "ax1.set_ylabel('Normalised power (kW/kW-Peak)', fontsize='large', labelpad=20)\n", - "ax1.set_xlabel('Time (hours:minutes)', fontsize='large', labelpad=20)" + "ax1.set_ylabel(\"Normalised power (kW/kW-Peak)\", fontsize=\"large\", labelpad=20)\n", + "ax1.set_xlabel(\"Time (hours:minutes)\", fontsize=\"large\", labelpad=20)" ] } ], diff --git a/ramp/core/core.py b/ramp/core/core.py index 85e00cab..cdaf2e8c 100644 --- a/ramp/core/core.py +++ b/ramp/core/core.py @@ -1401,8 +1401,12 @@ def windows( self.random_var_1 = int( random_var_w * np.diff(self.window_1)[0] ) # calculate the random variability of window1, i.e. the maximum range of time they can be enlarged or shortened - self.random_var_2 = int(random_var_w * np.diff(self.window_2)[0]) # same as above - self.random_var_3 = int(random_var_w * np.diff(self.window_3)[0]) # same as above + self.random_var_2 = int( + random_var_w * np.diff(self.window_2)[0] + ) # same as above + self.random_var_3 = int( + random_var_w * np.diff(self.window_3)[0] + ) # same as above # automatically appends the appliance to the user's appliance list self.user._add_appliance_instance(self)