Recent Releases of mescal
mescal - 1.2.4
What is new?
- Contribution analysis plotting function
plot_contribution_analysis(inplot.py) to visualize the contribution of processes and elementary flows. Thanks @ArthurChuat !
What has changed?
- Upper limits in AMPL files from 1e10 to
Infinityfor better numerical stability (ingenerate_lcia_obj_ampl.py).
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str 2 months ago
mescal - 1.2.3
What is new?
- Support for the decommissioning phase of energy technologies as a separate LCI dataset type in the ESM database. Datasets of
Type"Decommission" can now be defined in themappingfile. Theunit_conversionandtechnology_compositionsfiles
should be updated accordingly. To handle cases where end-of-life intermediary flows are included in the "Construction" LCI datasets, the_add_decommission_datasetsmethod (indecommission.py) builds on thedouble_counting_removalmethod
(indouble_counting.py) to extract end-of-life flows and aggregate them in the new "Decommission" datasets. Theadd_decommission_datasetsmethod is activated when settingextract_eol_from_constructiontoTruein theESMclass. - The method
compute_territorial_impact_scores(inimpact_assessment.py) to compute territorial impact scores (i.e., impacts occurring inesm_locationover the life-cycle). Thecompute_territorial_impact_scoresmethod requires a contribution analysis of processes obtained
from thecompute_impact_scoresmethod. Thenormalize_lca_metrics(innormalization.py) andgenerate_mod_file_ampl(ingenerate_lcia_obj_ampl.py) methods have been updated accordingly to handle the integration of territorial and abroad impact scores in ESMs. - Generic examples of user input data files on ReadTheDocs. These include examples of
mapping,unit_conversion,model, andmapping_esm_flows_to_CPC_catderived from our applications with the EnergyScope model. - The integration of
ABContributionAnalysisclass from Activity-Browser and the use ofpypardisoto improve LCIA computation speed. - The formulation of LCA equations in AMPL for the EnergyScope core version (in
normalization.pyandgenerate_lcia_obj_ampl.py). - The comparison of system-level results in the
validation_double_countingandvalidation_direct_carbon_emissionsmethods, i.e., the system-level primary energy use and system-level direct carbon emissions, respectively. - The
load_dependenciesargument to theDatabaseclass (indatabase.py) to control whether dependencies are loaded when loading databases.
What has changed?
- Formatting of columns of the
impact_scoresDataFrame returned by thecompute_impact_scoresmethod (inimpact_assessment.py). The following columns were added:Impact_category_unit,Functional unit,Impact_category (level x)wherextypically ranges from 1 to 3, depending on the LCIA method.
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str 5 months ago
mescal - 1.2.2
What has changed?
- The
Plotclass works without setting a brightway project (inplot.py), in preparation for EnergyScope Symposium 2025. - The optimization variables modeling the environmental impacts can be negative, thus allowing for net-negative configurations (in
generate_lcia_obj_ampl.py).
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str 7 months ago
mescal - 1.2.1
What is new?
- The
background_double_counting_removalmethod (indouble_counting.py) that creates a new version of the technosphere matrix where flows included in the ESM end-use demands are set to zero, thus preventing double-counting. This step is needed if the ESM end-use demands include the production and operation of new infrastructures. - The
req_technosphereargument to thecompute_impact_scoresmethod (inimpact_assessment.py). If True, the method returns the technosphere flows requirements (life-cycle inventory) of the ESM technologies and resources. - The
esm_end_use_demandsandremove_double_counting_toarguments to theESMclass in order to apply the double-counting removal process to infrastructure and resource datasets (in addition to operation datasets). - The
stop_background_search_when_first_flow_foundargument in theESMclass to stop or continue the background search for double-counting removal when the first flow of the targeted category is found (inesm.py). - The
_validation_double_countingmethod (indouble_counting.py, included in thecreate_esm_databasemethod) to compare the flows removed during the double-counting removal process and the flows in the ESM. - The
validation_direct_carbon_emissionsmethod (inimpact_assessment.py) comparing direct carbon emissions in the ESM and from the impact assessment phase (direct emissions module).
What has changed?
- The type of the
regionalize_foregroundsargument in theESMclass is now a string or list of string (instead of a boolean) in order to apply the foreground regionalization process only to certain types of LCI datasets (instead of all or none of them). - The
harmonize_with_esmargument of thecreate_new_database_with_esm_resultsmethod has been replaced by the two argumentsharmonize_efficiency_with_esmandharmonize_capacity_factor_with_esmto be able to harmonize the efficiency and capacity factor separately (inesm_back_to_lca.py).
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str 8 months ago
mescal - 1.2.0
What is new?
PathwayESMclass (inesm.py) to create databases and impact score dataframes for all ESM time steps at once.- Contribution analysis of processes in
compute_impact_scores(inimpact_assessment.py) by settingcontribution_analysistoprocesses. max_depth_double_counting_searchargument in theESMclass to limit the depth of the search in the double-counting removal process (indouble_counting.py).- Harmonization of efficiency and capacity factor with the ESM in the ESM results database (in
esm_back_to_lca.pyandadapt_efficiency.py). - Loss coefficient (based on the one of the original dataset) for datasets in the ESM results database (in
esm_back_to_lca.py).
What has changed?
- Corrected unit conversion for elementary flows contribution analysis in
compute_impact_scores(inimpact_assessment.py). - Improved double-counting removal process for market-type activities in the ESM results database (i.e., removal of infrastructure flows) (in
esm_back_to_lca.pyanddouble_counting.py). - If specified in
tech_specifics, double-counting removal during background search is allowed even if a flows has already been set to zero (indouble_counting.py). - Relinking of the main database with the ESM results database can be based on activity names and/or product names, and for a user-defined set of geographies
locations(inesm_back_to_lca.py). - Default
esm_locationis GLO and defaultaccepted_locationsis [esm_location] in theESMclass (inesm.py).
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str 11 months ago
mescal - 1.1.4
What is new?
- Contribution analysis of elementary flows in the
MultiLCAclass ofcompute_impact_scores(inimpact_assessment.py) by settingcontribution_analysisto True. - Use of
loggingandtqdmfor improved logging and progress tracking in thecreate_esm_databasefunction (indouble_counting.py),compute_impact_scoresfunction (inimpact_assessment.py), andcreate_new_database_with_esm_results,connect_esm_results_to_databasefunctions (inesm_back_to_lca.py). - Check for duplicates in input dataframes in the
check_inputsfunction (inesm.py).
What has changed?
- Corrected tuple item assignment for creating the direct emissions database in
compute_impact_scores(inimpact_assessment.py).
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str about 1 year ago
mescal - 1.1.3
What is new?
- 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_activitiesinCPC.py). - Handling error due to missing category ('air', 'lower stratosphere + upper troposphere') for "Carbon dioxide, non-fossil" in ecoinvent 3.10 and earlier.
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str about 1 year ago
mescal - 1.1.2
What is new?
- 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 (seeRegioinventorRegiopremise). - The function
add_carbon_capture_to_plant(inmodify_inventory.py) that adds a carbon capture and storage (CCS) process to a power plant and modifies its direct emissions accordingly. - The
main_database_nameargument of theESMclass that specifies the name of your ecoinvent database in case the input database in an aggregation of several databases. - The
assessment_typeargument innormalize_lca_metrics(innormalization.py) andgenerate_mod_file_ampl(ingenerate_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 (
Plotclass inplot.py) to visualize the results of thecompute_impact_scoresfunction (inimpact_assessment.py). - The
connect_esm_results_to_databasemethod (inesm_back_to_lca.py) to connect the LCI datasets created from ESM results to another LCI database. Thecreate_new_database_with_esm_resultsmethod now only creates a new database with the LCI datasets from ESM results. - The
biosphere_db_nameargument in theESMclass to specify the name of the biosphere database.
What has changed?
- Corrected error occurring in
correct_esm_and_lca_efficiency_differences(inadapt_efficiency.py) when several input fuel flows were present in an operation LCI dataset. - The
mapping_ecoinvent_version_ipynbnotebook (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.pyandgenerate_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.
What has been removed?
- The
spatialized_databaseargument of theESMclass. It is now set to True ifspatialized_biosphere_dbis notNone.
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str about 1 year ago
mescal - 1.1.1
What is new?
- Arguments
specific_lcia_methods,specific_lcia_categoriesandspecific_lcia_abbrevin thenormalize_lca_metrics(innormalization.py) andgenerate_mod_file_ampl(ingenerate_lcia_obj_ampl.py) functions to specify the LCIA methods or impact categories to be used when generating the AMPL .mod and .dat files.
What has changed?
- Set the
refactorparameter in thenormalize_lca_metricsfunction (innormalization.py) depending on theAoP(inimpact_abbrev.csv) rather than the impact category.
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str over 1 year ago
mescal - 1.1.0
What is new?
- The function
change_direct_carbon_emissions_by_factor(inmodify_inventory.py) changes all direct carbon emissions by a factor. - The function
add_carbon_dioxide_flow(inmodify_inventory.py) adds a fossil carbon dioxide flow to an LCI dataset.
What has changed?
- Major update: the
mescalpackage has been restructured from functional programming to object-oriented programming. The classesESM(inesm.py),Database(indatabase.py) andDataset(indatabase.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.
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str over 1 year ago
mescal - 1.0.3
What is new?
- The function
change_fossil_carbon_flows_of_biofuels(inmodify_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_metricfromnormalization.pyandgenerate_lci_objfromgenerate_lci_obj_ampl.py). - Correction of CA-QC heat flows in the ecoinvent database for global markets (in
remove_quebec_flow_in_global_heat_marketfrommodify_inventory.py). - Option added to check for duplicated activities in terms of (product, name, location) tuple when merging several databases (in
merge_databasesfromutils.py). - A specific category for imports and exports has been added in
technology_specifics.csvto avoid their regionalization to the ESM geography.
What has 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.datandobjectives.modare used regardless of the LCIA method employed). - For AMPL files generation, the
refactorparameter is computed based on the LCA indicator data rather than being a user input.
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str over 1 year ago
mescal - 1.0.2
What is new?
- regionalization of biosphere flows in the
regionalize_activity_foregroundfunction, 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_differencesfunction - possibility to return the database instead of writing it (or both) in the
create_esm_databaseandcreate_new_database_with_esm_resultsfunctions
What has changed?
concatenate_databasefunction renamedload_multiple_databasesto avoid confusion with newmerge_databasesfunctionunit_conversion.csvfile has its columnsFromandTorenamedESMandLCAfor better clarity- Reformatted and added new information to the double-counting removal output csv files
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str almost 2 years ago
mescal - 1.0.1
What is already available in Mescal?
- Perform double-counting removal
- Compute your LCA metrics for a set of impact categories
- Reformat the results as
.modand.datfiles if you are using AMPL - Feed the ESM results back in the LCI database
- Add CPC categories to additional LCI datasets, e.g., from Premise
- Relink a mapping to a new database / a new version of ecoinvent
- Regionalize the foreground of LCI datasets
What is coming next?
- Ease the use of Mescal with transition models (generation of metrics for various time steps and scenarios)
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str almost 2 years ago
mescal - First release
What is already available in Mescal?
- Perform double-counting removal
- Compute your LCA metrics for a set of impact categories
- Reformat the results as
.modand.datfiles if you are using AMPL - Feed the ESM results back in the LCI database
- Add CPC categories to additional LCI datasets, e.g., from Premise
- Relink a mapping to a new database / a new version of ecoinvent
- Regionalize the foreground of LCI datasets
What is coming next?
- Ease the use of Mescal with transition models (generation of metrics for various time steps and scenarios)
Energy Systems - Energy System Modeling Frameworks
- Jupyter Notebook
Published by matthieu-str almost 2 years ago