Split r2f.R into domain-specific handler and helper files - #85
Conversation
Refactor the monolithic R/r2f.R (~2000 lines) into 18 logically grouped files for better maintainability. No functional changes. New structure: - r2f-aab-core.R: Core translation engine (renamed from r2f.R) - Handler files (14): arithmetic, logical, control-flow, reductions, subscript, sequences, conditionals, math, constructors, random, dimensions, io, coercions, core-handlers - Helper files (3): operators-helpers, iterables-helpers, reductions-helpers Design principles: - Local helpers stay with their handlers for readability - Generic helpers (used across domains) in dedicated helper files - Newspaper-style layout: handlers first, then local helpers where applicable
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #85 +/- ##
=======================================
Coverage 92.42% 92.42%
=======================================
Files 22 26 +4
Lines 4606 4606
=======================================
Hits 4257 4257
Misses 349 349 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
FYI, the benchmark results where we compare quickr to RcppArmadillo seemed suspect to me, so I've started a local branch investigating, and I'll be pushing out some updates to the LA code soon (with an updated benchmark that is more in line with what I expect). |
|
Thank you! |
PR message
Refactor the monolithic R/r2f.R (~2000 lines) into 18 logically grouped files for better maintainability. No functional changes.
New structure:
Design principles:
Extra comments
As discussed elsewhere, I (/ai) have tried to split the r2f file into smaller logical components. The extra lines should be white space and extra comments. Some files like random and coercion are very small, but I think there is room for more handler of these types. You are welcome to rename or combine files fi there are too many.
I actually thought there would be more "generic" helpers that can be reused over multiple files/handlers. I guess these are more common in the matrix files. However, I feel like there is potential to consolidate various helpers and create new ones for common patterns. There is probably also potential in refactoring tests at some point to better align with source code files.