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.
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
Network plot #104
Network plot #104
Changes from 21 commits
69979f8
19f1ae4
3c47384
08e4bb5
d32d208
ee58b91
00a578f
17acb22
b473ac3
b388465
132fd55
cea9219
e4582b8
7d0baca
e5d10e8
0693ee6
0b29cad
1066e3d
98f0b42
ad5c5e6
b6d5a13
60ffb6f
7cea8f4
fef14e9
4bd15e6
9fbc539
35e1286
020f658
d3626a1
008e150
54a13cf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, when fetching the population_name from G afterwards, population_name is not used, but cell_id.population_name.
Is it useful to add a population_name to G if you only fetch it from G.cell_id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While plotting the plot in the later step the population name gives the color of the node and it is read from G.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to be sure, do we expect populations to be <= 20 in size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, definitely. The populations here are referring to multiple circuits which is usually <=3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, are we getting the population name property of each node, or are we getting the population of the cell_id in each node? I am asking because at line 42, we are doing the same thing, but the variable is named cell_id.
It would be good to be precise about what we are doing, for readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually line 42 is constructing a
set
and removing the duplicates. This line 49 constructs a list with duplicates.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I know. But what I meant, is that even though in line 42 it is named
cell_id
, and here it is namednode
, it looks like it is the same variable we access. InG
, we have something like this for each node(cell_id, id, population_name)
, and my question is, when we are accessingpopulation_name
, are we getting the population_name in the node (the 3rd element in my set), or are we accessingcell_id.population_name
(via the 1st element in my set).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh thanks, a good catch. The "label" and "population" attributes of the node are never used in G. There is duplicated information. Instead of this:
G.add_node(cell_id, label=str(cell_id.id), population=cell_id.population_name)
we can just write this:
G.add_node(cell_id)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always the 1st element in your set is used, the 3rd is never used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for clarifying
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for noticing, let me write a patch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case you don't want to create fake plots for the legend: https://matplotlib.org/stable/users/explain/axes/legend_guide.html#creating-artists-specifically-for-adding-to-the-legend-aka-proxy-artists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, good to know. In this plot, the former approach avoids the overlaps in legends.
With the patches approach it looks like we need to explicitly specify the location of each legend.