mescal.modify_inventory

Functions

adapt_rest_of_the_world_activity_based_on_other_activity(→ None)

Change one RoW activity by copying and adapting the same activity in another location

add_carbon_capture_to_plant(→ None)

Add a carbon capture process to a technology, and modifies its direct carbon dioxide emissions

add_carbon_dioxide_flow(→ None)

Add a carbon dioxide flow to an activity

change_dac_biogenic_carbon_flow(→ None)

Change the biogenic carbon flow of premise DAC technologies to a fossil carbon flow

change_direct_carbon_emissions_by_factor(→ None)

Change the direct emissions of an activity by a factor

change_flow_value(→ None)

Change the value of a flow in an activity

change_fossil_carbon_flows_of_biofuels(→ None)

remove_quebec_flow_in_global_heat_market(→ None)

Remove the Quebec heat flow in the global heat market activity

Module Contents

mescal.modify_inventory.adapt_rest_of_the_world_activity_based_on_other_activity(db_name: str, activity_name: str, product_name: str, reference_activity_location: str) None[source]

Change one RoW activity by copying and adapting the same activity in another location

Parameters:
  • db_name (str) – name of the LCI database

  • activity_name (str) – name of the activity to be changed

  • product_name (str) – name of the reference product of the activity to be changed

  • reference_activity_location (str) – location of the activity to be used as reference

Returns:

None (changes are saved in the database)

Return type:

None

mescal.modify_inventory.add_carbon_capture_to_plant(activity_database_name: str, premise_database_name: str, plant_type: str, activity_name: str = None, activity_code: str = None, capture_ratio: float = 0.95, change_activity_name: bool = False) None[source]

Add a carbon capture process to a technology, and modifies its direct carbon dioxide emissions

Parameters:
  • activity_database_name (str) – name of the LCI database in which the activity to modify is located

  • premise_database_name (str) – name of the premise LCI database where the carbon capture processes are located

  • activity_name (str) – name of the activity to be changed (to use only if the name of the activity is unique in the database)

  • plant_type (str) – type of the activity to be changed. Can be ‘cement’, ‘hydrogen’, ‘municipal solid waste’, ‘synthetic natural gas’, ‘wood’, ‘hard coal’, ‘lignite’, or ‘natural gas’.

  • activity_code (str) – code of the activity to be changed

  • capture_ratio (float) – carbon capture ratio, i.e., direct carbon dioxide emissions reduction rate

  • change_activity_name (bool) – if True, the activity name is changed to include ‘with CCS’

Returns:

None (changes are saved in the database)

Return type:

None

mescal.modify_inventory.add_carbon_dioxide_flow(db_name: str, amount: float, activity_name: str = None, activity_code: str = None, biosphere_db_name: str = None, co2_flow_type: str = 'fossil') None[source]

Add a carbon dioxide flow to an activity

Parameters:
  • db_name (str) – name of the LCI database

  • activity_name (str) – name of the activity to be changed (to use only if the name of the activity is unique in the database)

  • activity_code (str) – code of the activity to be changed

  • amount (float) – amount of the carbon dioxide flow

  • biosphere_db_name (str) – name of the biosphere database. Default is ‘biosphere3’.

  • co2_flow_type (str) – type of carbon dioxide flow to add. Can be ‘fossil’, ‘non-fossil’, ‘from soil or biomass stock’, ‘in air’, or ‘non-fossil, resource correction’. Default is ‘fossil’.

Returns:

None (changes are saved in the database)

Return type:

None

mescal.modify_inventory.change_dac_biogenic_carbon_flow(db_name: str, activity_name: str = None, activity_code: str = None, biosphere_db_name: str = None) None[source]

Change the biogenic carbon flow of premise DAC technologies to a fossil carbon flow

Parameters:
  • db_name (str) – name of the LCI database

  • activity_name (str) – name of the activity to be changed (to use only if the name of the activity is unique in the database)

  • activity_code (str) – code of the activity to be changed

  • biosphere_db_name (str) – name of the biosphere database. Default is ‘biosphere3’.

Returns:

None (changes are saved in the database)

Return type:

None

mescal.modify_inventory.change_direct_carbon_emissions_by_factor(db_name: str, activity_name: str = None, activity_code: str = None, factor: float = 1) None[source]

Change the direct emissions of an activity by a factor

Parameters:
  • db_name (str) – name of the LCI database

  • activity_name (str) – name of the activity to be changed (to use only if the name of the activity is unique in the database)

  • activity_code (str) – code of the activity to be changed

  • factor (float) – factor by which the direct emissions are multiplied

Returns:

None (changes are saved in the database)

Return type:

None

mescal.modify_inventory.change_flow_value(activity_code: str, database_name: str, flow_code: str, flow_type: str, new_value: float) None[source]

Change the value of a flow in an activity

Parameters:
  • activity_code (str) – code of the activity to be changed

  • database_name (str) – name of the LCI database

  • flow_code (str) – code of the flow to be changed

  • flow_type (str) – type of the flow to be changed. Can be ‘biosphere’ or ‘technosphere’.

  • new_value (float) – new value of the flow

Returns:

None (changes are saved in the database)

Return type:

None

mescal.modify_inventory.change_fossil_carbon_flows_of_biofuels(db_name: str, activity_name: str = None, activity_code: str = None, biogenic_ratio: float = 1, biosphere_db_name: str = None) None[source]
Parameters:
  • db_name (str) – name of the LCI database

  • activity_name (str) – name of the activity to be changed (to use only if the name of the activity is unique in the database)

  • activity_code (str) – code of the activity to be changed

  • biogenic_ratio (float) – fraction of biogenic carbon in the biofuel. Default is 1 (100% biogenic).

  • biosphere_db_name (str) – name of the biosphere database. Default is ‘biosphere3’.

Returns:

None (changes are saved in the database)

Return type:

None

mescal.modify_inventory.remove_quebec_flow_in_global_heat_market(db_name: str, activity_name: str = None, activity_code: str = None) None[source]

Remove the Quebec heat flow in the global heat market activity

Parameters:
  • db_name (str) – name of the LCI database

  • activity_name (str) – name of the activity to be changed (to use only if the name of the activity is unique in the database)

  • activity_code (str) – code of the activity to be changed

Returns:

None (changes are saved in the database)

Return type:

None