Skip to content

Commit

Permalink
Merge pull request #42 from ericfell/issue-38-str-enum
Browse files Browse the repository at this point in the history
Issue 38: Fix failed test due to CPython str/enum behavior change
  • Loading branch information
jeremyfell authored Jun 11, 2024
2 parents f6852fe + 8d2fa59 commit d0d22e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python 3.10
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
Expand Down
6 changes: 3 additions & 3 deletions src/rfbzero/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def update_concentrations(i: float) -> tuple[dict[str, float], dict[str, float]]
@staticmethod
def _end_protocol(results: CyclingResults, end_status: CyclingStatus) -> CyclingResults:
"""Records the status that ended the simulation and logs the time."""
print(f'Simulation stopped after {results.steps} time steps: {end_status}.')
print(f'Simulation stopped after {results.steps} time steps: {end_status.value}.')
results.end_status = end_status
results._finalize()
return results
Expand Down Expand Up @@ -738,7 +738,7 @@ def get_cycle_mode(charge: bool) -> _ConstantCurrentCycleMode:
raise ValueError(cycling_status)

cycle_name = 'charge' if self.charge_first else 'discharge'
print(f'Skipping to {cycle_name} cycle: {cycling_status}')
print(f'Skipping to {cycle_name} cycle: {cycling_status.value}')
cycling_status = CyclingStatus.NORMAL

while cycling_status == CyclingStatus.NORMAL:
Expand Down Expand Up @@ -983,7 +983,7 @@ def get_cv_cycle_mode(
cycling_status = cycle_mode.validate()
is_cc_mode = cycling_status == CyclingStatus.NORMAL
if not is_cc_mode:
print(f'Skipping to CV cycling: {cycling_status}')
print(f'Skipping to CV cycling: {cycling_status.value}')
cv_current = self.current_charge if self.charge_first else self.current_discharge
cycle_mode = get_cv_cycle_mode(self.charge_first, cv_current)
cycling_status = cycle_mode.validate()
Expand Down

0 comments on commit d0d22e9

Please sign in to comment.