Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @strengejacke, 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 significantly enhances the performance R package by integrating support for the tinytable backend. This allows for more flexible and aesthetically pleasing table output in various environments, such as markdown and HTML, by generalizing the existing table rendering functions to accommodate this new format. The changes involve updating core display functions, introducing a new internal helper for format determination, and managing dependencies.
Highlights
- New Output Format Support: Introduced support for the
tinytablebackend, allowing users to render tables in thetinytableformat by specifyingformat = "tt"indisplay()and other table-generating functions. - Generalized Table Export Logic: Refactored internal
print_htmlmethods across multiple files to dynamically determine the output format (HTML ortinytable) using a new helper function,.check_format_backend(), which then passes the appropriate format toinsight::export_table. - Dependency Management: Added
easystats/insightas a remote dependency in theDESCRIPTIONfile, which is crucial for leveraging thetinytableintegration through theinsightpackage's table export capabilities. - Documentation and Versioning: Updated the package version to
0.15.0.1, added a corresponding entry inNEWS.mddetailing thetinytablesupport, and revised the documentation for thedisplay()function to reflect the newformatoptions and expanded parameter descriptions.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
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 or fill out our survey to provide feedback.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request introduces support for the tinytable backend for table generation. The changes are consistently applied across the package by introducing a .check_format_backend() helper and updating display() and print_html() methods.
My review focuses on improving maintainability. I've suggested:
- Clarifying a comment for the new helper function to better describe its behavior.
- Removing duplicated code by aliasing one
display()method to another identical one.
These changes will make the code easier to understand and maintain in the future. Overall, this is a well-executed feature addition.
| .check_format_backend <- function(...) { | ||
| dots <- list(...) | ||
| if (identical(dots$backend, "tt")) { | ||
| "tt" | ||
| } else { | ||
| "html" | ||
| } | ||
| } |
There was a problem hiding this comment.
The comment above .check_format_backend could be more precise. It mentions "gt" or "tinytable", but this function's logic only distinguishes between "tt" and a default of "html". The mapping of "html" to the gt package happens within insight::export_table(). For better code clarity and maintainability, the comment should describe what this function returns.
A more descriptive comment would be helpful for future maintenance.
# Helper to select table format backend. Returns "tt" for tinytable, or "html" for the default.
No description provided.