From 555e82f33228eee6e7209aa3bd0ddca6a388d384 Mon Sep 17 00:00:00 2001 From: Vincent Renault Date: Mon, 24 Feb 2020 09:45:38 +0100 Subject: [PATCH] Rename episode_analytics into episode --- grid2kpi/__init__.py | 1 + .../EpisodeAnalytics.py | 13 ++++++++++--- .../{episode_analytics => episode}/EpisodeTrace.py | 0 grid2kpi/episode/__init__.py | 1 + .../{episode_analytics => episode}/actions_model.py | 0 .../consumption_profiles.py | 0 .../{episode_analytics => episode}/env_actions.py | 0 .../{episode_analytics => episode}/maintenances.py | 0 .../observation_model.py | 0 grid2kpi/episode_analytics/__init__.py | 0 setup.py | 10 +++++----- 11 files changed, 17 insertions(+), 8 deletions(-) rename grid2kpi/{episode_analytics => episode}/EpisodeAnalytics.py (95%) rename grid2kpi/{episode_analytics => episode}/EpisodeTrace.py (100%) create mode 100644 grid2kpi/episode/__init__.py rename grid2kpi/{episode_analytics => episode}/actions_model.py (100%) rename grid2kpi/{episode_analytics => episode}/consumption_profiles.py (100%) rename grid2kpi/{episode_analytics => episode}/env_actions.py (100%) rename grid2kpi/{episode_analytics => episode}/maintenances.py (100%) rename grid2kpi/{episode_analytics => episode}/observation_model.py (100%) delete mode 100644 grid2kpi/episode_analytics/__init__.py diff --git a/grid2kpi/__init__.py b/grid2kpi/__init__.py index e69de29..a9d145c 100644 --- a/grid2kpi/__init__.py +++ b/grid2kpi/__init__.py @@ -0,0 +1 @@ +from .episode import EpisodeAnalytics \ No newline at end of file diff --git a/grid2kpi/episode_analytics/EpisodeAnalytics.py b/grid2kpi/episode/EpisodeAnalytics.py similarity index 95% rename from grid2kpi/episode_analytics/EpisodeAnalytics.py rename to grid2kpi/episode/EpisodeAnalytics.py index 75b2505..bb5f1be 100644 --- a/grid2kpi/episode_analytics/EpisodeAnalytics.py +++ b/grid2kpi/episode/EpisodeAnalytics.py @@ -63,7 +63,7 @@ def _make_df_from_data(self): ------- res: :class:`tuple` generated dataframes - """ + """ size = len(self.actions) timesteps = list(range(size)) load_size = size * len(self.observations[0].load_p) @@ -133,10 +133,17 @@ def _make_df_from_data(self): pos = time_step # TODO : change with benjamin's count of actions - action_line = np.sum(act._switch_line_status) + action_line = np.sum(act._switch_line_status) + np.sum(act._set_line_status) + if action_line > 0: + line_action = "reconnect " + line_action + if action_line < 0: + line_action = "disconnect " + line_action + action_line = - action_line # TODO: change with benjamin's count of actions - action_subs = int(np.any(act._change_bus_vect)) + action_subs = int(np.any(act._change_bus_vect)) + int(np.any(act._set_topo_vect)) + if action_line: + action_subs = 0 object_changed_set = self.get_object_changed( act._set_topo_vect, topo_list) diff --git a/grid2kpi/episode_analytics/EpisodeTrace.py b/grid2kpi/episode/EpisodeTrace.py similarity index 100% rename from grid2kpi/episode_analytics/EpisodeTrace.py rename to grid2kpi/episode/EpisodeTrace.py diff --git a/grid2kpi/episode/__init__.py b/grid2kpi/episode/__init__.py new file mode 100644 index 0000000..a6cb0b4 --- /dev/null +++ b/grid2kpi/episode/__init__.py @@ -0,0 +1 @@ +from .EpisodeAnalytics import * \ No newline at end of file diff --git a/grid2kpi/episode_analytics/actions_model.py b/grid2kpi/episode/actions_model.py similarity index 100% rename from grid2kpi/episode_analytics/actions_model.py rename to grid2kpi/episode/actions_model.py diff --git a/grid2kpi/episode_analytics/consumption_profiles.py b/grid2kpi/episode/consumption_profiles.py similarity index 100% rename from grid2kpi/episode_analytics/consumption_profiles.py rename to grid2kpi/episode/consumption_profiles.py diff --git a/grid2kpi/episode_analytics/env_actions.py b/grid2kpi/episode/env_actions.py similarity index 100% rename from grid2kpi/episode_analytics/env_actions.py rename to grid2kpi/episode/env_actions.py diff --git a/grid2kpi/episode_analytics/maintenances.py b/grid2kpi/episode/maintenances.py similarity index 100% rename from grid2kpi/episode_analytics/maintenances.py rename to grid2kpi/episode/maintenances.py diff --git a/grid2kpi/episode_analytics/observation_model.py b/grid2kpi/episode/observation_model.py similarity index 100% rename from grid2kpi/episode_analytics/observation_model.py rename to grid2kpi/episode/observation_model.py diff --git a/grid2kpi/episode_analytics/__init__.py b/grid2kpi/episode_analytics/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/setup.py b/setup.py index f098ea3..b6ed0a8 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,10 @@ -from setuptools import setup +from setuptools import setup, find_packages setup(name='Grid2Kpi', - version='0.1.0', - description='Toto', - long_description='Tata', + version='0.1.0-rc3', + description='Grid2Kpi', + long_description='Grid2Kpi', classifiers=[ 'Development Status :: 4 - Beta', 'Programming Language :: Python :: 3.6', @@ -16,7 +16,7 @@ "Natural Language :: English" ], license='MPL', - packages=['grid2kpi'], + packages=['grid2kpi', 'grid2kpi.episode'], include_package_data=True, install_requires=["numpy", "pandas", "pandapower", "Grid2Op", "plotly"], zip_safe=False)