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

Mixin class #692

Merged
merged 7 commits into from
Nov 30, 2023
Merged

Mixin class #692

merged 7 commits into from
Nov 30, 2023

Conversation

CBroz1
Copy link
Member

@CBroz1 CBroz1 commented Nov 21, 2023

Description

Initial implementation of Mixin class is added to any table with an existing fetch_nwb, allowing special cases to override. Mixin uses table definition to decide which table to use. If none is in definition, class must have a table attribute. Is this enough to allow all tables to have the mixin, without tables inadvertently accessing the method?

Checklist:

  • This PR should be accompanied by a release: (yes/no/unsure)
  • (If release) I have updated the CITATION.cff
  • I have updated the CHANGELOG.md
  • I have added/edited docs/notebooks to reflect the changes

Copy link
Collaborator

@edeno edeno left a comment

Choose a reason for hiding this comment

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

I think this general structure makes sense. I wonder if there could be a more informative name of the mixin (SpyglassMixin doesn't exactly tell you what it is doing), but I guess the class is broad enough (fetch nwb, delete) that Spyglass is okay.

@CBroz1
Copy link
Member Author

CBroz1 commented Nov 22, 2023

more informative name

I agree. Happy to rename if you have something else in mind, but I figured it would grow in responsibility over time - fetch_nwb and permission-restricted delete are already diverse enough responsibilities that I thought they would need separate mixins if we wanted informative names

@rly
Copy link
Collaborator

rly commented Nov 23, 2023

I think this is a good idea and will clean up a good amount of code. However, a minor suggestion - I think the class variable nwb_table should start with an underscore or even two, to warn people not to mess with it, e.g., with StateScriptFile.nwb_table = X

@CBroz1 CBroz1 linked an issue Nov 28, 2023 that may be closed by this pull request
@CBroz1 CBroz1 marked this pull request as ready for review November 29, 2023 17:22
@CBroz1 CBroz1 marked this pull request as draft November 29, 2023 17:23
@CBroz1 CBroz1 marked this pull request as ready for review November 29, 2023 18:13
@edeno edeno merged commit 135d808 into LorenFrankLab:master Nov 30, 2023
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.

fetch_nwb mixin class
3 participants