-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #420 from ReactionMechanismGenerator/common_imports
Added an option for users to modify copies of specific ARC settings files
- Loading branch information
Showing
60 changed files
with
12,384 additions
and
168 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
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,39 @@ | ||
""" | ||
This module contains functionality to import user settings and fill in default values from ARC's settings. | ||
""" | ||
|
||
import os | ||
import sys | ||
|
||
import arc.settings.settings as arc_settings | ||
from arc.settings.inputs import input_files | ||
from arc.settings.submit import submit_scripts | ||
|
||
|
||
# Common imports where the user can optionally put a modified copy of an ARC file un their ~/.arc folder | ||
local_arc_path = os.path.join(os.getenv("HOME"), '.arc') | ||
|
||
local_arc_settings_path = os.path.join(local_arc_path, 'settings.py') | ||
settings = {key: val for key, val in vars(arc_settings).items() if '__' not in key} | ||
if os.path.isfile(local_arc_settings_path): | ||
if local_arc_path not in sys.path: | ||
sys.path.insert(1, local_arc_path) | ||
import settings as local_settings | ||
local_settings_dict = {key: val for key, val in vars(local_settings).items() if '__' not in key} | ||
settings.update(local_settings_dict) | ||
# Set global_ess_settings to None if using a local settings file (ARC's defaults are dummies) | ||
settings['global_ess_settings'] = local_settings_dict['global_ess_settings'] or None | ||
|
||
local_arc_submit_path = os.path.join(local_arc_path, 'submit.py') | ||
if os.path.isfile(local_arc_submit_path): | ||
if local_arc_path not in sys.path: | ||
sys.path.insert(1, local_arc_path) | ||
from submit import submit_scripts as local_submit_scripts | ||
submit_scripts.update(local_submit_scripts) | ||
|
||
local_arc_inputs_path = os.path.join(local_arc_path, 'inputs.py') | ||
if os.path.isfile(local_arc_inputs_path): | ||
if local_arc_path not in sys.path: | ||
sys.path.insert(1, local_arc_path) | ||
from inputs import input_files as local_input_files | ||
input_files.update(local_input_files) |
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import arc.job.inputs | ||
import arc.job.job | ||
import arc.job.local | ||
import arc.job.ssh | ||
import arc.job.submit | ||
import arc.job.trsh |
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
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
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
Oops, something went wrong.