Skip to content

Add noise stimuli in StimulusFactory #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Feb 28, 2025
Merged

Conversation

ilkilic
Copy link
Collaborator

@ilkilic ilkilic commented Feb 19, 2025

  • adds StepNoise, ShotNoise, and OrnsteinUhlenbeck in StimulusFactory with support for both amplitude-based and threshold-based calculation
  • adds threshold-based support for Ramp
  • updates the example notebook 5-stimuli to showcase all stimuli
  • refactores factory.py
  • adds unit-tests

@ilkilic ilkilic self-assigned this Feb 19, 2025
Copy link

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 98.09524% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
bluecellulab/stimulus/factory.py 88.88% 5 Missing ⚠️
bluecellulab/stimulus/stimulus.py 98.81% 3 Missing ⚠️
Files with missing lines Coverage Δ
bluecellulab/analysis/inject_sequence.py 97.61% <100.00%> (ø)
bluecellulab/cell/injector.py 95.30% <100.00%> (ø)
tests/test_stimulus/test_factory.py 100.00% <100.00%> (ø)
tests/test_stimulus/test_stimulus.py 100.00% <100.00%> (ø)
bluecellulab/stimulus/stimulus.py 98.81% <98.81%> (ø)
bluecellulab/stimulus/factory.py 91.11% <88.88%> (ø)

@darshanmandge
Copy link
Collaborator

There are some lines in stimulus/factory.py for which codecov complains are not covered tests. Add only if necessary.:).

@ilkilic
Copy link
Collaborator Author

ilkilic commented Feb 21, 2025

@AurelienJaquier Thanks! I have standardised parameter names across all protocols to consistently use standard deviation (sigma) instead of variance:

  • amp_mean → mean
  • amp_var → sigma
  • variance → sigma
  • sd_percent → sigma_percent

And I have added pre_delay and post_delay to replace the hardcoded zero delays

@darshanmandge
Copy link
Collaborator

Regarding argument names: I hope you have used the names to same as in neurodamus and sonata-extension.

For this comment, I see these type warnings when I "Load diff" for stimulus.py and factory.py:
image

Copy link
Collaborator

@AurelienJaquier AurelienJaquier left a comment

Choose a reason for hiding this comment

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

looks good to me!

@ilkilic
Copy link
Collaborator Author

ilkilic commented Feb 28, 2025

@darshanmandge

Regarding argument names: I hope you have used the names to same as in neurodamus and sonata-extension.

We decided to unify them in the factory but the the circuit stimulus class uses the same argument names as in Neurodamus

And for the Codecov comment, I tried to increase the test coverage as much as possible

Copy link
Collaborator

@darshanmandge darshanmandge left a comment

Choose a reason for hiding this comment

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

Thanks @ilkilic ! 🎉 Let's other remaining stimuli from neurodamus in new PRs.

@ilkilic ilkilic merged commit a1fd08d into main Feb 28, 2025
8 checks passed
@ilkilic ilkilic deleted the add-factory-noise-stimulus branch February 28, 2025 09:03
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.

3 participants