Skip to content

Commit

Permalink
generalize DecodingParameters fetch1
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelbray32 committed Nov 26, 2024
1 parent e66a8af commit 5e1d26d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/spyglass/decoding/v1/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,20 @@ def fetch(self, *args, **kwargs):
def fetch1(self, *args, **kwargs):
"""Return one decoding paramset as a class."""
row = super().fetch1(*args, **kwargs)
row["decoding_params"] = restore_classes(row["decoding_params"])

if len(args) == 0:
row["decoding_params"] = restore_classes(row["decoding_params"])
return row

if "decoding_params" in args:
if len(args) == 1:
return restore_classes(row)
row = list(row)
row[args.index("decoding_params")] = restore_classes(
row[args.index("decoding_params")]
)
return tuple(row)

return row


Expand Down

0 comments on commit 5e1d26d

Please sign in to comment.