diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8e8241dc..2243a99e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -50,8 +50,9 @@ repos: hooks: - id: flake8 # E501 - line length limit + # E502 - backslash in brackets # E741 - ambiguous variable name, used sparsely when appropriate - args: ["--ignore=E501,E741"] + args: ["--ignore=E501,E502,E741"] exclude: *exclude_files - repo: https://github.com/pre-commit/mirrors-mypy diff --git a/aurora/results/plot/presenters/capacity_cycle.py b/aurora/results/plot/presenters/capacity_cycle.py index 245881f9..1490e023 100644 --- a/aurora/results/plot/presenters/capacity_cycle.py +++ b/aurora/results/plot/presenters/capacity_cycle.py @@ -70,7 +70,7 @@ def __init__( def extract_data(self, dataset: dict) -> tuple: """docstring""" y = dataset["Qd"] - x = np.arange(len(y)) + x = dataset["cycle-number"] return (x, y) def plot_series(self, eid: int, dataset: dict) -> None: diff --git a/aurora/results/plot/presenters/capacity_swarm.py b/aurora/results/plot/presenters/capacity_swarm.py index 6f48d981..7fb709e6 100644 --- a/aurora/results/plot/presenters/capacity_swarm.py +++ b/aurora/results/plot/presenters/capacity_swarm.py @@ -138,7 +138,10 @@ def extract_data(self, dataset: dict) -> pd.DataFrame: label, _ = self.get_series_properties(eid) weight = self.model.get_weight(eid, self.view.electrode.value) factor = 1 / weight - for cycle, capacity in enumerate(data["Qd"][:num_cycles]): + for cycle, capacity in zip( + data["cycle-number"][:num_cycles], + data["Qd"][:num_cycles], + ): df_dict["hue"].append(label) df_dict[self.X_LABEL].append(cycle) df_dict[self.Y_LABEL].append(capacity * factor) diff --git a/aurora/results/plot/presenters/efficiency_cycle.py b/aurora/results/plot/presenters/efficiency_cycle.py index d1441e40..fcee3e68 100644 --- a/aurora/results/plot/presenters/efficiency_cycle.py +++ b/aurora/results/plot/presenters/efficiency_cycle.py @@ -60,7 +60,7 @@ def extract_data(self, dataset: dict) -> tuple: min_length = min(len(Qc), len(Qd)) Qc = Qc[:min_length] Qd = Qd[:min_length] - x = np.arange(min_length) + x = dataset["cycle-number"][:min_length] y = Qd / Qc return (x, y)