-
Notifications
You must be signed in to change notification settings - Fork 20
Develop #102
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
Conversation
…` to `highlight`
…7 name representation functions.
Summary of ChangesHello @egenn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on a significant refactoring effort to enhance and standardize the package's text formatting and object representation utilities. The primary goal is to improve code maintainability and consistency by renaming a key formatting function, introducing more flexible padding options, and streamlining how S7 object names are displayed. These changes ensure a more uniform and robust approach to console output and internal string manipulation. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request appears to be a significant refactoring effort focused on improving code consistency and maintainability. Key changes include renaming show_ls to repr_ls throughout the project for better S7 compatibility, centralizing text formatting for colors and padding by enhancing the fmt function, and simplifying the repr_S7name function. These changes are applied consistently across code, documentation, and tests. The refactoring is well-executed, but I've identified one minor issue where a function argument is not being used as intended.
|
/gemini review |
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.
Code Review
This pull request introduces several improvements and refactorings. The renaming of show_ls to repr_ls is a good change for clarity, though it is a breaking change for other packages in the ecosystem that might use this internal-but-exported function. The formatting functions have been enhanced, for example by adding a pad argument to fmt and highlight, which is a nice improvement. A new generic preprocessed has been added, which seems useful. I've found several instances where the new highlight function is redundantly wrapped in bold(). I've added comments with suggestions to remove the redundancy and in one case, to use the new pad argument for cleaner code.
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.
Pull request overview
This PR implements several refactoring improvements and API enhancements focused on code clarity, consistency, and maintainability. The changes include renaming functions for better naming conventions, removing unused code, standardizing styling functions, and adding new functionality for accessing preprocessed data.
Key changes:
- Renamed
show_ls()torepr_ls()to better reflect that it returns a string representation rather than printing - Replaced
thin()withgray()andbold(green())withhighlight()for more semantic and consistent styling - Added new
preprocessed()generic function to provide cleaner API access to preprocessed data from Preprocessor objects
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| DESCRIPTION | Updated package version to 0.99.1005 and date to 2025-11-25 |
| NAMESPACE | Updated exports: removed show_ls, added repr_ls and preprocessed |
| R/00_S7_init.R | Added new preprocessed() generic function definition |
| R/01_S7_Hyperparameters.R | Updated function calls from show_ls() to repr_ls() and improved field documentation |
| R/02_S7_Metrics.R | Replaced show_ls() calls with repr_ls() |
| R/03_S7_Preprocessor.R | Added preprocessed() method for Preprocessor and updated show_ls() to repr_ls() |
| R/05_S7_Tuner.R | Updated show_ls() to repr_ls() |
| R/06_S7_Supervised.R | Clarified comment from "Refs & Res" to "References" |
| R/08_S7_ClusteringConfig.R | Replaced show_ls() with repr_ls() |
| R/09_S7_Clustering.R | Replaced show_ls() with repr_ls() |
| R/10_S7_DecompositionConfig.R | Updated show_ls() to repr_ls() |
| R/11_S7_Decomposition.R | Updated show_ls() to repr_ls() |
| R/14_S7_utils.R | Replaced bold(green()) with highlight() |
| R/fmt.R | Added pad parameter to fmt() and highlight(), changed gray() to use explicit hex color, refactored to use intermediate variable |
| R/msg.R | Removed redundant gray() call in msgdatetime() |
| R/read.R | Replaced bold(green()) with highlight() throughout |
| R/rtemis_color_system.R | Reordered variable assignments (no functional change) |
| R/utils_art.R | Replaced thin() with gray() for more semantic styling |
| R/utils_data.table.R | Replaced bold(green()) with highlight() and show_ls() with repr_ls() |
| R/utils_duckdb.R | Replaced bold(green()) with highlight() |
| R/utils_print.R | Renamed show_ls() to repr_ls(), removed unused printchar() function, replaced thin() with gray() |
| R/utils_strings.R | Updated function signature for repr_S7name() (replaced colors/verbosity with col/prefix), removed unused leftpad() function |
| man/fmt.Rd | Added pad parameter to documentation |
| man/highlight.Rd | Added pad parameter to documentation |
| man/preprocessed.Rd | New documentation file for preprocessed() generic |
| man/repr_S7name.Rd | Updated parameter documentation to reflect API changes |
| man/repr_ls.Rd | Renamed from show_ls.Rd with updated references |
| tests/testthat/test_explain.R | Changed train() call to use positional argument instead of named x parameter |
| tests/testthat/test_strings.R | Updated all test references from show_ls() to repr_ls() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/testthat/test_explain.R
Outdated
| ## GLMET Regression ---- | ||
| mod_r_glmnet <- train( | ||
| x = datr_train, | ||
| datr_train, |
Copilot
AI
Jan 1, 2026
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.
The parameter name x was removed from this train() call, making it a positional argument. However, other calls to train() in this file (lines 49 and 57) still use the named parameter x = datc2_train and x = datr_train. For consistency and clarity, all calls should use the same pattern. Consider either keeping x = datr_train or updating all other calls to match this positional style.
| datr_train, | |
| x = datr_train, |
| method(preprocessed, Preprocessor) <- function(x) { | ||
| x@preprocessed | ||
| } |
Copilot
AI
Jan 1, 2026
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.
The new preprocessed() generic function and its method for Preprocessor objects lack test coverage. Since other methods in the same file have comprehensive test coverage in tests/testthat/test_Preprocessor.R, consider adding a test case to verify that preprocessed(x) correctly returns the preprocessed data from a Preprocessor object.
No description provided.