-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import os | ||
import sys | ||
|
||
import phaseSpaceSampling.utils.parallel as par | ||
from phaseSpaceSampling import DATA_DIR, INPUT_DIR | ||
|
||
|
||
def find_input(inpt_file): | ||
if not os.path.isfile(inpt_file): | ||
new_inpt_file = os.path.join(INPUT_DIR, os.path.split(inpt_file)[-1]) | ||
par.printRoot( | ||
f"WARNING: {inpt_file} not found trying {new_inpt_file} ..." | ||
) | ||
if not os.path.isfile(new_inpt_file): | ||
par.printRoot( | ||
f"ERROR: could not open data {inpt_file} or {new_inpt_file}" | ||
) | ||
sys.exit() | ||
return None | ||
else: | ||
return new_inpt_file | ||
else: | ||
return inpt_file | ||
|
||
|
||
def find_data(data_file): | ||
if not os.path.isfile(data_file): | ||
new_data_file = os.path.join(DATA_DIR, os.path.split(data_file)[-1]) | ||
par.printRoot( | ||
f"WARNING: {data_file} not found trying {new_data_file} ..." | ||
) | ||
if not os.path.isfile(new_data_file): | ||
par.printRoot( | ||
f"ERROR: could not open data {data_file} or {new_data_file}" | ||
) | ||
sys.exit() | ||
return None | ||
else: | ||
return new_data_file | ||
else: | ||
return data_file |