-
Notifications
You must be signed in to change notification settings - Fork 1
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 #8 from AntaresSimulatorTeam/feature/remove-defini…
…tions-dependency Feature/remove definitions dependency
- Loading branch information
Showing
46 changed files
with
591 additions
and
432 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,38 @@ | ||
import sys | ||
|
||
from antareslauncher.main import run_with | ||
from antareslauncher.main_option_parser import MainOptionParser | ||
from antareslauncher import definitions | ||
from antareslauncher.main import run_with, MainParameters | ||
from antareslauncher.main_option_parser import ( | ||
MainOptionParser, | ||
MainOptionsParameters, | ||
) | ||
|
||
if __name__ == "__main__": | ||
parser: MainOptionParser = MainOptionParser() | ||
main_options_parameters = MainOptionsParameters( | ||
default_wait_time=definitions.DEFAULT_WAIT_TIME, | ||
default_time_limit=definitions.DEFAULT_TIME_LIMIT, | ||
default_n_cpu=definitions.DEFAULT_N_CPU, | ||
studies_in_dir=definitions.STUDIES_IN_DIR, | ||
log_dir=definitions.LOG_DIR, | ||
finished_dir=definitions.FINISHED_DIR, | ||
ssh_config_file_is_required=definitions.SSH_CONFIG_FILE_IS_REQUIRED, | ||
ssh_configfile_path_alternate1=definitions.SSH_CONFIGFILE_PATH_ALTERNATE1, | ||
ssh_configfile_path_alternate2=definitions.SSH_CONFIGFILE_PATH_ALTERNATE2, | ||
) | ||
parser: MainOptionParser = MainOptionParser(main_options_parameters) | ||
parser.add_basic_arguments() | ||
parser.add_advanced_arguments() | ||
arguments = parser.parse_args() | ||
run_with(arguments) | ||
|
||
main_parameters = MainParameters( | ||
json_dir=definitions.JSON_DIR, | ||
default_json_db_name=definitions.DEFAULT_JSON_DB_NAME, | ||
slurm_script_path=definitions.SLURM_SCRIPT_PATH, | ||
antares_versions_on_remote_server=definitions.ANTARES_VERSIONS_ON_REMOTE_SERVER, | ||
default_ssh_dict_from_embedded_json=definitions.DEFAULT_SSH_DICT_FROM_EMBEDDED_JSON, | ||
db_primary_key=definitions.DB_PRIMARY_KEY, | ||
) | ||
|
||
run_with(arguments=arguments, parameters=main_parameters, show_banner=True) | ||
if not len(sys.argv) > 1: | ||
input("Press ENTER to exit.") |
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 |
---|---|---|
@@ -1,12 +1,39 @@ | ||
import sys | ||
|
||
from antareslauncher import main | ||
from antareslauncher.main_option_parser import MainOptionParser | ||
from antareslauncher import main, definitions | ||
from antareslauncher.main import MainParameters | ||
from antareslauncher.main_option_parser import ( | ||
MainOptionParser, | ||
MainOptionsParameters, | ||
) | ||
|
||
if __name__ == "__main__": | ||
parser: MainOptionParser = MainOptionParser() | ||
main_options_parameters = MainOptionsParameters( | ||
default_wait_time=definitions.DEFAULT_WAIT_TIME, | ||
default_time_limit=definitions.DEFAULT_TIME_LIMIT, | ||
default_n_cpu=definitions.DEFAULT_N_CPU, | ||
studies_in_dir=definitions.STUDIES_IN_DIR, | ||
log_dir=definitions.LOG_DIR, | ||
finished_dir=definitions.FINISHED_DIR, | ||
ssh_config_file_is_required=definitions.SSH_CONFIG_FILE_IS_REQUIRED, | ||
ssh_configfile_path_alternate1=definitions.SSH_CONFIGFILE_PATH_ALTERNATE1, | ||
ssh_configfile_path_alternate2=definitions.SSH_CONFIGFILE_PATH_ALTERNATE2, | ||
) | ||
parser: MainOptionParser = MainOptionParser( | ||
main_options_parameters=main_options_parameters | ||
) | ||
parser.add_basic_arguments() | ||
input_arguments = parser.parse_args() | ||
main.run_with(input_arguments) | ||
|
||
main_parameters = MainParameters( | ||
json_dir=definitions.JSON_DIR, | ||
default_json_db_name=definitions.DEFAULT_JSON_DB_NAME, | ||
slurm_script_path=definitions.SLURM_SCRIPT_PATH, | ||
antares_versions_on_remote_server=definitions.ANTARES_VERSIONS_ON_REMOTE_SERVER, | ||
default_ssh_dict_from_embedded_json=definitions.DEFAULT_SSH_DICT_FROM_EMBEDDED_JSON, | ||
db_primary_key=definitions.DB_PRIMARY_KEY, | ||
) | ||
|
||
main.run_with(arguments=input_arguments, parameters=main_parameters, show_banner=True) | ||
if not len(sys.argv) > 1: | ||
input("Press ENTER to exit.") |
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.