mirror of
https://github.com/dwinkler1/fran.git
synced 2026-02-19 14:40:58 -05:00
Merge pull request #26 from dwinkler1/copilot/refactor-package-modules-structure
Refactor R packages into modular structure with alphabetic subdirectories
This commit is contained in:
commit
a387931751
8 changed files with 123 additions and 75 deletions
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
|
|
@ -4,7 +4,9 @@ on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- 'flake.lock'
|
- 'flake.lock'
|
||||||
|
- 'flake.nix'
|
||||||
- 'versions/*.json'
|
- 'versions/*.json'
|
||||||
|
- 'packages/**/*.nix'
|
||||||
- '.github/workflows/*.yml'
|
- '.github/workflows/*.yml'
|
||||||
- 'test/*.R'
|
- 'test/*.R'
|
||||||
concurrency:
|
concurrency:
|
||||||
|
|
|
||||||
76
flake.nix
76
flake.nix
|
|
@ -40,81 +40,7 @@
|
||||||
extraRPackageDeps = {
|
extraRPackageDeps = {
|
||||||
julia-fwildclusterboot = prev.julia-bin.withPackages ["WildBootTests" "StableRNGs"];
|
julia-fwildclusterboot = prev.julia-bin.withPackages ["WildBootTests" "StableRNGs"];
|
||||||
};
|
};
|
||||||
extraRPackages = let
|
extraRPackages = import ./packages {inherit final prev;};
|
||||||
fetchfromGitHubJSONFile = path: prev.fetchFromGitHub (builtins.fromJSON (builtins.readFile path));
|
|
||||||
in {
|
|
||||||
## F
|
|
||||||
fwildclusterboot =
|
|
||||||
(prev.rPackages.buildRPackage {
|
|
||||||
name = "fwildclusterboot";
|
|
||||||
src = fetchfromGitHubJSONFile ./versions/fwildclusterboot.json;
|
|
||||||
propagatedBuildInputs = builtins.attrValues {
|
|
||||||
inherit
|
|
||||||
(prev.rPackages)
|
|
||||||
collapse
|
|
||||||
dqrng
|
|
||||||
dreamerr
|
|
||||||
Formula
|
|
||||||
generics
|
|
||||||
gtools
|
|
||||||
JuliaConnectoR
|
|
||||||
Matrix
|
|
||||||
Rcpp
|
|
||||||
rlang
|
|
||||||
RcppArmadillo
|
|
||||||
RcppEigen
|
|
||||||
;
|
|
||||||
inherit (final.extraRPackages) summclust;
|
|
||||||
};
|
|
||||||
}).overrideAttrs (old: {
|
|
||||||
passthru = (old.passthru or {}) // {juliaPackages = ["WildBootTests" "StableRNGs"];};
|
|
||||||
});
|
|
||||||
|
|
||||||
## H
|
|
||||||
httpgd = prev.rPackages.buildRPackage {
|
|
||||||
name = "httpgd";
|
|
||||||
src = fetchfromGitHubJSONFile ./versions/httpgd.json;
|
|
||||||
propagatedBuildInputs = builtins.attrValues {
|
|
||||||
inherit
|
|
||||||
(prev.rPackages)
|
|
||||||
unigd
|
|
||||||
cpp11
|
|
||||||
AsioHeaders
|
|
||||||
;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
## M
|
|
||||||
musicMetadata = prev.rPackages.buildRPackage {
|
|
||||||
name = "musicMetadata";
|
|
||||||
src = fetchfromGitHubJSONFile ./versions/musicMetadata.json;
|
|
||||||
};
|
|
||||||
|
|
||||||
## S
|
|
||||||
summclust = prev.rPackages.buildRPackage {
|
|
||||||
name = "summclust";
|
|
||||||
|
|
||||||
src = fetchfromGitHubJSONFile ./versions/summclust.json;
|
|
||||||
|
|
||||||
propagatedBuildInputs = builtins.attrValues {
|
|
||||||
inherit
|
|
||||||
(prev.rPackages)
|
|
||||||
dreamerr
|
|
||||||
MASS
|
|
||||||
collapse
|
|
||||||
generics
|
|
||||||
cli
|
|
||||||
rlang
|
|
||||||
;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
synthdid = prev.rPackages.buildRPackage {
|
|
||||||
name = "synthdid";
|
|
||||||
src = fetchfromGitHubJSONFile ./versions/synthdid.json;
|
|
||||||
propagatedBuildInputs = [prev.rPackages.mvtnorm];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
# Helper to install R with system dependencies if required
|
# Helper to install R with system dependencies if required
|
||||||
|
|
|
||||||
34
packages/default.nix
Normal file
34
packages/default.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
final,
|
||||||
|
prev,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
# Shared helper function to fetch from GitHub using JSON version files
|
||||||
|
fetchfromGitHubJSONFile = path: prev.fetchFromGitHub (builtins.fromJSON (builtins.readFile path));
|
||||||
|
|
||||||
|
# Reference to the versions directory at the repo root
|
||||||
|
versionsDir = ../versions;
|
||||||
|
|
||||||
|
# Common arguments passed to package modules that don't need 'final'
|
||||||
|
baseArgs = {
|
||||||
|
inherit prev fetchfromGitHubJSONFile versionsDir;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Arguments for packages that need access to 'final' (for cross-package dependencies)
|
||||||
|
argsWithFinal = baseArgs // {
|
||||||
|
inherit final;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
## F
|
||||||
|
fwildclusterboot = import ./f/fwildclusterboot.nix argsWithFinal;
|
||||||
|
|
||||||
|
## H
|
||||||
|
httpgd = import ./h/httpgd.nix baseArgs;
|
||||||
|
|
||||||
|
## M
|
||||||
|
musicMetadata = import ./m/musicMetadata.nix baseArgs;
|
||||||
|
|
||||||
|
## S
|
||||||
|
summclust = import ./s/summclust.nix baseArgs;
|
||||||
|
synthdid = import ./s/synthdid.nix baseArgs;
|
||||||
|
}
|
||||||
30
packages/f/fwildclusterboot.nix
Normal file
30
packages/f/fwildclusterboot.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
final,
|
||||||
|
prev,
|
||||||
|
fetchfromGitHubJSONFile,
|
||||||
|
versionsDir,
|
||||||
|
}:
|
||||||
|
(prev.rPackages.buildRPackage {
|
||||||
|
name = "fwildclusterboot";
|
||||||
|
src = fetchfromGitHubJSONFile "${versionsDir}/fwildclusterboot.json";
|
||||||
|
propagatedBuildInputs = builtins.attrValues {
|
||||||
|
inherit
|
||||||
|
(prev.rPackages)
|
||||||
|
collapse
|
||||||
|
dqrng
|
||||||
|
dreamerr
|
||||||
|
Formula
|
||||||
|
generics
|
||||||
|
gtools
|
||||||
|
JuliaConnectoR
|
||||||
|
Matrix
|
||||||
|
Rcpp
|
||||||
|
rlang
|
||||||
|
RcppArmadillo
|
||||||
|
RcppEigen
|
||||||
|
;
|
||||||
|
inherit (final.extraRPackages) summclust;
|
||||||
|
};
|
||||||
|
}).overrideAttrs (old: {
|
||||||
|
passthru = (old.passthru or {}) // {juliaPackages = ["WildBootTests" "StableRNGs"];};
|
||||||
|
})
|
||||||
17
packages/h/httpgd.nix
Normal file
17
packages/h/httpgd.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
prev,
|
||||||
|
fetchfromGitHubJSONFile,
|
||||||
|
versionsDir,
|
||||||
|
}:
|
||||||
|
prev.rPackages.buildRPackage {
|
||||||
|
name = "httpgd";
|
||||||
|
src = fetchfromGitHubJSONFile "${versionsDir}/httpgd.json";
|
||||||
|
propagatedBuildInputs = builtins.attrValues {
|
||||||
|
inherit
|
||||||
|
(prev.rPackages)
|
||||||
|
unigd
|
||||||
|
cpp11
|
||||||
|
AsioHeaders
|
||||||
|
;
|
||||||
|
};
|
||||||
|
}
|
||||||
9
packages/m/musicMetadata.nix
Normal file
9
packages/m/musicMetadata.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
prev,
|
||||||
|
fetchfromGitHubJSONFile,
|
||||||
|
versionsDir,
|
||||||
|
}:
|
||||||
|
prev.rPackages.buildRPackage {
|
||||||
|
name = "musicMetadata";
|
||||||
|
src = fetchfromGitHubJSONFile "${versionsDir}/musicMetadata.json";
|
||||||
|
}
|
||||||
20
packages/s/summclust.nix
Normal file
20
packages/s/summclust.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
prev,
|
||||||
|
fetchfromGitHubJSONFile,
|
||||||
|
versionsDir,
|
||||||
|
}:
|
||||||
|
prev.rPackages.buildRPackage {
|
||||||
|
name = "summclust";
|
||||||
|
src = fetchfromGitHubJSONFile "${versionsDir}/summclust.json";
|
||||||
|
propagatedBuildInputs = builtins.attrValues {
|
||||||
|
inherit
|
||||||
|
(prev.rPackages)
|
||||||
|
dreamerr
|
||||||
|
MASS
|
||||||
|
collapse
|
||||||
|
generics
|
||||||
|
cli
|
||||||
|
rlang
|
||||||
|
;
|
||||||
|
};
|
||||||
|
}
|
||||||
10
packages/s/synthdid.nix
Normal file
10
packages/s/synthdid.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
prev,
|
||||||
|
fetchfromGitHubJSONFile,
|
||||||
|
versionsDir,
|
||||||
|
}:
|
||||||
|
prev.rPackages.buildRPackage {
|
||||||
|
name = "synthdid";
|
||||||
|
src = fetchfromGitHubJSONFile "${versionsDir}/synthdid.json";
|
||||||
|
propagatedBuildInputs = [prev.rPackages.mvtnorm];
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue