frompathlibimportPathfromtypingimportOptionalfrommetaDMG.filtersimportload_results# Needed for sphinx to include load_results__all__=["compute_config","run_dashboard","load_results"]
[docs]defcompute_config(config_file:Path=Path("config.yaml"),force:bool=False,)->None:"""Run the LCA and fit on the config file. Parameters ---------- config_file The config file to run the computations on, by default Path("config.yaml") force Force the computation, i.e. do not load (intermediate) results, by default False """frommetaDMGimportutilsutils.check_metaDMG_fit()frommetaDMG.fitimportrun_workflowconfigs=utils.make_configs(config_file=config_file,force=force)run_workflow(configs)
[docs]defrun_dashboard(config_file:Path=Path("config.yaml"),results:Optional[Path]=None,debug:bool=False,server:bool=False,port:int=8050,host:str="0.0.0.0",)->None:"""Visualise the results in an interactive dashboard Parameters ---------- config_file The the config file to use to locate the results directory, by default Path("config.yaml") results The results directory, by default None debug Whether or not the debug-button should be displayed, by default False server Whether or not it should behave as running on a server, by default False port Dashboard port, by default 8050 host Dashboard host address, by default "0.0.0.0" """frommetaDMGimportutilsutils.check_metaDMG_viz()frommetaDMG.vizimportstart_dashboardresults_dir=utils.get_results_dir(config_file=config_file,results_dir=results,)start_dashboard(results_dir=results_dir,debug=debug,server=server,host=host,port=port,)