aegis
This script is executed when AEGIS is imported (import aegis
). Execute functions by running aegis.run_from_{}
.
AEGIS can be started in multiple ways; each of these functions starts AEGIS from a different context.
1""" 2This script is executed when AEGIS is imported (`import aegis`). Execute functions by running `aegis.run_from_{}`. 3AEGIS can be started in multiple ways; each of these functions starts AEGIS from a different context. 4""" 5 6import logging 7 8from aegis.manager import Manager 9from aegis.argparser import parse_terminal 10 11 12def run_from_script(custom_config_path, pickle_path, overwrite, custom_input_params): 13 """ 14 Use this function when you want to run aegis from a python script. 15 16 $ import aegis 17 $ aegis.run() 18 """ 19 20 manager = Manager( 21 custom_config_path=custom_config_path, 22 pickle_path=pickle_path, 23 overwrite=overwrite, 24 custom_input_params=custom_input_params, 25 ) 26 manager.run() 27 28 29def run_from_main(): 30 run_from_terminal() 31 32 33def run_from_terminal(): 34 custom_config_path, pickle_path, overwrite, server_mode = parse_terminal() 35 36 if (custom_config_path, pickle_path, overwrite) == (None, None, None): 37 logging.info("Starting run_gui.") 38 logging.info(f"Server mode is {'ON' if server_mode else 'OFF'}.") 39 if server_mode: 40 run_from_server_gui() 41 else: 42 run_from_local_gui() 43 else: 44 manager = Manager( 45 custom_config_path=custom_config_path, 46 pickle_path=pickle_path, 47 overwrite=overwrite, 48 custom_input_params={}, 49 ) 50 manager.run() 51 52 53def run_from_server_gui(): 54 import aegis_gui 55 56 aegis_gui.run(environment="server") 57 58 59def run_from_local_gui(): 60 import aegis_gui 61 62 aegis_gui.run(environment="local")
def
run_from_script(custom_config_path, pickle_path, overwrite, custom_input_params):
13def run_from_script(custom_config_path, pickle_path, overwrite, custom_input_params): 14 """ 15 Use this function when you want to run aegis from a python script. 16 17 $ import aegis 18 $ aegis.run() 19 """ 20 21 manager = Manager( 22 custom_config_path=custom_config_path, 23 pickle_path=pickle_path, 24 overwrite=overwrite, 25 custom_input_params=custom_input_params, 26 ) 27 manager.run()
Use this function when you want to run aegis from a python script.
$ import aegis $ aegis.run()
def
run_from_main():
def
run_from_terminal():
34def run_from_terminal(): 35 custom_config_path, pickle_path, overwrite, server_mode = parse_terminal() 36 37 if (custom_config_path, pickle_path, overwrite) == (None, None, None): 38 logging.info("Starting run_gui.") 39 logging.info(f"Server mode is {'ON' if server_mode else 'OFF'}.") 40 if server_mode: 41 run_from_server_gui() 42 else: 43 run_from_local_gui() 44 else: 45 manager = Manager( 46 custom_config_path=custom_config_path, 47 pickle_path=pickle_path, 48 overwrite=overwrite, 49 custom_input_params={}, 50 ) 51 manager.run()
def
run_from_server_gui():
def
run_from_local_gui():