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 validation to tests #310

Merged
merged 11 commits into from
Jan 7, 2025

Conversation

bendichter
Copy link
Contributor

@bendichter bendichter commented Dec 8, 2024

I added some json schema validation to the tests and found a few minor discrepancies in the json schema

Copy link

codecov bot commented Dec 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.46%. Comparing base (26a7d33) to head (18a982a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #310      +/-   ##
==========================================
+ Coverage   89.42%   89.46%   +0.04%     
==========================================
  Files          10       11       +1     
  Lines        1891     1899       +8     
==========================================
+ Hits         1691     1699       +8     
  Misses        200      200              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bendichter
Copy link
Contributor Author

Here I just added a line to each of the tests. This works, but there might be a more elegant solution, for example to use parameterized tests. Feel free to refactor for style

@bendichter
Copy link
Contributor Author

@samuelgarcia , @alejoe91

@@ -26,10 +26,10 @@
"annotations": {
"type": "object",
"properties": {
"name": { "type": "string" },
"model_name": { "type": "string" },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure about this name change. Both "name" and "model_name" are present as metadata, and neither required by the probe object. Should we make it required here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want the json_schema to map perfectly onto the Probe object, or might it make sense of have them hav slightly different requirements?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @bendichter

I think it makes sense to have model_name and not name as required. name is a custom name that can be defined for a probe (e.g., ProbeA-B-C for Open Ephys system), but definitely not a requirement.

@samuelgarcia
Copy link
Member

thanks a lot Ben. I will have a look.

Copy link
Member

@alejoe91 alejoe91 left a comment

Choose a reason for hiding this comment

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

Added also tests for Open Ephys and SpikeGadgets, so testing is complete :)

@alejoe91 alejoe91 merged commit e39afea into SpikeInterface:main Jan 7, 2025
3 checks passed
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.

3 participants