Mescal

Latest version: v1.1.1

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

Scan your dependencies

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.

1.0.1

Added
- Perform double-counting removal using the `create_esm_database` function (from `double_counting.py`).
- Compute your LCA metrics for a set of impact categories using the `compute_impact_scores` function (from `impact_assessment.py`).
- Reformat results as `.mod` and `.dat` files if you are using [AMPL](https://ampl.com/) with the `normalize_lca_metrics` (from `normalization.py`) and `gen_lcia_obj` (from `generate_lci_obj_ampl.py`) functions.
- Feed the ESM results back in the LCI database using the `create_new_database_with_esm_results` function (from `esm_back_to_lca.py`).
- Add CPC categories to additional LCI datasets, e.g., from [Premise](https://premise.readthedocs.io/en/latest/introduction.html), with the `create_new_database_with_CPC_categories` function (from `CPC.py`).
- Relink a mapping to a new database using the `create_complementary_database` function (from `link_to_premise.py`).
- Relink a mapping to a new version of [ecoinvent](https://ecoinvent.org/) using the `change_ecoinvent_version_mapping` and `update_unit_conversion_file` functions (`change_ecoinvent.py`).
- Regionalize the foreground of LCI datasets by setting `regionalize_foregrounds=True` in the `create_esm_database` function (from `double_counting.py`).

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.