Refactor core pipeline generation and parsing logic #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces a significant refactoring of the R package's core functionality related to Nix pipeline generation, dependency parsing, and code quality.
Key changes include:
Generic Derivation Function (
R/rixpress.R
,R/derivs.R
):makeDerivation
Nix function inpipeline.nix
generation, replacing separatemakeRDerivation
,makePyDerivation
, andmakeJlDerivation
.rxp_*
functions inR/derivs.R
to use this generic Nix function with atype
parameter (e.g., "R", "Py", "Jl").Refactored Library Generation (
R/parse_pkgs.R
):generate_r_libraries_from_nix
,generate_py_libraries_from_nix
, andgenerate_jl_libraries_from_nix
into a singlegenerate_r_or_py_libraries_from_nix
function.lang_config
) to manage parameters like Nix block names, import formatters, and file patterns, reducing code duplication.Refactored Dependency Extraction (
R/generate_dag.R
):extract_script_dependencies
helper function to consolidate common logic for parsing dependencies from R, Python, and Julia script snippets.Simplified
rixpress()
Function (R/rixpress.R
):rixpress()
function into smaller, more focused internal helper functions:.process_nix_configs
(for handling Nix environments and additional files) and.orchestrate_library_generation
(for calling library generation scripts).Refactored
gen_pipeline()
(R/rixpress.R
):.PIPELINE_LANG_CONFIGS
) to manage language-specific settings (e.g.,script_cmd
,load_line_func
) for injecting dependency loading logic intopipeline.nix
.Code Quality Improvements (All Modified Files):
R/rixpress.R
).These changes aim to make the codebase more modular, maintainable, readable, and easier to extend for future development.