feat(neuron/netpyne): use %r instead of %e or %s#110
Open
sanjayankur31 wants to merge 11 commits intodevelopmentfrom
Open
feat(neuron/netpyne): use %r instead of %e or %s#110sanjayankur31 wants to merge 11 commits intodevelopmentfrom
%r instead of %e or %s#110sanjayankur31 wants to merge 11 commits intodevelopmentfrom
Conversation
when writing recorded data to file. `%r` or the `repr` function gives the "official" string representation of an object, so of a float too, while the `%s` or `str` method returns the "nicely printable string representation of an object". Also, irrespective of which one we use, we must use the same for both NEURON and NetPyNE.
Member
|
Ok, sounds good. Have you tested some omv tolerance=0 tests when this change is incorporated? May well change the actual value detected in the tests... |
Member
Author
Testing them out now. |
Member
Author
|
Did quick tests on the Allen institute cells. There's some change in tolerances, but not very dramatic: diff --git a/CellTypesDatabase/models/NeuroML2/.test.483108201.jnmlnrn.omt b/CellTypesDatabase/models/NeuroML2/.test.483108201.jnmlnrn.omt
index 5f770ec..d889c20 100644
--- a/CellTypesDatabase/models/NeuroML2/.test.483108201.jnmlnrn.omt
+++ b/CellTypesDatabase/models/NeuroML2/.test.483108201.jnmlnrn.omt
@@ -14,4 +14,4 @@ experiments:
spike detection:
method: threshold
threshold: -20
- tolerance: 0.0141
+ tolerance: 0.014139835945066405
diff --git a/CellTypesDatabase/models/NeuroML2/.test.486556811.jnmlnrn.omt b/CellTypesDatabase/models/NeuroML2/.test.486556811.jnmlnrn.omt
index c1954b8..2a5a36f 100644
--- a/CellTypesDatabase/models/NeuroML2/.test.486556811.jnmlnrn.omt
+++ b/CellTypesDatabase/models/NeuroML2/.test.486556811.jnmlnrn.omt
@@ -14,4 +14,4 @@ experiments:
spike detection:
method: threshold
threshold: -20
- tolerance: 0
+ tolerance: 4.79184638209975e-05
diff --git a/CellTypesDatabase/models/NeuroML2/.test.jnmlnrn.omt b/CellTypesDatabase/models/NeuroML2/.test.jnmlnrn.omt
index e0361c8..4a661bd 100644
--- a/CellTypesDatabase/models/NeuroML2/.test.jnmlnrn.omt
+++ b/CellTypesDatabase/models/NeuroML2/.test.jnmlnrn.omt
@@ -14,7 +14,7 @@ experiments:
spike detection:
method: threshold
threshold: 0
- tolerance: 2.2e-5
+ tolerance: 2.179620615235586e-05
Ca:
observables:
spike times:
@@ -25,4 +25,4 @@ experiments:
spike detection:
method: threshold
threshold: 0.0014
- tolerance: 0.00021
+ tolerance: 0.00020718032716604502
diff --git a/CellTypesDatabase/models/NeuroML2/.test.kv2like.jnmlnrn.omt b/CellTypesDatabase/models/NeuroML2/.test.kv2like.jnmlnrn.omt
index 797aa53..439f91d 100644
--- a/CellTypesDatabase/models/NeuroML2/.test.kv2like.jnmlnrn.omt
+++ b/CellTypesDatabase/models/NeuroML2/.test.kv2like.jnmlnrn.omt
@@ -14,7 +14,7 @@ experiments:
spike detection:
method: threshold
threshold: 0.885
- tolerance: 1e-5
+ tolerance: 3.1032996127945875e-06
h1:
observables:
spike times:
@@ -25,7 +25,7 @@ experiments:
spike detection:
method: threshold
threshold: 0.885
- tolerance: 1e-5
+ tolerance: 8.696556449203658e-06
h2:
observables:
spike times:
@@ -36,4 +36,4 @@ experiments:
spike detection:
method: threshold
threshold: 0.885
- tolerance: 4e-5
+ tolerance: 4.1525039775804706e-05
diff --git a/CellTypesDatabase/models/NeuroML2/.test.nav.jnmlnrn.omt b/CellTypesDatabase/models/NeuroML2/.test.nav.jnmlnrn.omt
index ed785ae..2ab22de 100644
--- a/CellTypesDatabase/models/NeuroML2/.test.nav.jnmlnrn.omt
+++ b/CellTypesDatabase/models/NeuroML2/.test.nav.jnmlnrn.omt
@@ -14,7 +14,7 @@ experiments:
spike detection:
method: threshold
threshold: 0.2
- tolerance: 2e-5
+ tolerance: 4.90571147973973e-06
I4:
observables:
spike times:
@@ -25,4 +25,4 @@ experiments:
spike detection:
method: threshold
threshold: 0.03
- tolerance: 2e-5
+ tolerance: 1.984186110237916e-05
There may be other things in the neuron export I guess? Also worth looking into next? |
…rphology/biophysicalProperties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
when writing recorded data to file.
%ror thereprfunction gives the "official" string representation of an object, so of a float too, while the%sorstrmethod returns the "nicely printable string representation of an object".Also, irrespective of which one we use, we must use the same for both NEURON and NetPyNE so that the outputs to files are of the same level of precision and same format etc.
With this PR, we get similar outputs for NEURON and NetPyNE:
instead of what we got before:
I haven't checked other exports, but if they're also being exported to Python scripts, we should update them too.