From a0a408fe3b69a2830bf3d1da7506b3d534e29240 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 19 Sep 2023 11:10:23 +0200 Subject: [PATCH] Fix flaxe8 issues --- etrago/tools/io.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etrago/tools/io.py b/etrago/tools/io.py index 58878670..02fa6fb8 100644 --- a/etrago/tools/io.py +++ b/etrago/tools/io.py @@ -171,7 +171,7 @@ def configure_timeindex(self): ) ) - self.timeindex = timeindex[self.start_snapshot - 1 : self.end_snapshot] + self.timeindex = timeindex[self.start_snapshot - 1: self.end_snapshot] def id_to_source(self): ormclass = self._mapped["Source"] @@ -290,7 +290,7 @@ def series_fetch_by_relname(self, network, name, pypsa_name): vars()[f"egon_etrago_{name.lower()}_timeseries"], index_col ), getattr(vars()[f"egon_etrago_{name.lower()}_timeseries"], col)[ - self.start_snapshot : self.end_snapshot + self.start_snapshot:self.end_snapshot ], ).filter( vars()[f"egon_etrago_{name.lower()}_timeseries"].scn_name @@ -501,7 +501,7 @@ def results_to_oedb(session, network, args, grid="hv", safe_results=False): print("Uploading results to db...") # get last result id and get new one last_res_id = session.query(max(ResultMeta.result_id)).scalar() - if last_res_id == None: + if last_res_id is None: new_res_id = 1 else: new_res_id = last_res_id + 1