-
Notifications
You must be signed in to change notification settings - Fork 10
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
added logging output and description #96
Conversation
WalkthroughThe changes add logging capabilities to two modules. In the commands module, logging statements have been inserted within the batch correction routine to note key steps, and the command’s docstring and decorator have been enhanced with clearer descriptions and a short help. In the file utilities module, the logging module is imported and a log statement is added to record the creation of an AnnData object. The core logic and execution flow remain unchanged. Changes
Possibly related PRs
Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
ibaqpy/ibaq/file_utils.py (1)
108-109
: Consider adjusting the logging level and format.
- For large AnnData objects, logging at INFO level might be too verbose. Consider using DEBUG level instead.
- The newline character in the format string might affect log parsing.
Apply this diff to improve the logging:
- logging.info(f"Created AnnData object:\n {adata}") + logging.debug(f"Created AnnData object: {adata}")ibaqpy/commands/correct_batches.py (1)
109-109
: Enhance logging messages with more context.The logging statements could provide more detailed information about the process:
- Include the pattern when logging file loading
- Include the batch correction parameters
- Include the output path when logging AnnData export
- Include summary statistics in the completion message
Apply this diff to improve the logging messages:
- logging.info(f"Loading iBAQ data from TSV files in folder '{folder}'") + logging.info(f"Loading iBAQ data from TSV files in folder '{folder}' with pattern '{pattern}'") - logging.info("Applying batch correction to iBAQ values") + logging.info(f"Applying batch correction to iBAQ values for {len(batch_ids)} batches") - logging.info("Exporting raw and corrected iBAQ values to an AnnData object") + logging.info(f"Exporting raw and corrected iBAQ values to AnnData object at {adata_filename}") - logging.info("Batch correction completed...") + logging.info(f"Batch correction completed. Processed {len(df_ibaq)} samples across {len(batch_ids)} batches")Also applies to: 132-132, 159-159, 176-176
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
ibaqpy/commands/correct_batches.py
(6 hunks)ibaqpy/ibaq/file_utils.py
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: build
🔇 Additional comments (4)
ibaqpy/ibaq/file_utils.py (2)
2-2
: LGTM!The logging module import is correctly placed with other standard library imports.
1-110
: Verify logging configuration.Ensure that logging is properly configured at the application level to handle these log messages effectively.
Run this script to check for logging configuration:
🧰 Tools
🪛 Ruff (0.8.2)
78-78: No explicit
stacklevel
keyword argument found(B028)
99-99: No explicit
stacklevel
keyword argument found(B028)
ibaqpy/commands/correct_batches.py (2)
1-1
: LGTM!The logging module import is correctly placed at the top with other standard library imports.
181-181
: LGTM!The command decorator and docstring improvements enhance clarity and usability:
- Short help description is concise and informative
- Docstring clearly explains the command's functionality
Also applies to: 254-260
PR Type
Enhancement, Documentation
Description
Added logging outputs for key operations in batch correction.
Enhanced command-line interface with a short help description.
Improved documentation for the
correct_batches
command.Logged metadata creation in AnnData object utility.
Changes walkthrough 📝
correct_batches.py
Added logging and improved CLI documentation
ibaqpy/commands/correct_batches.py
correct-batches
command.correct_batches
command.file_utils.py
Logged metadata creation in AnnData utility
ibaqpy/ibaq/file_utils.py
Summary by CodeRabbit