diff --git a/bins/inbreeding/list.nu b/bins/inbreeding/list.nu new file mode 100644 index 0000000000000000000000000000000000000000..208b541a2c191042492355688ec3132532864197 --- /dev/null +++ b/bins/inbreeding/list.nu @@ -0,0 +1,16 @@ +use consts.nu +use path.nu [ "remove-cache-prefix" ] + +# return experiment names following `$ARG_EXPERIMENT_FORMAT` +export def main []: nothing -> list<string> { + $consts.CACHE + | path join '*' '*' + | into glob + | ls $in + | get name + | each { remove-cache-prefix } + | parse --regex $consts.FULL_EXPERIMENT_FORMAT + | reject strategy + | each { values | str join '-' } + | uniq +} diff --git a/bins/inbreeding/load.nu b/bins/inbreeding/load.nu index c14284c1906ae6d9e20115ffbc576558b7d43e66..595604bcdcce22099c464e19f20308da5b84e9c3 100644 --- a/bins/inbreeding/load.nu +++ b/bins/inbreeding/load.nu @@ -2,22 +2,10 @@ use consts.nu use path.nu [ "remove-cache-prefix" ] use ../../.nushell error "error throw" -# return experiment names following `$ARG_EXPERIMENT_FORMAT` -def get-experiments []: nothing -> list<string> { - $consts.CACHE - | path join '*' '*' - | into glob - | ls $in - | get name - | each { remove-cache-prefix } - | parse --regex $consts.FULL_EXPERIMENT_FORMAT - | reject strategy - | each { values | str join '-' } - | uniq -} +use list.nu export def main [ - experiment: string@get-experiments, + experiment: string@list, ]: [ nothing -> record< experiment: record<k: int, n: int, nb_bytes: int, env: string>, diff --git a/bins/inbreeding/mod.nu b/bins/inbreeding/mod.nu index 4059fa7ca1fa0137ab13bb77b493458cef86d997..15e876c6ccb6c855ca5e4f1e2cd6e193fd800e66 100644 --- a/bins/inbreeding/mod.nu +++ b/bins/inbreeding/mod.nu @@ -2,5 +2,6 @@ export use build.nu export use watch.nu export use run.nu export use inspect.nu +export use list.nu export use load.nu export use plot.nu