New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hierarchical module naming scheme categorizing modulefiles by 'moduleclass' #1176
Conversation
by 'moduleclass' easyconfig parameter on each level of the hierarchy
Automatic reply from Jenkins: Can I test this? |
hooray! nice contribution Markus, thanks; My assumption is that most phys/chem HPC shops would much prefer a namespace of this type. (and now we need to convince @ocaisa for sharing the other alternative toolchain namespace, so that we can cook hybrids of these ideas) |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
## |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as I see it, this is 3-clause BSD, no? http://en.wikipedia.org/wiki/BSD_licenses
It would be nice if it was stated as such somewhere (just me pipedreaming here that all devs would do the same)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fgeorgatos: Yes, it is 3-clause BSD. I'm so used to it that I thought it was obvious ;-) Not sure where to best add such a statement, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just add an extra comment line, mentioning something like:
# License: 3-clause BSD
# Author: Markus Geimer (JSC)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, you already have the author
bit below, so just an extra comment for the license part is sufficient
visual review, all looks good. TBC. |
We need to get this integrated in the unit tests somehow, to make sure we don't break it in the future. There are several test modules that now test
Not all of these need to also test this new MNS, but it should be tested in one or two places at least. @geimer: Are you up for that? If not, I can look into it (not sure how soon though). |
Jenkins: ok to test |
paths = [] | ||
for path in basepaths: | ||
for moduleclass in known_module_classes: | ||
paths.extend([os.path.join(path, moduleclass)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is pretty much copy-paste of det_modpath_extensions
, so the body should be fleshed out in another method or function like categorise_paths(paths)
, which is simply called twice
we already have enough LoC to take care of ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or, alternatively, collapse this into a single line using a Python list comprehension:
paths = [os.path.join(p, mc) for p in basepaths for mc in known_module_classes]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and then you don't even need paths
or a separate categorize_paths()
anymore, just return the list straight away :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely meeting of Python with the functional languages world ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, your suggestion looks more like perl than Python... looks awful...
Since I'm in favor of readable code, I opt for the separate method (which in fact makes sense -- and I don't know why I didn't think of it myself).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a pretty clean list comprehension, we have many others... ;-)
but sure, go ahead and do it via a separate method then, I don't feel strongly about making it a list comprehension, since I won't have to maintain this bit ;)
@fgeorgatos It's sitting there waiting for your attention ;) #1168 |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
@geimer: the best location for a test is probably |
@boegel: That's what I thought, too. Just staring at it and trying to understand. The first part is quite clear, but what is the final part after the
good for? |
@geimer: leave that in, it restores whatever module naming scheme was active before running the tests |
That's understood. I was actually wondering why the test is verifying some things again afterwards, assuming that the original naming scheme is the "traditional" one. |
@geimer: it's checking whether the default naming scheme setting is being honored, which is why the tests shouldn't be picking up any user config files :) |
Shouldn't this be in a separate test method then? I mean, |
@geimer: yes, you're probably right, that could be cleaned up, indeed; I guess it's also checking whether restoring the default MNS actually works |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
@geimer: just gave this another review, looks great. The only thing, as discussed off-PR: let's isolate the test modules specific to You can enhance def setup_hierarchical_modules(self, subdir=None):
"""Setup hierarchical modules to run tests on."""
if subdir is not None:
mod_prefix = os.path.join(self.test_installpath, 'modules', 'all', subdir)
else:
mod_prefix = os.path.join(self.test_installpath, 'modules', 'all') and then call |
@boegel: There is a little bit more to be done than just modifying |
@geimer: that should be |
@boegel: Then I'm happy to rename |
I'm just saying you're using a hierarchical MNS too, so only calling it categorised is misleading. So, |
Ah, got your point. Makes sense. |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
@boegel: Unless you see a need for enhancing even more unit tests for the CategorizedHMNS, I'd say this PR is good for review. |
Hierarchical module naming scheme categorizing modulefiles by 'moduleclass'
NOTE: This PR depends on #1163
This is an enhanced hierarchical module naming scheme which uses the
moduleclass
easyconfig parameter to further categorize modulefiles on each level of the hierarchy.@fgeorgatos, @pforai: here you go :-)