openmc-dev/data

Migrate scripts from using os.path to using Pathlib

Closed this issue · 3 comments

This issue is added in response to a requirement from @shimwell and @ukaea.

In the scripts there is an extensive use of os.path library for finding files and directories. In some scripts the code has started using PathLib instead of os.path.

I'm planning to update all of the current scripts to replace uses of os.path with the newer object orientated PathLib (https://docs.python.org/3/library/pathlib.html) library. I'll make sure that the use of PathLib is kept consistent with those scripts in which it's already used.

@tim-fry Yes, I'm all for using pathlib over os.path. I'm actually already working on refactoring the scripts in the scripts/ directory based on feedback from the review in openmc-dev/openmc#1455 and started using pathlib there.

Ah sorry, I'm talking about the wrong repo here -- I've been refactoring scripts in openmc-dev/openmc, not here. Feel free to take a stab at the ones here!

Yes please @tim-fry this would be a nice addition. I guess this is being worked on by yourself and might overlap with some of the work others in your group are doing @SamPUG