Giter VIP home page Giter VIP logo

lavoisier's Introduction

Logo Lavoisier

Python library for conversions between Life Cycle Assessment (LCA) inventory formats. Currently, it does both ways of conversion between EcoSpold 2 and ILCD 1 formats. Other versions and other dataset types are to be included due time as Lavoisier is a work in progress.

Lavoisier's objective is to make possible a cohesive conversion with lower loss of information between LCA inventory formats. This objective is in line with the efforts in the LCA community for a higher interoperability within data formats, in a way having a dataset of one inventory format does not limit its usability with other inventory formats.

Right now, Lavoisier is incorpored in the Brazilian Life Cycle Inventory database (namely SICV-Brasil) to make possible the conversion of Ecospold 2 datasets from Brazilian reseach to ILCD 1 format on the upload process.

The field conversion is based on Greendelta's converter https://github.com/GreenDelta/olca-conversion-service, but Lavoisier can overcome major shortcomings from OpenLCA converter such as loss of Pedigree matrix uncertainty and coefficient information, some input flows not converted and loss of all parameters and mathematical equations.

The project is still updating frequently and feedback is welcomed. The main branch has the most stable version, while the development branch has the latest updates of the library. Tests are made mainly on Linux (Ubuntu).

Installation

Lavoisier will require the following packages:

  • pathlib to help with file and diretory paths
  • pint to help with unit conversion
  • xmltodict to help with XML parsing
  • openturns to help with uncertainty conversion
  • pycryptodome to help with UUID conversion

To install the dependencies beforehand, use the commands below

  • Install dependent libraries
pip install pathlib pint xmltodict openturns pycryptodome
  • Install Lavoisier
python3 pip install Lavoisier

If you want to install it via github clone, just execute the setup.py file. In the case of uninstalling or trying to install it by pip again, it is recomended to run as administrator or sudo, since problems related to .pyc files could raise. Follow the steps bellow:

  • Clone github repository
git clone https://github.com/JosePauloSavioli/IBICT-converter
  • Go to repository and install the library
cd path/to/cloned/library
python3 setup.py install

Conversion

Lavoisier works by creating a Converter class using the method get_converter(input_: tuple, output: tuple, path: str, save_path: str, mode: str). The input_ and output tuples are the format and elementary flow mapping to be used in conversion. Currently, available format options are "ILCD1" and "EcoSpold2" and available elementary flow mappings are "EF3.0" for ILCD and "ecoinvent3.7" for EcoSpold 2. The mode is an entry to specify if the conversion is to single file(s) of the output format (to file) or to a single database (to database - available only for EcoSpold2 to ILCD1 conversion).

The Converter class has the information about the two formats and is changeable within that conversion. It has a main attribute that can be changed before conversion, the elementary flow mapping file (attr: elem_flow_mapping) and other attributes that are set depending on the conversion being carried out. To see these attribute options one can print the converter.

For example, to convert a file and a directory of files from EcoSpold 2 to ILCD 1:

# To convert a file
converter = get_converter(("EcoSpold2", "ecoinvent3.7"), ("ILCD1", "EF3.0"),
                           "path_to_file", "path_to_save_directory", "to_file")

# To convert a directory with files
converter = get_converter(("EcoSpold2", "ecoinvent3.7"), ("ILCD1", "EF3.0"),
                           "path_to_directory", "path_to_save_directory", "to_file")

# To see the available options
print(converter)

The Converter class has one method called convert which is used to carry out the conversion at any given time.

converter.convert()

Support

This project was developed in the Center for Life Cycle Sustainability Assessment (GYRO) of the Federal University of Technology - Paraná (UTFPR) with the support of the Brazilian Institute of Information in Science and Technology (IBICT). It began with the support of REAL (Resource Efficiency through Application of Life Cycle Thinking) of the UN Environment and The Life Cycle Initiative funded by the European Commission.

-> GYRO website: http://gyro.ct.utfpr.edu.br

Code developed by José Paulo Pereira das Dores Savioli. Logo created by Larissa Ugaya Mazza.

Logo GYROLogo UTFPRLogo IBICT

lavoisier's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

lavoisier's Issues

Validation of conversion results of ILCD and EcoSpold 2

Lavoisier validation/test of conversion results is done by comparing them semi-manually with the original dataset (through comparing original and converted parsed field information). This is done mainly due to the lack of software that can import both ILCD .zip and EcoSpold 2 .spold files.

Although this semi-manual validation is effective in pointing out implementation problems and can ensure to some degree that the converted results have the same meaning as the original information, there is still a lack of a more robust validation step that includes the usability of converted data in software, enhancing security that the converted data has similar behavior compared to the original and generates similar results (considering conversions are dependent on external factors such as the elementary flow mapping that can affect flow conversions).

Brightway is in the early stages of implementation of an ILCD input module, which makes it a candidate to make this validation as EcoSpold 2 is already implemented. But in the meantime, is there any option for software that accepts input from both EcoSpold 2 and ILCD alike?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.