Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Fix empty list in reports #51

Merged
merged 2 commits into from
Apr 8, 2020
Merged

Fix empty list in reports #51

merged 2 commits into from
Apr 8, 2020

Conversation

tomdele
Copy link
Contributor

@tomdele tomdele commented Apr 8, 2020

* this is a temporary solution until
  BlueBrain/libsonata#84 is done
@tomdele tomdele requested review from wizmer and asanin-epfl April 8, 2020 14:32
@codecov-io
Copy link

codecov-io commented Apr 8, 2020

Codecov Report

Merging #51 into master will not change coverage by %.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #51   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         1146      1151    +5     
=========================================
+ Hits          1146      1151    +5     
Impacted Files Coverage Δ
bluepysnap/frame_report.py 100.00% <100.00%> (ø)
bluepysnap/spike_report.py 100.00% <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 5147443...f920953. Read the comment docs.

Comment on lines 215 to 218
if group == []:
# Only solution to return an empty list from self._frame_population.get
# see: https://github.com/BlueBrain/libsonata/issues/84
return np.array([-2])
Copy link
Contributor

Choose a reason for hiding this comment

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

You could define

def empty_list():
    '''Only solution to return an empty list from self._frame_population.get
       see: https://github.com/BlueBrain/libsonata/issues/84
    '''
   return np.array([-2])

And use it everywhere, so that you won't have to look for np.array([-2]) the day you need to fix it, and you don't need to rewrite the comment everytime you need it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes why not.

@tomdele tomdele merged commit e1589b5 into master Apr 8, 2020
@tomdele tomdele deleted the fix_report_query branch April 9, 2020 08:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants