Hi Marc,
Here are some other leads that may be explored :
* -d and -L options help to get a concise output from avail
sub-command: 1 version per module, default one with -d and latest one
with -L. There is no way currently to make these filters permanent for
any avail command.
* maybe dirA, dirB, etc could be made modulepaths (the path you
provide to "module use" command): no-indepth approach should help as
the top level name should already give a clue to users. If not, it may
mean that this top level name is part of the modulepath rather than
part of the module name
* build modulerc file (or files) with "module-hide --soft" commands
for each module versions of dirX/subdirY combination except one
(default or latest version for instance). This solution should provide
the outcome you except, but may require extra work to maintain
Regards,
Xavier
Le mar. 13 août 2024 à 22:10, Marc Castells
<mar...@en...> a écrit :
>
> Thanks for the reply, Xavier
>
> avail-indepth almost works for me but If I understand correctly, it's only full-hierarchy visibility (indepth) or higher-level visibility only (no-indepth).
>
> Given my module structure with 3 hierarchical levels, for this to really work I would need to be able to go down two levels (no-indepth) or three levels (indepth). All I would like is to hide the leaf version numbers from within a module directory, but still show the two levels of hierarchy down to that level.
>
> Something like:
>
> (no leaf versions displayed)
> -----------------------------------------
> dirA/subdirX dirA/subdirY dirB/subdirZ
>
> (leaf versions displayed)
> -----------------------------------------
> dirA/subdirX/1 dirA/subdirX/2 dirA/subdirY/8 dirA/subdirY/9 dirB/subdirZ/3
>
> It is a shame that the indepth option is not configurable with the levels of hierarchy to show.
>
> Regards,
>
> Marc.
>
> -----Original Message-----
> From: Xavier Delaruelle
> Sent: Tuesday, August 13, 2024 7:26 PM
> To: Environment Modules usage and discussion. <mod...@li...>
> Subject: Re: [Modules] Hide modulefiles but show container module directory
>
> Hello Marc,
>
> As you would like to hide all module versions by default and only display the available module names, I suggest you look at the "avail_indepth" configuration option [1].
>
> This option is enabled by default, but if you disable it only the top directory level is reported on "module avail". You can list the versions of a given module by specifying it as argument (e.g., module avail foo/).
>
> Quick demo:
>
> ❯ module avail
> ---------------- /path/to/modulefiles ----------------
> bar/1 bar/2 foo/1 foo/2
>
> Key:
> modulepath
> ❯ module avail --no-indepth
> ---------------- /path/to/modulefiles ---------------- bar/ foo/
>
> Key:
> modulepath directory/
> ❯ module config avail_indepth 0
> ❯ module avail
> ---------------- /path/to/modulefiles ---------------- bar/ foo/
>
> Key:
> modulepath directory/
> ❯ module avail foo/
> ---------------- /path/to/modulefiles ----------------
> foo/1 foo/2
>
> Key:
> modulepath
>
> Regards,
> Xavier
>
> [1] https://modules.readthedocs.io/en/latest/module.html#mconfig-avail_indepth
>
> Le mar. 13 août 2024 à 17:00, Marc Castells <mar...@en...> a écrit :
> >
> > Hi,
> >
> > An example structure:
> >
> > + DIR_1
> > + SUBDIR_A
> > + 0.1
> > + 0.2
> > + 1.0
> > + 2.0
> > + ....
> >
> > DIR_1 is the path fed to the 'module use' command in the initrc file. The sub-directories inside it are expected to be recursively searched by the tool.
> >
> > I am trying to find a way to soft hide all individual modulefile versions inside SUBDIR_A in a module avail command but show the DIR_1/SUBDIR_A stub. The reason for this is that I have multiple SUBDIR_? (around 20), each with many modulefiles (from a few to 10s). The idea would be to use module avail to get a top level view of the available SUBDIR modules without the clutter inside each module directory. Regular users would simply invoke 'module load DIR_1/SUBDIR_A' and rely on default and/or current version specifier. For a finer selection within SUBDIR_A, the user would target 'module avail -a DIR_1/SUBDIR_A' and all the available versions would be displayed.
> >
> > I have tried the following with the module-hide feature but none have work:
> > a) module-hide -soft DIR_1/SUBDIR_A
> > b) module-hide -soft DIR_1/SUBDIR_A@<first_version>:<last_version>
> > c) module-hide -soft DIR_1/SUBDIR_A@:
> >
> > a) and b) hide DIR_1/SUBDIR_A entirely. c) does not hide anything and
> > all versions are displayed
> >
> > Is there a native way within the tool to support this functionality?
> >
> > Thanks
>
>
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
>
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
|