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

First attribute read as log_export in fetch_nwb #1173

Closed
samuelbray32 opened this issue Oct 31, 2024 · 1 comment · Fixed by #1164
Closed

First attribute read as log_export in fetch_nwb #1173

samuelbray32 opened this issue Oct 31, 2024 · 1 comment · Fixed by #1164
Assignees
Labels
bug Something isn't working common

Comments

@samuelbray32
Copy link
Collaborator

Describe the bug

  • A log_export option was added to the SpyglassMixin.fetch_nwb()
  • If a function call does not explicitly pass a value for log_export, the first vallue in attrs it passes (if any) is taken as the log_export argument, leading to errors later
    • So far this only caused an issue for me when getting data from DLCV1 which passes a list of attrs in its fetch_nwb call

To Reproduce

from spyglass.position.v1 import DLCPosV1
key = {'nwb_file_name': 'Bilbo20230802_.nwb', 'epoch': 2, 'interval_list_name': 'pos 1 valid times'}
key = (DLCPosV1() & key).fetch("KEY")
(DLCPosV1() & key).fetch_nwb()

Solution
Make log_export part of the kwargs and assign a default value in the function

@samuelbray32 samuelbray32 added bug Something isn't working common labels Oct 31, 2024
@samuelbray32 samuelbray32 self-assigned this Oct 31, 2024
@samuelbray32
Copy link
Collaborator Author

Sorry, this issue isn't part of the master branch yet. Relevant fix needed in the #1164 PR

CBroz1 added a commit to CBroz1/spyglass that referenced this issue Oct 31, 2024
@CBroz1 CBroz1 linked a pull request Oct 31, 2024 that will close this issue
7 tasks
edeno pushed a commit that referenced this issue Nov 6, 2024
* WIP: export fixes, mro issues

* WIP: Add one-time log of fetch/restr. Join issues

* ✅ : Export logging on join, update doc

* pre-commit mdformat

* Add flags to permit disable export log in fetch call><

* Use cache to avoid dupe entries. Mod Notebook

* Incorporate feedback from @samuelbray32

* Balance parens

* Remove redundant parens

* Init table in join

* Update src/spyglass/utils/mixins/export.py

Co-authored-by: Samuel Bray <[email protected]>

* Include externals

* #1173

* Add hex-blob arg to mysqldump

* Revert pytest defaults

---------

Co-authored-by: Samuel Bray <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working common
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant