Skip to content

Commit

Permalink
(PR #38) hotfixes
Browse files Browse the repository at this point in the history
* Persist workflow steps via `ctx`
* Fix charge integration
* Fix bug in data fetching from remote folder
* Update initiative timeline
  • Loading branch information
edan-bainglass committed Jan 30, 2024
1 parent 9bf7282 commit c265c06
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# aiida-aurora

AiiDA plugin for the Aurora project (autonomous robotic battery innovation platform).
A collaboration between EPFL & Empa, within the BIG-MAP Stakeholder Initiative Call 2021.
A collaboration between EPFL & Empa, within the BIG-MAP Stakeholder Initiative Call 2021-2023.

## Repository contents

Expand Down
2 changes: 1 addition & 1 deletion aiida_aurora/utils/cycling_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def get_data_from_remote(source: RemoteData) -> dict:
The post-processed data dictionary.
"""
try:
remote_path = source.get_attribute("remote_path")
remote_path = source.attributes["remote_path"]
with open(f"{remote_path}/snapshot.json") as file:
return get_data_from_file(file)
except Exception:
Expand Down
11 changes: 6 additions & 5 deletions aiida_aurora/utils/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ def get_data_from_results(array_node) -> dict:
def post_process_data(t: np.ndarray, Ewe: np.ndarray, I: np.ndarray) -> dict:
"""docstring"""

# find half-cycle markers
# add last point if not already a marker
idx = np.where(np.diff(np.sign(I)) != 0)[0]
if (final := len(I) - 1) not in idx:
idx = np.append(idx, final)
mask = I != 0 # filter out zero current
t, Ewe, I = t[mask], Ewe[mask], I[mask]

# mark half-cycles (including first and last values)
idx = np.where(np.diff(np.sign(I), prepend=0) != 0)[0]
idx = np.append(idx, len(I))

# integrate and store charge and discharge currents
Qc, Qd = [], []
Expand Down
6 changes: 3 additions & 3 deletions aiida_aurora/workflows/cycling_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ def define(cls, spec):

def setup_workload(self):
"""Create an ordered list of protocol step names."""
self.worksteps_keynames = list(self.inputs["protocol_order"])
self.ctx.steps = list(self.inputs["protocol_order"])

def has_steps_remaining(self):
"""Check if there is any remaining step."""
return len(self.worksteps_keynames) > 0
return len(self.ctx.steps) > 0

def inspect_cycling_step(self):
"""Verify that the last cycling step finished successfully."""
Expand All @@ -127,7 +127,7 @@ def inspect_cycling_step(self):

def run_cycling_step(self):
"""Run the next cycling step."""
protocol_name = self.worksteps_keynames.pop(0)
protocol_name = self.ctx.steps.pop(0)

inputs = {
'code': self.inputs.tomato_code,
Expand Down

0 comments on commit c265c06

Please sign in to comment.