Code Monkey home page Code Monkey logo

io-model-builder's Introduction

iomb - Input-Output Model Builder

iomb is an open source Python library for creating environmentally extended input-output models (EEIO models) from CSV files in a simple data format. It includes functions to calculate different result types (e.g. life cycle assessment results, direct and upstream contributions, etc.) from such models and convert them into JSON-LD data packages that can be imported into openLCA.

Installation

iomb is tested with Python 3.5 but should also work with older versions of Python 3. The easiest way to install the package is to do so using pip, which is generally packaged with a Python installation. Open up the command line and enter:

pip install IO-Model-Builder

This will also install the dependencies of the IO-Model-Builder (NumPy, pandas, and matplotlib) if required. After this you should be able to use the iomb package in your Python code. To uninstall the package, you can again use pip from the command line:

pip uninstall IO-Model-Builder

Usage

You can find a more detailed example here in form of a Jupyter notebook which is a convenient way to use iomb. The following script shows the basic usage of iomb. For detailed information about the data format see the data format specification

License

This project is in the worldwide public domain, released under the CC0 1.0 Universal Public Domain Dedication.

Public Domain Dedication

Public Domain Dedication

Citation

Please cite as: Srocka, M. and W. Ingwersen (2017). IO Model Builder, v1.1 (or current version). US Environmental Protection Agency. https://www.github.com/usepa/io-model-builder

A brief description of the iomb is also included in: Yang, Y., Ingwersen, W.W., Hawkins, T.R., Srocka, M., Meyer, D.E., 2017. USEEIO: A New and Transparent United States Environmentally-Extended Input-Output Model. Journal of Cleaner Production 158, 308-318. DOI: 10.1016/j.jclepro.2017.04.150

io-model-builder's People

Contributors

bl-young avatar msrocka avatar wesingwersen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

io-model-builder's Issues

regarding some missing files

model = iomb.make_model('drc.csv',
['satellite_table1.csv', 'satellite_table2.csv'],
"sector_meta_data.csv",
['LCIA_factors1.csv', 'LCIA_factors1.csv'])
I would like to know if the files "satellite_table1.csv, satellite_table2.csv, LCIA_factors_factors1.csv, etc." need to be provided or is automatically created by the program. This program is giving many errors mostly regarding missing files.

result = iomb.calculate(model, {'1111a0/oilseed farming/us': 1})
print(result.this_result)
Also, there is no attribute in the Result class called this_result.

Would appreciate if someone got back to me.

I am running the code in Acanonda Python Spyder.

Should we use metadata files for elementary flows?

Metadata files of elementary flows are currently not used as all information about a flow is currently also available in the satellite tables. However, it could be useful to extract fields like CAS number, flow UUID, chemical formula, description, etc. from the satellite tables and add them to a metadata file.

This could be also useful when we want to create links to other product flows via the satellite matrix.

as_matrix deprecated

the as_matrix function here has been deprecated since pandas 0.23

recommendation is to use .to_numpy() isntead.

Capturing additional data quality information

Currently we have the ability to capture flow level data quality scores in the satellite tables.

We should be able to include the USEPA data quality schemes in the background. I will upload a json-ld file with the flow and process level schemes.

I would like also to be able to assign flow level data quality for the commodity inputs created from the direct requirements table. To keep this simple, this can be added manually for now. For the USEEIO, using the USEPA data quality scheme the scores would be {1;3;1;1;1}

Perhaps the sector metadata file format can be expanded to allow for process level scores to be entered for each process/sector.
USEPA_DataQualitySchemes_JSON-LDforopenLCA1.6.zip

In the end we would like to be able to export the flow-level data quality and process-level data quality data into JSON-LD

Validation - check for repeat UUIDs

Upon creation of the JSON-LD files from a model, I received warnings that a duplicate .json file for a flow was being created:

site-packages\iomb\olca_init_.py:267: UserWarning: Duplicate name: 'flows/eff3fef5-fcfc-4201-be4e-a2d342c2e0c7.json'
pack.writestr(path, s)

I believe this is because the UUIDs were repeated for the flow. This was not reported during the validation. It would be nice if the Validation tested for repeat UUIDs.

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.