BlueBrain / BlueCelluLab

Biologically detailed neural network simulations and analysis API
https://bluecellulab.readthedocs.io/en/latest/
Other
8 stars 12 forks source link

injecting a sequence of stimuli on the same cell in isolation #151

Closed anilbey closed 3 months ago

anilbey commented 3 months ago

Module that enables injecting a stimulus with a sequence of amplitude values.

Changes

codecov-commenter commented 3 months ago

Codecov Report

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

Project coverage is 91.16%. Comparing base (8bfa9b5) to head (94d6766).

Files Patch % Lines
bluecellulab/cell/core.py 94.11% 2 Missing :warning:
bluecellulab/analysis/inject_sequence.py 98.24% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #151 +/- ## ========================================== + Coverage 90.86% 91.16% +0.30% ========================================== Files 89 93 +4 Lines 5320 5480 +160 ========================================== + Hits 4834 4996 +162 + Misses 486 484 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

stefanoantonel commented 3 months ago

When I try to pass section parameter to apply_multiple_step_stimuli function

https://github.com/BlueBrain/BlueCelluLab/blob/sequence-stim/bluecellulab/analysis/inject_sequence.py#L78

I get an error cannot pickle 'nrn.Section' object

Screenshot 2024-03-19 at 10 48 24

Using the simple

cell = create_ball_stick()
stefanoantonel commented 3 months ago

Also this is more like a question...

If I iterate over the responses

    for stimulus, recording in responses.items():
        print(len(recording.time))

the length is not the same for all of them. 🤔 I was trying to create a matrix to send to the UI and I need all the vectors (voltage) to be the same length.

Is this difference of the len a bug or something intentional?

anilbey commented 3 months ago

When I try to pass section parameter to apply_multiple_step_stimuli function

Good. Thanks for reporting this. Yes, NEURON objects are not pickleable. There are solutions to overcome it. I will try to see which one suits this usage the best.

anilbey commented 3 months ago

the length is not the same for all of them. 🤔

Yes, it is because the NEURON simulator is using a performance trick (called variable time step) to report the result upon seeing changes in the response. It can be disabled. Shall I disable it here since you need to put the data in a matrix?

stefanoantonel commented 3 months ago

Yes, it is because the NEURON simulator is using a performance trick (called variable time step) to report the result upon seeing changes in the response. It can be disabled. Shall I disable it here since you need to put the data in a matrix?

I don't think it is necessary for now., there are a lot of changes that I need to make on the UI part. If there is any issue, I'll let. you know

stefanoantonel commented 3 months ago

Amazing job Anil!

Thanks a lot

Let's merge :)