JADE-V-V / JADE

JADE, a novel nuclear data libraries V&V tool
GNU General Public License v3.0
23 stars 8 forks source link

refactored nested code for readability #296

Closed shimwell closed 4 months ago

shimwell commented 4 months ago

Description

I spotted a few more nested levels of code and had a go at refactoring it so that the code was a bit more readable. It makes use of all and dictionary comprehension which might make it more complex so perhaps it is not actually any nicer as we trade compactness of code for complexity here. Feel free to reject these PRs I'm just seeing what can be done.

Fixes # (issue)

No open issues, just refactoring

Type of change

more concise code

Please select what type of change this is.

Other changes

Testing

Sorry I've not added tests, happy to do so

Checklist:

dodu94 commented 4 months ago

Hi Jonathan, I did a quick test of the new logic and I'm not sure it is doing what is expected as the last level is supposed to be a list of files contained by the last folder: image

It seemed also a bit slow (probably not faster than what we have right now). I believe that if we want to refactor this specific part of the code we should use os.walk, it should also be much faster:

image

shimwell commented 4 months ago

Good spot. Looks like we don't need this PR anymore. Thanks for checking