Skip to content

Commit

Permalink
Fix - generate Interfaces using compartment/subcomp
Browse files Browse the repository at this point in the history
* The interface name (with compartment and subcompartment) had to be under Interface (name)
* The interfaceType name is taken from the name of the InterfaceType related to the Interface
  • Loading branch information
rnebot committed Dec 3, 2022
1 parent 1247359 commit 9074ac2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions enbios/bin/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,18 +317,18 @@ def enviro(cfg_file_path,
(you can copy and paste the example in an empty text file as reference, and ".yaml" as extension)
:param cfg_file_path: Path of the configuration file in YAML format
:param n_fragments: number of fragments to process, 0 for "all"
:param first_fragment: Index of the first fragment to be processed. To obtain an ordered list of fragments, execute first "enbios enviro" with "--just-prepare-base --fragments-list-file" options
:param generate_nis_base_file: True if the Base file should be generated (once) for testing purposes
:param generate_full_fragment_files: True to generate a full NIS formatted XLSX file for each fragment
:param generate_interface_results: True to generate a CSV with values at interfaces for each fragment
:param generate_indicators: True to generate a CSV with indicators for each fragment
:param fragments_list_file: True to generate a CSV with the list of fragments
:param keep_min_fragment_files: If True, do not delete minimal NIS files submitted to NIS to compute indicators
:param max_lci_interfaces: Max number of LCI interfaces to consider. 0 for all (default 0)
:param n_cpus: Number of CPUs of the local computer used to perform the process (default 1, sequential; 0 to find a good value for the computer automatically)
:param n_fragments: number of fragments to process, 0 (default) for "all"
:param first_fragment: Index of the first fragment to be processed (0 by default). To obtain an ordered list of fragments, execute first "enbios enviro" with "--just-prepare-base --fragments-list-file" options
:param generate_nis_base_file: True if the Base file should be generated (once) for testing purposes (False by default)
:param generate_full_fragment_files: True to generate a full NIS formatted XLSX file for each fragment (False by default)
:param generate_interface_results: True to generate a CSV with values at interfaces for each fragment (False by default)
:param generate_indicators: True to generate a CSV with indicators for each fragment (False by default)
:param fragments_list_file: True to generate a CSV with the list of fragments (False by default)
:param keep_min_fragment_files: If True (default), do not delete minimal NIS files submitted to NIS to compute indicators
:param max_lci_interfaces: Max number of LCI interfaces to consider. 0 (default) for all
:param n_cpus: Number of CPUs of the local computer used to perform the process (default 1, i.e., sequential; 0 to find a good value for the computer automatically)
:param log: Set log level to one of: Error (E, Err), Debug (D), Warning (W, Warn), Info (I), Off, Critical (Fatal)
:param just_prepare_base: True to only prepare (download, parse and execute, then cache; but not solve) Base file and exit
:param just_prepare_base: True to only prepare (download, parse and execute, then cache; but not solve) Base file and exit (False by default)
:return:
"""
# locale.setlocale(locale.LC_ALL, 'en_US')
Expand Down
2 changes: 1 addition & 1 deletion enbios/processing/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ def get_tech_simulation_scaling_factor():
orientation = i.attributes.get("orientation", "")
v = q.value
# TODO Static: does not depend on scenario or time, avoid inserting repeatedly
interfaces.append([proc_name, i.name, "", "", "", orientation, "", "", "", "", v,
interfaces.append([proc_name, i.taxon.name, i.name, "", "", orientation, "", "", "", "", v,
"", relative_to, "", "", "", "", "Year", "Ecoinvent", "", ""])

def _prepare_iamc_dataframe_fragment(state: State, indicators: pd.DataFrame, iamc_codes: Dict[str, str], metadata):
Expand Down

0 comments on commit 9074ac2

Please sign in to comment.