Skip to content
Snippets Groups Projects
Commit e45c9448 authored by Jingyu Gong's avatar Jingyu Gong
Browse files

Merge branch 'dev_jbr' into 'main'

Changed protection level in basic_plotting.py to self._rsl

See merge request ineed-dc/tooling!1
parents 037ce764 99dca029
No related branches found
No related tags found
No related merge requests found
......@@ -41,13 +41,13 @@ def plt_results(self, *variables, plt_type='standard', dpi=500, name='results_pl
for j in range(2):
file_dir = os.path.dirname(file_dir)
for rsl in self.__rsl:
for rsl in self._rsl:
if plt_type == 'standard':
fig, base_plt = plt.subplots(figsize=(16, 9))
base_plt.plot(self._BaseProsumer__rsl[rsl]['TimeStep'],
self._BaseProsumer__rsl[rsl][variables[0]], linewidth=1.5)
base_plt.plot(self._BaseProsumer_rsl[rsl]['TimeStep'],
self._BaseProsumer_rsl[rsl][variables[0]], linewidth=1.5)
for variable in variables[1:]:
self.__rsl[rsl].plot(ax=base_plt, x='TimeStep', y=variable, linewidth=1.5)
self._rsl[rsl].plot(ax=base_plt, x='TimeStep', y=variable, linewidth=1.5)
plt.legend(title='Variable', labels=variables)
# plt.legend(['PV', 'Grid Injection', 'Battery Charging', 'Autonomous Consumption'], loc=1)
plt.show()
......@@ -59,7 +59,7 @@ def plt_results(self, *variables, plt_type='standard', dpi=500, name='results_pl
averages[variable] = []
for d in range(7):
for variable in variables:
averages[variable].append(self.__rsl[rsl].loc[self.__rsl[rsl]['TimeStep'].dt.weekday == d]
averages[variable].append(self._rsl[rsl].loc[self._rsl[rsl]['TimeStep'].dt.weekday == d]
[variable].mean())
for variable in variables:
avg_dfs[variable] = pd.DataFrame(np.array(averages[variable]), columns=['Average ' + str(variable)])
......@@ -88,7 +88,7 @@ def plt_results(self, *variables, plt_type='standard', dpi=500, name='results_pl
for h in range(24):
for variable in variables:
averages[variable].append(
self.__rsl[rsl].loc[self.__rsl[rsl]['TimeStep'].dt.hour == h][variable].mean())
self._rsl[rsl].loc[self._rsl[rsl]['TimeStep'].dt.hour == h][variable].mean())
for variable in variables:
avg_dfs[variable] = pd.DataFrame(np.array(averages[variable]), columns=['Average ' + str(variable)])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment