T-reX.main ========== .. py:module:: T-reX.main .. autoapi-nested-parse:: main Module =========== Main module of the `T-reX` tool. This script serves as the entry point for the `T-reX` tool. It orchestrates the overall process, including the setup and execution of various subprocesses like database explosion, material and waste searches, and the editing of exchanges. The script supports both single and multiple project/database modes, as well as the option to use multiprocessing. It also facilitates the use of the premise module to generate future scenario databases. Customisation: -------------- - Project and database names, and other settings can be edited in `config/user_settings.py`. - Waste search query terms can be customised in `config/queries_waste.py`. - The list of materials can be modified in `config/queries_materials.py`. Usage: ------ To use the default settings, run the script with `python main.py`. Arguments can be provided to change project/database names or to delete the project before running. Attributes ---------- .. autoapisummary:: T-reX.main.num_cpus T-reX.main.script_dir Functions --------- .. autoapisummary:: T-reX.main.run T-reX.main.ExplodeAndSearch T-reX.main.EditExchanges Module Contents --------------- .. py:data:: num_cpus .. py:data:: script_dir .. py:function:: run() Main function serving as the wrapper for the T-reX tool. This function coordinates the various components of the tool, including: creating future scenario databases, setting up and processing each database for waste and material footprinting, and combining results into a custom database. adding LCIA methods to the project for each of the waste/material flows. The function supports various modes of operation based on the settings in `config/user_settings.py`. Specifications for material and waste searches can be customised in `queries_materials`. .. py:function:: ExplodeAndSearch(args) Exploding the database into separate exchanges, searching for waste and material flows, and processing these results. This includes: - ExplodeDatabase.py - SearchWaste.py - SearchMaterial.py :param args: Dictionary containing database and project settings. :returns: None .. py:function:: EditExchanges(args) Edit exchanges in the database. This function adds waste and material flows to the activities and verifies the database. :param args: Dictionary containing database and project settings. :returns: None