refactor: replaced 'os.path.join()' uses with 'pathlib.Path' / syntax #1637
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR closes #1627.
As per the issue's description, in this PR most instances of
os.path.joinon strings with the corresponding/syntax forpathlib.Pathobjects. For example:However, files with the prefix
test_were not considered for this refactor; therefore, they maintained the usage ofos.path.joinFiles Changed
install/find_mpi.pylibensemble/executors/executor.pylibensemble/manager.pylibensemble/resources/resources.pylibensemble/tests/run_tests.pylibensemble/tests/scaling_tests/forces/forces_adv/forces_simf.pylibensemble/tests/scaling_tests/forces/forces_adv/forces_support.pylibensemble/tests/scaling_tests/forces/forces_adv/run_libe_forces.pylibensemble/tests/scaling_tests/forces/forces_adv/run_libe_forces_from_yaml.pylibensemble/tests/scaling_tests/forces/forces_gpu/run_libe_forces.pylibensemble/tests/scaling_tests/forces/forces_gpu_var_resources/run_libe_forces.pylibensemble/tests/scaling_tests/forces/forces_multi_app/run_libe_forces.pylibensemble/tests/scaling_tests/forces/forces_simple/run_libe_forces.pylibensemble/tests/scaling_tests/forces/forces_simple_with_input_file/run_libe_forces.pylibensemble/tests/scaling_tests/forces/globus_compute_forces/forces_simf.pylibensemble/tools/parse_args.pylibensemble/tools/tools.pyAdditional Notes
It would be a good idea to consider replacing other uses of the
osmodule with theirpathlibequivalents. For example,os.path.exists()could be replaced byPath.exists().