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

Add json encoding to fstring autocompletion #686

Merged
merged 6 commits into from
Mar 18, 2024

Conversation

CodyCBakerPhD
Copy link
Collaborator

@CodyCBakerPhD CodyCBakerPhD commented Mar 18, 2024

fix #672

@CodyCBakerPhD CodyCBakerPhD self-assigned this Mar 18, 2024
@CodyCBakerPhD CodyCBakerPhD changed the title Add json encoding fstring Add json encoding to fstring autocompletion Mar 18, 2024
@garrettmflynn
Copy link
Member

Assuming you confirmed that this allows for proper interaction with the test-case defined in the related Issue?

@CodyCBakerPhD
Copy link
Collaborator Author

@garrettmflynn I'm testing it now - it certainly resolves the JSON serialization issue but then triggers other issues - can you give it a look and you probably know better what needs to interact properly

Note that for SpikeGLX prior to latest commit I was able to proceed all the way through and it found the data correctly however I could not test that the session start time makes it through to the final stage because the SpikeGLX session time takes precedence over the f-string one

So I tried again with a copy of the tutorial data renamed along the lines of ..../dataset/mouse2/mouse2_Session2_210324/mouse2_Session2_210324_phy (since Phy doesn't have session start time in the source data) but now it's having trouble both auto identifying locations (gives 'undefined' as the format string after 'succeeding' autocomplete) and manually specifying it makes a weird subject metadata table

@garrettmflynn
Copy link
Member

Updated. Whenever you're encoding into JSON format using a custom encoder, you'll have to reload to an object using json.loads to ensure the object is passed appropriately to the frontend (instead of double-encoded and received as a JSON string after JSON parsing).

@CodyCBakerPhD CodyCBakerPhD marked this pull request as ready for review March 18, 2024 15:52
@CodyCBakerPhD
Copy link
Collaborator Author

@garrettmflynn Working great for me!

@CodyCBakerPhD CodyCBakerPhD enabled auto-merge March 18, 2024 15:52
Copy link
Member

@garrettmflynn garrettmflynn left a comment

Choose a reason for hiding this comment

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

Perfect. Let's get this through

@CodyCBakerPhD CodyCBakerPhD merged commit 83a1407 into main Mar 18, 2024
15 checks passed
@CodyCBakerPhD CodyCBakerPhD deleted the add_json_encoding_fstring branch March 18, 2024 16:10
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.

Error with datetime object in Locate Data, Linux version
2 participants