Mescal

Latest version: v1.1.3

Safety actively analyzes 723217 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.1.3

Added
- A mapping between existing _ecoinvent_ products and their CPC categories (`data/mapping_existing_products_to_CPC.json`) and a method to add CPC categories, when missing, based on this mapping (`add_CPC_categories_based_on_existing_activities` in `CPC.py`).
- Handling error due to missing category ('air', 'lower stratosphere + upper troposphere') for "Carbon dioxide, non-fossil" in ecoinvent 3.10 and before.

1.1.2

Added
- A spatialized biosphere database and the regionalized EF 3.1 methods (in `dev/ef regionalized/EF 3.1 regionalized.ipynb`). Your ecoinvent database then needs to be spatialized (see [`Regioinvent`](https://github.com/CIRAIG/Regioinvent/) or [`Regiopremise`](https://github.com/matthieu-str/Regiopremise/tree/master)).
- The function `add_carbon_capture_to_plant` (in `modify_inventory.py`) that adds a carbon capture and storage (CCS) process to a power plant and modifies its direct emissions accordingly.
- The `main_database_name` argument of the `ESM` class that specifies the name of your ecoinvent database in case the input database in an aggregation of several databases.
- The `assessment_type` argument in `normalize_lca_metrics` (in `normalization.py`) and `generate_mod_file_ampl` (in `generate_lcia_obj_ampl.py`) functions to differentiate between life-cycle impacts computation (by default) and direct emissions impact computation (`assessment_type="direct emissions"`).
- Plotting methods (`Plot` class in `plot.py`) to visualize the results of the `compute_impact_scores` function (in `impact_assessment.py`).
- The `connect_esm_results_to_database` method (in `esm_back_to_lca.py`) to connect the LCI datasets created from ESM results to another LCI database. The `create_new_database_with_esm_results` method now only creates a new database with the LCI datasets from ESM results.
- The `biosphere_db_name` argument in the `ESM` class to specify the name of the biosphere database.

Changed
- Corrected error occurring in `correct_esm_and_lca_efficiency_differences` (in `adapt_efficiency.py`) when several input fuel flows were present in an operation LCI dataset.
- The `mapping_ecoinvent_version_ipynb` notebook (to change the ecoinvent version of your mapping file) has been updated to work with version 3.10.1 of ecoinvent.
- Variables and parameters naming for direct emissions indicators in the AMPL files (in `normalization.py` and `generate_lcia_obj_ampl.py`) to be more explicit.
- Inequality for equality constraints in the AMPL files (in `generate_lcia_obj_ampl.py`) in case there is no LCA objective function or constraint.

Removed
- The `spatialized_database` argument of the `ESM` class. It is now set to True if `spatialized_biosphere_db` is not `None`.

1.1.1

Added
- Arguments `specific_lcia_methods`, `specific_lcia_categories` and `specific_lcia_abbrev` in the `normalize_lca_metrics` (in `normalization.py`) and `generate_mod_file_ampl` (in `generate_lcia_obj_ampl.py`) functions to specify the LCIA methods or impact categories to be used when generating the AMPL .mod and .dat files.

Changed
- Set the `refactor` parameter in the `normalize_lca_metrics` function (in `normalization.py`) depending on the `AoP` (in `impact_abbrev.csv`) rather than the impact category.

1.1.0

Added
- The function `change_direct_carbon_emissions_by_factor` (in `modify_inventory.py`) changes all direct carbon emissions by a factor.
- The function `add_carbon_dioxide_flow` (in `modify_inventory.py`) adds a fossil carbon dioxide flow to an LCI dataset.

Changed
- **Major update**: the `mescal` package has been restructured from functional programming to object-oriented programming. The classes `ESM` (in `esm.py`), `Database` (in `database.py`) and `Dataset` (in `database.py`) have been created to perform operations on the ESM database, the LCI databases and the LCI datasets respectively. All functions from v1.0.3 are still available but have been reorganized in the classes.

1.0.3

Added
- The function `change_fossil_carbon_flows_of_biofuels` (in `modify_inventory.py`) changes fossil carbon emissions to biogenic carbon emissions if biofuels are used in the foreground.
- Metadata has been added at the beginning of AMPL files (in `normalized_lca_metric` from `normalization.py` and `generate_lci_obj` from `generate_lci_obj_ampl.py`).
- Correction of CA-QC heat flows in the ecoinvent database for global markets (in `remove_quebec_flow_in_global_heat_market` from `modify_inventory.py`).
- Option added to check for duplicated activities in terms of (product, name, location) tuple when merging several databases (in `merge_databases` from `utils.py`).
- A specific category for imports and exports has been added in `technology_specifics.csv` to avoid their regionalization to the ESM geography.

Changed
- The efficiency harmonization functions (in `adapt_efficiency.py`) can now accept multiple types of input flows instead of just one.
- The arguments of the regionalization functions have been renamed to differentiate between regionalization and spatialization.
- Renamed AMPL files (by default, `techs_lcia.dat` and `objectives.mod` are used regardless of the LCIA method employed).
- For AMPL files generation, the `refactor` parameter is computed based on the LCA indicator data rather than being a user input.

1.0.2

Added
- Regionalization of biosphere flows in the `regionalize_activity_foreground` function (from `regionalization.py`), and added conditions to prevent the regionalization when unnecessary.
- Correction of efficiency differences between the ESM and LCI databases (scale direct emissions accordingly) in the `correct_esm_and_lca_efficiency_differences` function (from `adapt_efficiency.py`).
- Option to return the database instead of writing it (or both) in the `create_esm_database` (from `double_counting.py`) and `create_new_database_with_esm_results` (from `esm_back_to_lca.py`) functions.

Changed
- `concatenate_database` function renamed to `load_multiple_databases` to avoid confusion with new `merge_databases` function (from `utils.py`).
- `unit_conversion.csv` file has its columns `From` and `To` renamed to `ESM` and `LCA` for better clarity.
- Reformatted and added new information to the double-counting removal output csv files.

Page 1 of 2

Links

Releases

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.