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

handle case of no sample size being reported #792

Merged
merged 2 commits into from
May 17, 2023

Conversation

jdkent
Copy link
Member

@jdkent jdkent commented Apr 29, 2023

Closes # .

Changes proposed in this pull request:

  • fix the conversion of studyset to dataset when sample size is not reported

@codecov
Copy link

codecov bot commented Apr 29, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (4ceb358) 88.92% compared to head (b529294) 88.92%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #792   +/-   ##
=======================================
  Coverage   88.92%   88.92%           
=======================================
  Files          41       41           
  Lines        4856     4859    +3     
=======================================
+ Hits         4318     4321    +3     
  Misses        538      538           
Impacted Files Coverage Δ
nimare/io.py 95.49% <100.00%> (+0.06%) ⬆️
nimare/nimads.py 68.82% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -204,7 +204,7 @@ def __init__(self, source):
self.name = source["name"] or ""
self.authors = source["authors"] or ""
self.publication = source["publication"] or ""
self.metadata = source.get("metadata", {})
self.metadata = source.get("metadata", {}) or {}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't source.get("metadata", {}) default to {} anyway?

Copy link
Member Author

Choose a reason for hiding this comment

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

it was a little bit of a thinker. if I have a study object like so:

{
    "name": "test"
}

then source.get("metadata", {}) will return {}, but if the study object looks like the following:

{
    "name": "test",
    "metadata": null
}

then source.get("metadata", {}) returns None.

Copy link
Member

Choose a reason for hiding this comment

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

ohhh.... that makes sense. Thanks!

@jdkent jdkent merged commit 5f8ba90 into neurostuff:main May 17, 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.

2 participants