Skip to content

Stop copying Dirichlet csv rows and fix the warning's expected count - #73

Merged
drbergman merged 1 commit into
my-physicellfrom
claude/dirichlet-csv-row-copies-my-physicell
Aug 21, 2026
Merged

drbergman merged 1 commit into
my-physicellfrom
claude/dirichlet-csv-row-copies-my-physicell

Conversation

@drbergman

Copy link
Copy Markdown
Owner

The my-physicell counterpart of #72. Note up front that the two defects #72 fixes have no direct counterpart here: sync_substrate_dirichlet_activation, the fix_/unfix_substrate_at_voxel(s) family and find_existing_density_index are all new on dc-rework and don't exist on this branch, so there is no mesh-copying loop and no split error policy to unify. What does correspond is in the Dirichlet-from-file reader.

get_row_from_dirichlet_condition_csv took line and substrate_indices by value, copying a string and heap-allocating a vector for every row of the file; both are now const&. This is the same change #69 makes to the substrate reader's twin signature, and it touches a different function, so the two shouldn't collide.

The "wrong number of density data" warning in that function printed number_of_voxels() where it means number_of_densities()Found is a count of substrate columns, and load_dirichlet_conditions_from_matlab's equivalent message already uses the density count. Worth knowing: that warning is unreachable today. In the header-less branch of load_dirichlet_conditions_from_csv, i is never incremented past the continue, so substrate_indices ends up empty, and the re-opened std::ifstream file shadows the outer one and dies at the end of the block, leaving the outer stream closed. A header-less DC csv therefore sets nothing at all, silently. That is the Dirichlet twin of the header-less path #69 revives for substrates, and it is still missing — happy to do it as a follow-up if you want it in this round.

get_row_from_dirichlet_condition_csv took line and substrate_indices by
value, copying a string and a vector for every row of the file. Take both
by const reference, matching the substrate reader.

The "wrong number of density data" warning printed number_of_voxels()
where it means number_of_densities(); Found is a count of substrate
columns, and the matlab loader's equivalent message already uses the
density count.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 21, 2026 15:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@drbergman
drbergman merged commit 69597f4 into my-physicell Aug 21, 2026
81 of 208 checks passed
@drbergman
drbergman deleted the claude/dirichlet-csv-row-copies-my-physicell branch August 21, 2026 15:38
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