Skip to content

Commit

Permalink
(PR #67) Backend updates
Browse files Browse the repository at this point in the history
* pre-commit: ignore backslash in brackets
* Update plotters w.r.t. pp-parser changes
  • Loading branch information
edan-bainglass authored Jan 30, 2024
1 parent 3e59082 commit f632906
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion aurora/results/plot/presenters/capacity_cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion aurora/results/plot/presenters/capacity_swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion aurora/results/plot/presenters/efficiency_cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit f632906

Please sign in to comment.