Skip to content

Fixes from main branch#35

Merged
TiNezlobinsky merged 3 commits into
developfrom
main
May 7, 2026
Merged

Fixes from main branch#35
TiNezlobinsky merged 3 commits into
developfrom
main

Conversation

@TiNezlobinsky
Copy link
Copy Markdown
Collaborator

No description provided.

@TiNezlobinsky TiNezlobinsky requested a review from Copilot May 7, 2026 09:15
@TiNezlobinsky TiNezlobinsky merged commit e61d40b into develop May 7, 2026
6 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR syncs fixes from the main branch by centralizing state-array allocation in the core CardiacModel.initialize() and updating CPU-wave model initializers accordingly, while also re-enabling/refreshing the 2D propagation regression tests with a lighter stimulation protocol.

Changes:

  • Move _allocate_state_arrays() into finitewave.core.model.CardiacModel.initialize().
  • Remove redundant _allocate_state_arrays() calls from multiple CPU-wave model initialize() implementations (and add short docstrings in a few).
  • Replace the previously commented-out 2D propagation test module with active propagation tests and updated expected speeds.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_propagation_2d.py Re-enables 2D propagation tests and introduces shared helpers for model setup, run, and wave-speed estimation.
finitewave/core/model/cardiac_model.py Centralizes state-array allocation in the base model initialization flow.
finitewave/cpuwave/model/aliev_panfilov.py Removes redundant state allocation in initialize() after base initialization change.
finitewave/cpuwave/model/barkley.py Removes redundant state allocation in initialize() and adds a short initialize() docstring.
finitewave/cpuwave/model/bueno_orovio.py Removes redundant state allocation in initialize().
finitewave/cpuwave/model/courtemanche.py Removes redundant state allocation in initialize() and adds a short initialize() docstring.
finitewave/cpuwave/model/fenton_karma.py Removes redundant state allocation in initialize().
finitewave/cpuwave/model/luo_rudy_91.py Removes redundant state allocation in initialize() and adds a short initialize() docstring.
finitewave/cpuwave/model/mitchell_schaeffer.py Removes redundant state allocation in initialize().
finitewave/cpuwave/model/ten_tusscher_panfilov_2006.py Removes redundant state allocation in initialize() and adds a short initialize() docstring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +2
import os
import shutil
Comment on lines +20 to +24
t_calc : float
Time after the last preconditioning beat to continue recording (ms or model units).
t_prebeats : float
Interval between preconditioning stimuli (ms or model units).
dt : float
Comment on lines +41 to +46
model = model_class()
model.dt = dt
model.dr = dr
model.t_max = 1*t_prebeats + t_calc
model.cardiac_tissue = tissue
model.stim_sequence = stim_sequence
Comment on lines +63 to +67
Returns
-------
output : np.ndarray
Time series of membrane potential for a specific cell.
"""
Comment on lines +96 to +98
time_diffs = np.diff(activation_times, axis=0)

assert np.all(np.isfinite(time_diffs)), "Activation times contain NaN or inf"
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants