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

Revise get_group_by_shank #1055

Merged
merged 3 commits into from
Aug 6, 2024
Merged

Revise get_group_by_shank #1055

merged 3 commits into from
Aug 6, 2024

Conversation

CBroz1
Copy link
Member

@CBroz1 CBroz1 commented Aug 6, 2024

Description

Streamlines logic of get_group_by_shank and adds missing returns #1054

Checklist:

  • No. This PR should be accompanied by a release: (yes/no/unsure)
  • N/a. If release, I have updated the CITATION.cff
  • No. This PR makes edits to table definitions: (yes/no)
  • N/a. If table edits, I have included an alter snippet for release notes.
  • N/a. If this PR makes changes to position, I ran the relevant tests locally.
  • I have updated the CHANGELOG.md with PR number and description.
  • N/a. I have added/edited docs/notebooks to reflect the changes

@CBroz1 CBroz1 linked an issue Aug 6, 2024 that may be closed by this pull request
@samuelbray32
Copy link
Collaborator

Thanks @CBroz1

Since this is already a PR on the topic, would it be alright to only run the delete calls in set_group_by_shank in these locations if there is an entry to delete? Saves time and need to import tables for tracing the restriction graph:

(SortGroup & {"nwb_file_name": nwb_file_name}).delete()

(SortGroup & {"nwb_file_name": nwb_file_name}).delete()

example replacement:

if query := SortGroup & {"nwb_file_name": nwb_file_name}:
    query.delete()

@CBroz1
Copy link
Member Author

CBroz1 commented Aug 6, 2024

Thanks @samuelbray32 - I see what you mean. I think I would rather edit the mixin delete to return early if self & restriction is empty. Can you think of any cases where we wouldn't want that?

@samuelbray32
Copy link
Collaborator

Thanks @samuelbray32 - I see what you mean. I think I would rather edit the mixin delete to return early if self & restriction is empty. Can you think of any cases where we wouldn't want that?

I can't think of a scenario where I would expect a different result calling delete with an empty restricted table. Seems like a better general solution to me!

@edeno edeno merged commit 94aea26 into LorenFrankLab:master Aug 6, 2024
7 checks passed
@CBroz1 CBroz1 deleted the 1054 branch August 6, 2024 21:54
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.

get_group_by shank doesn't return value
3 participants