Skip to content
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

[MRG] BUG: Update gid_ranges after using clear_drives #812

Merged
merged 9 commits into from
Jul 10, 2024

Conversation

ntolley
Copy link
Contributor

@ntolley ntolley commented Jul 10, 2024

Currently calling net.clear_drives does not update the Network correctly. This PR adds implements these updates and adds a quick test to ensure the updates are applied.

@gtdang feel free to merge when the checks are green!

@ntolley ntolley requested a review from gtdang July 10, 2024 13:56
@jasmainak jasmainak changed the title [MRG] BUG: Update gid_ranges after using clear_drives [WIP] BUG: Update gid_ranges after using clear_drives Jul 10, 2024
@ntolley ntolley changed the title [WIP] BUG: Update gid_ranges after using clear_drives [MRG] BUG: Update gid_ranges after using clear_drives Jul 10, 2024
doc/whats_new.rst Outdated Show resolved Hide resolved
hnn_core/network.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@gtdang gtdang left a comment

Choose a reason for hiding this comment

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

Added some comments and questions.

conn['src_type'] if conn['src_type'] not
in self.external_drives.keys()]

for cell_type in list(self.gid_ranges.keys()):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably a matter of semantics but are drive names also "cell types"? I think in other parts of the codebase "cell_types" usually just refers to the neocortical cell names? At least the Network["cell_types"] is only those cells. Maybe something like "range_name" would be clearer.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah we have a bit of inconsistency here ... how about calling it cell_name like we do in the rest of the repo. The variable name cell_type and cell_template are a bit interchangeable and confusing

hnn_core/tests/test_drives.py Show resolved Hide resolved
assert 'prox' not in net.external_drives
assert 'prox' not in net.gid_ranges
assert net._n_gids == n_gids

Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps we can test adding a new drive after clearing drives to make sure the Network still works after clearing the drives?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Mostly a check that the ranges and positions are populated as expected after resetting them.

@rythorpe
Copy link
Contributor

FYI, this is updated on @wagdy88's PR #702. Not that we necessarily need to wait for it, but just wanted to put it on your radar.

@gtdang gtdang self-requested a review July 10, 2024 19:23
Copy link
Collaborator

@gtdang gtdang left a comment

Choose a reason for hiding this comment

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

Looks great!

@gtdang gtdang merged commit d0598bc into jonescompneurolab:master Jul 10, 2024
12 checks passed
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.

4 participants