Skip to content

Minor fixes: setting seed + avoiding index out of bounds for noise array - #210

Merged
caglorithm merged 1 commit into
neurolib-dev:masterfrom
mattiasJohnson:master
Jun 8, 2022
Merged

caglorithm merged 1 commit into
neurolib-dev:masterfrom
mattiasJohnson:master

Conversation

@mattiasJohnson

Copy link
Copy Markdown
Contributor

Two minor things I encountered when working on my thalamus-aln implementation.

Seed not set
Seed given as argument was not set if the constructor called loadDefaultParams()

# Before fix:
model = ThalamicMassModel(seed=42)
print(model.params["seed"])  # --> None

Index out of bounds in noise
noise has the size len(t) whilst i goes over range(startind, startind + len(t)).

@caglorithm

Copy link
Copy Markdown
Member

Thank you for this PR and for finding these issues. Generally speaking, even small changes like that should be split up into different PR's but for this one we can keep it in. Running tests and seeing if everything works, if so, I'll merge!

@codecov

codecov Bot commented Jun 8, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #210 (243602f) into master (0c68752) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #210   +/-   ##
=======================================
  Coverage   94.97%   94.97%           
=======================================
  Files          50       50           
  Lines        4410     4410           
=======================================
  Hits         4188     4188           
  Misses        222      222           
Flag Coverage Δ
unittests 94.97% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
neurolib/models/thalamus/model.py 86.36% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c68752...243602f. Read the comment docs.

@caglorithm
caglorithm merged commit 2e68064 into neurolib-dev:master Jun 8, 2022
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.

2 participants