BluePyOpt
BluePyOpt copied to clipboard
Implement LFPy backend
LFPy-related changes
- Added LFPy as a backend for simulation
- Added extracellular efeatures class extraFELFeature that supports computing features from extracellular "template" (avg action potential). Features include:
- "peak_to_valley": duration between negative and positive peak
- "halfwidth": full width alf maximum of negative peak
- "peak_trough_ratio": ratio between peak and trough
- "repolarization_slope": slope from the first peak to baseline
- "recovery_slope": slop from second peak to baseline
- "neg_peak_relative": relative amplitude of negative peaks with respect to max channel
- "pos_peak_relative": relative amplitude of positive peaks with respect to max channel
- "neg_peak_diff": relative timing of negative peaks with respect to max channel
- "pos_peak_diff": relative timing of positive peaks with respect to max channel
- "neg_image": normalized potential at time of negative peak
- "pos_image": normalized potential at time of positive peak
Other changes
- Add
param_dependanciesin parameters - Add
**morhp_modifiers_kwargsto Morphology - Implement
NrnSegmentSectionDistanceScaler(base class also forNrnSegmentSomaDistanceScaler)
The setup.py needs to be updated to include LFPy. Also we will need tests to maintain the test coverage above 90%.
It was not added on purpose to make the LFPy dependency weak. All LFPy imports are local so one can still run normal BPO without having LFPy installed
The setup.py needs to be updated to include LFPy. Also we will need tests to maintain the test coverage above 90%.
It was not added on purpose to make the LFPy dependency weak. All LFPy imports are local so one can still run normal BPO without having LFPy installed
LFP needs to be in an extra require then:
extras_require={
"LFPy": ["LFPy"]
}
yeah that could work!
So it seems LFPy requires mpi4py? Installation seems to fail during the tests. Can we disable mpi4py in LFPy, since I assume we don't need it?
So it seems LFPy requires mpi4py? Installation seems to fail during the tests. Can we disable mpi4py in LFPy, since I assume we don't need it?
Unfortunately it's a requirement: https://github.com/LFPy/LFPy/blob/master/requirements.txt
Could we ask to get it removed from the hard requirements (or to make an extra that doesn't require it?). I'm a bit reluctant to make mpi4py a requirement for the bpopt tests if it is not required.
Could we ask to get it removed from the hard requirements (or to make an extra that doesn't require it?). I'm a bit reluctant to make mpi4py a requirement for the bpopt tests if it is not required.
https://github.com/LFPy/LFPy/issues/429
@alejoe91 If you agree, I will rollback the changes to parameters,py and parameterscalers.py. We were using them for the Hallermann model but it is not use anymore. It will also require us to do some changes on the multimodal fitting repo such as removing https://github.com/alejoe91/multimodalfitting/blob/cb49b63d0e76433448b9e4ca6ca825cf74598ffa/multimodalfitting/models/model.py#L305
@alejoe91 thinking about it more, it might be useful for someone else some day. I am not sure what should be done.
I think we still use them for the AIS!
It doesn't look like it: https://github.com/alejoe91/multimodalfitting/blob/master/cell_models/hay_ais/parameters.json
in the exp models: https://github.com/alejoe91/multimodalfitting/blob/master/cell_models/cell1_211011_3436/parameters.json#L656-L670
I'll fix the typos
in the exp models: https://github.com/alejoe91/multimodalfitting/blob/master/cell_models/cell1_211011_3436/parameters.json#L656-L670
Maybe I misunderstood, but that still works with vanilla BPO as it does not use a parameter dependency.
in the exp models: https://github.com/alejoe91/multimodalfitting/blob/master/cell_models/cell1_211011_3436/parameters.json#L656-L670
Maybe I misunderstood, but that still works with vanilla BPO as it does not use a parameter dependency.
Maybe you are right! We just need to test that both the hay and the experimental models un fine.
@anilbey thank for your comments. We are patching this PR on the side. maybe wait a bit before reviewing the code more.
Hi @alejoe91, @wvangeit; as mpi4py appeared to be a problem, I've made a PR to LFPy (https://github.com/LFPy/LFPy/pull/433) that removes this package dependency altogether (by using similar MPI communication provided via neuron.h.ParallelContext()). Seems to work in my own testing but it should be tested also with this PR before merging.
There are just some formatting issues at the moment.
I think the formatting issues have been solved in the master branch of BlueBrain/BluePyOpt. So a merge branch 'master' into 'lfpy' should solve them.
Codecov Report
Merging #385 (1e56736) into master (519b2fc) will decrease coverage by
0.69%. The diff coverage is86.18%.
@@ Coverage Diff @@
## master #385 +/- ##
==========================================
- Coverage 89.53% 88.84% -0.70%
==========================================
Files 34 35 +1
Lines 2361 2977 +616
==========================================
+ Hits 2114 2645 +531
- Misses 247 332 +85
| Impacted Files | Coverage Δ | |
|---|---|---|
| bluepyopt/ephys/morphologies.py | 96.51% <75.00%> (+0.12%) |
:arrow_up: |
| bluepyopt/ephys/stimuli.py | 95.23% <76.66%> (-4.77%) |
:arrow_down: |
| bluepyopt/ephys/models.py | 86.36% <78.81%> (-4.74%) |
:arrow_down: |
| bluepyopt/ephys/simulators.py | 86.95% <80.64%> (-2.33%) |
:arrow_down: |
| bluepyopt/ephys/efeatures.py | 85.45% <83.06%> (-4.09%) |
:arrow_down: |
| bluepyopt/ephys/parameters.py | 88.46% <83.33%> (-1.34%) |
:arrow_down: |
| bluepyopt/ephys/responses.py | 86.66% <87.50%> (+0.30%) |
:arrow_up: |
| bluepyopt/ephys/parameterscalers.py | 91.13% <88.57%> (-0.39%) |
:arrow_down: |
| bluepyopt/ephys/protocols.py | 83.44% <93.33%> (+0.46%) |
:arrow_up: |
| bluepyopt/ephys/recordings.py | 97.22% <94.44%> (-2.78%) |
:arrow_down: |
| ... and 3 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Should we merge this, @alejoe91 @DrTaDa @AurelienJaquier ?
Yes !