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 example and CLI to docs #60

Merged
merged 16 commits into from
Feb 5, 2024
Merged

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented Jan 23, 2024

Closes #34.

Changes proposed:

  • Update CLI to write out a text file report.txt with the most common description, when available.
  • Copy one of the docstring examples to a Jupyter notebook in the docs.
    • There are a lot of log messages and formatting in it.
  • Add CLI to the docs.

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (1f4aeea) 86.91% compared to head (d91edca) 89.97%.
Report is 1 commits behind head on main.

Files Patch % Lines
bids/ext/reports/cli.py 86.36% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #60      +/-   ##
==========================================
+ Coverage   86.91%   89.97%   +3.05%     
==========================================
  Files          14       15       +1     
  Lines         688      708      +20     
==========================================
+ Hits          598      637      +39     
+ Misses         90       71      -19     

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

@tsalo
Copy link
Member Author

tsalo commented Jan 23, 2024

Note to self: I broke some stuff, so I'll need to fix it before I can ask for a review.

@Remi-Gau Remi-Gau mentioned this pull request Feb 5, 2024
@tsalo tsalo requested a review from Remi-Gau February 5, 2024 15:19
Comment on lines -113 to +131
report.generate(subject=participant_label)
counter = report.generate(subject=participant_label)
else:
counter = report.generate()

common_patterns = counter.most_common()
if not common_patterns:
LOGGER.warning("No common patterns found.")
else:
report.generate()
with open(output_dir / "report.txt", "w") as f:
f.write(str(counter.most_common()[0][0]))
Copy link
Member Author

Choose a reason for hiding this comment

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

This will write out the most common report to a text file, but only if there's a description to write out.

@tsalo tsalo added the documentation Improvements or additions to documentation label Feb 5, 2024
bids/ext/reports/cli.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Remi-Gau Remi-Gau left a comment

Choose a reason for hiding this comment

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

couple of small things to address here or later

@Remi-Gau
Copy link
Contributor

Remi-Gau commented Feb 5, 2024

good with me

merge at will

thanks @tsalo

@tsalo tsalo merged commit 9fd90ee into bids-standard:main Feb 5, 2024
19 checks passed
@tsalo tsalo deleted the examples-and-cli branch February 5, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CLI to doc
2 participants