First, I forgot to say thanks! So thanks! ;)
Thanks for the solution. :)
May I give a suggestion.
It would be nice if when paths are added they execute their modulerc, and
then enable a module-unhide command to tweak what users can
see without having too many if statements.
Probably my use case is limited, but it may be useful for transitioning
away from legacy naming schemes.
Thanks!
Den tir. 4. maj 2021 kl. 21.08 skrev Xavier Delaruelle <
xav...@gm...>:
> You can unhide hidden modules with the -a/--all command-line switch
> (unless if they are --hard hidden).
>
> You can also avoid hiding these modules in the RC file by using some
> conditional test, for instance:
>
> if {![is-loaded python/3.7.7]} {
> module-hide matplotlib@:3.2.1
> module-hide numpy@:1.18.2
> module-hide scipy@:1.4.1
> }
>
> With such code, modules are not hidden when the python/3.7.7 module is
> loaded.
>
> You may also split the module-hide orders in the .modulerc files at
> the root of each modulepath directory. This way hiding rules are set
> closer to the modulefiles they target.
>
> Best regards,
> Xavier
>
> Le mar. 4 mai 2021 à 20:51, Nick Papior <nic...@gm...> a écrit :
> >
> > Well, that's embarrassing.
> >
> > Can one specify to unhide all modules in a folder? Should i then loop
> the modules in that path and unhide?
> >
> > Den tir. 4. maj 2021 kl. 20.45 skrev Xavier Delaruelle <
> xav...@gm...>:
> >>
> >> I correctly got the 3 files you sent.
> >>
> >> From what I can see, the "../env-modules/python-mods/3.7.7" directory
> >> is correctly enabled as modulepath entry.
> >>
> >> 3 modulefiles are found in it:
> >> numpy/1.18.2
> >> scipy/1.4.1
> >> matplotlib/3.2.1
> >>
> >> But, the "../env-modules/modules/4.7.1/etc/rc" file defines these
> >> modules as hidden with the following commands:
> >>
> >> module-hide matplotlib@:3.2.1
> >> module-hide numpy@:1.18.2
> >> module-hide scipy@:1.4.1
> >>
> >> As a result, there is no module to report in
> >> "../env-modules/python-mods/3.7.7" as all of them are hidden.
> >>
> >> So if you want to see/access these modules, the module-hide directives
> >> should be changed in the global RC file. By the way, ranges are
> >> inclusive so for instance "scipy@:1.4.1" matches all versions from
> >> 0.0.0 to 1.4.1 included.
> >>
> >> Best regards,
> >> Xavier
> >>
> >>
> >>
> >> Le mar. 4 mai 2021 à 20:20, Nick Papior <nic...@gm...> a écrit
> :
> >> >
> >> > FYI, I sent a response 4 hours ago with large attachments. I got a
> message saying it is on hold due to its size.
> >> > I don't know if I get a response on the decision on that? :)
> >> >
> >> > Den tir. 4. maj 2021 kl. 15.18 skrev Nick Papior <
> nic...@gm...>:
> >> >>
> >> >> Thanks!
> >> >>
> >> >> Here attached the 3 outputs.
> >> >>
> >> >> Please excuse me for having many more module-hide stuff in the rc
> file.
> >> >>
> >> >> If you want me to reduce the rc file I can, but I assume you search
> around the file for specific entries!
> >> >> In any case, let me know what you prefer!
> >> >>
> >> >> Den tir. 4. maj 2021 kl. 14.36 skrev Xav...@CE... <
> Xav...@ce...>:
> >> >>>
> >> >>> Le mardi 04 mai 2021 à 11:27 +0200, Nick Papior a écrit :
> >> >>>
> >> >>> Hi list,
> >> >>>
> >> >>> I have always made use of the "module use <path>" extension to
> customize modules depending on other modules.
> >> >>> To do this I put "module use --append <path>" in a top level module.
> >> >>>
> >> >>> For example:
> >> >>>
> #%Module1.0#####################################################################
> >> >>> ##
> >> >>> ## python-3.7.7
> >> >>> ##
> >> >>>
> >> >>> set version 3.7.7
> >> >>> ...
> >> >>> module use --append /mypath/to/python/$version
> >> >>>
> >> >>> which then enables modules installed with python 3.7.7.
> >> >>> Now I want to use this in a combination with "module-hide" in
> >=4.6. And this is where things go wrong.
> >> >>>
> >> >>> I can get all versions to work if I don't use "module-hide", but as
> soon as I use an rc file in etc/rc that contains some hiding stuff, then
> using "module use ..." in a module does not work.
> >> >>> I can't even get it to work by doing "module use <path>" on the
> command line (i.e. outside of a module).
> >> >>>
> >> >>> The rc file contains something like this (plus additional stuff
> which *seems* irrelevant)
> >> >>> module-hide python@:2.7.17
> >> >>> module-hide python@3:3.7.6
> >> >>> module-hide python@3.8:3.8.3
> >> >>> module-hide python3@
> >> >>> module-hide numpy@:1.18.2
> >> >>>
> >> >>> My python/3.7.7 module contains the above "module use --append"
> statement.
> >> >>> But that seems to clash with the hiding, but I can't see why?
> >> >>>
> >> >>> Basically, if I don't have an rc file I get something like this
> (note the 2 sections)
> >> >>>
> -----------------------------------------------------------------------
> /zhome/0e/2/36189/dcc/env-modules/module-repo
> ------------------------------------------------------------------------
> >> >>> modules/4.3.1 modules/4.5.3 modules/4.7.1
> python/3.2.5 python/3.4.1 python/3.5.4 python/3.6.2 python/3.6.10
> python/3.7.6 python/3.8.0 python/3.8.2
> >> >>> modules/4.4.1 modules/4.6.1 python.scientific/3.8.4
> python/3.3.0 python/3.5.1 python/3.6.0 python/3.6.7 python/3.7.5
> python/3.7.7 python/3.8.1 python/3.8.4
> >> >>>
> >> >>>
> -----------------------------------------------------------------------
> /zhome/0e/2/36189/dcc/env-modules/python/3.7.7
> -----------------------------------------------------------------------
> >> >>> matplotlib/3.2.1 numpy/1.18.2 scipy/1.4.1
> >> >>>
> >> >>> While if I have an rc file I get this (only 1 section)
> >> >>>
> -----------------------------------------------------------------------
> /zhome/0e/2/36189/dcc/env-modules/module-repo
> ------------------------------------------------------------------------
> >> >>> modules/4.3.1 modules/4.5.3 modules/4.7.1
> python/3.2.5 python/3.4.1 python/3.5.4 python/3.6.2 python/3.6.10
> python/3.7.6 python/3.8.0 python/3.8.2
> >> >>> modules/4.4.1 modules/4.6.1 python.scientific/3.8.4
> python/3.3.0 python/3.5.1 python/3.6.0 python/3.6.7 python/3.7.5
> python/3.7.7 python/3.8.1 python/3.8.4
> >> >>>
> >> >>> I can't see why hiding modules should clash with module use...
> >> >>> Is there something I am missing?
> >> >>> I also tried renaming the python/$version folder to
> python-mods/$version, to no avail. Still only working without the rc file.
> >> >>>
> >> >>>
> >> >>> Hi Nick,
> >> >>>
> >> >>> Could you send me the result of the following commands (after doing
> a module purge) :
> >> >>>
> >> >>> $ module config --dump-state
> >> >>> $ module -DD load python/3.7.7
> >> >>> $ module -DD avail
> >> >>>
> >> >>> Please send me these outputs as a direct message if you do not want
> to expose these details on the mailing-list.
> >> >>>
> >> >>> Best regards,
> >> >>> Xavier
> >> >>>
> >> >>> _______________________________________________
> >> >>> Modules-interest mailing list
> >> >>> Mod...@li...
> >> >>> https://lists.sourceforge.net/lists/listinfo/modules-interest
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Kind regards Nick
> >> >
> >> >
> >> >
> >> > --
> >> > Kind regards Nick
> >> > _______________________________________________
> >> > 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
> >
> >
> >
> > --
> > Kind regards Nick
> > _______________________________________________
> > 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
>
--
Kind regards Nick
|