Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Fix indexed COMPARTMENT block.#1209

Merged
1uc merged 5 commits into
masterfrom
1uc/compartment
Mar 12, 2024
Merged

Fix indexed COMPARTMENT block.#1209
1uc merged 5 commits into
masterfrom
1uc/compartment

Conversation

@1uc

@1uc 1uc commented Mar 8, 2024

Copy link
Copy Markdown
Collaborator

When encountering an indexed COMPARTMENT block:

COMPARTMENT i, volume_expr { species }

All state variables are searched if they match they match the pattern
"{species}[%d]". For each matching state variables, we obtain the
value of the array index and substitute the name of the array index with
its value in volume_expr. This is then stored in the array of
compartment factors.

If multiple species are listed, the above happens for each (array-valued) species.

@codecov-commenter

codecov-commenter commented Mar 8, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 95.34884% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 86.60%. Comparing base (c8818c8) to head (9720681).

❗ Current head 9720681 differs from pull request most recent head ce1ba0b. Consider uploading reports for the commit ce1ba0b to get more accurate results

Files Patch % Lines
src/visitors/kinetic_block_visitor.cpp 94.44% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1209      +/-   ##
==========================================
+ Coverage   86.55%   86.60%   +0.04%     
==========================================
  Files         176      176              
  Lines       13017    13047      +30     
==========================================
+ Hits        11267    11299      +32     
+ Misses       1750     1748       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bbpbuildbot

This comment has been minimized.

@1uc 1uc force-pushed the 1uc/compartment branch from cbcb384 to fa7371b Compare March 8, 2024 11:37
@1uc

1uc commented Mar 8, 2024

Copy link
Copy Markdown
Collaborator Author

We'll want to merge #1206 first.

@bbpbuildbot

This comment has been minimized.

@1uc 1uc marked this pull request as ready for review March 8, 2024 12:34
@1uc 1uc force-pushed the 1uc/compartment branch from fa7371b to 28f75a8 Compare March 8, 2024 13:08
@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@1uc 1uc force-pushed the 1uc/compartment branch from e4bcd4d to 9720681 Compare March 11, 2024 10:15
Comment thread test/unit/visitor/kinetic_block.cpp
@bbpbuildbot

This comment has been minimized.

@matz-e matz-e left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I sort of feel like I've read that std::regex is not too performant, and the use here seems a wee bit excessive. But I guess we don't need to be supremely performant and it is concise.

Comment thread src/visitors/kinetic_block_visitor.cpp Outdated
Comment thread src/visitors/kinetic_block_visitor.cpp
1uc added 5 commits March 12, 2024 10:27
When encountering an indexed `COMPARTMENT` block:

    COMPARTMENT i, volume_expr { species }

All state variables are searched if they match they match the pattern
`"{species}[%d]"`. For each matching state variables, we obtain the
value of the array index and substitute the name of the array index with
its value in `volume_expr`. This is then stored in the array of
compartment factors.
Check that the resulting derivatives are divided by the volume
of the compartment.
@1uc 1uc force-pushed the 1uc/compartment branch from 9720681 to ce1ba0b Compare March 12, 2024 09:29
@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #199851 (:white_check_mark:) have been uploaded here!

Status and direct links:

@1uc 1uc merged commit 219a3ed into master Mar 12, 2024
@1uc 1uc deleted the 1uc/compartment branch March 12, 2024 15:41
ohm314 pushed a commit that referenced this pull request May 21, 2024
When encountering an indexed `COMPARTMENT` block:

    COMPARTMENT i, volume_expr { species }

All state variables are searched if they match they match the pattern
`"{species}[%d]"`. For each matching state variables, we obtain the
value of the array index and substitute the name of the array index with
its value in `volume_expr`. This is then stored in the array of
compartment factors.

Check that the resulting derivatives are divided by the volume
of the compartment.
JCGoran pushed a commit to neuronsimulator/nrn that referenced this pull request Mar 12, 2025
When encountering an indexed `COMPARTMENT` block:

    COMPARTMENT i, volume_expr { species }

All state variables are searched if they match they match the pattern
`"{species}[%d]"`. For each matching state variables, we obtain the
value of the array index and substitute the name of the array index with
its value in `volume_expr`. This is then stored in the array of
compartment factors.

Check that the resulting derivatives are divided by the volume
of the compartment.

NMODL Repo SHA: BlueBrain/nmodl@219a3ed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants