Git Product home page Git Product logo

useeio's Issues

Key parameters should be at topic of file or require run with params passed separately

https://github.com/USEPA/USEEIO/blob/c4eb1700cdaf1345a584a81dbf94e74f2e3f8681/import_factors_exio/useeio_imports_script.py#L494C49-L494C49

This script is designed to generate import factors

  1. over a span of year(s)
  2. at a specified BEA level of detail

for 1, these parameter should either be clearly the the top of the file with the other params like the paths and not in this statement, or they should be required as params to be passed to this script upon execution

for 2, it's not that clear yet that this script only works at the Summary level which it appears to do. This needs to be very clear in the notes that it only works for that level.

Is is currency_converter correct? Can we find a better alternative for that package??

from currency_converter import CurrencyConverter

I tried to install this from PyPi using pip

pip install currency_converter

It installed the package currency.converter

Upon importing it for the first time i got an error because it depended on zope

I installed zope via pip but it is a whole application server and had a ton of dependencies.

I modified the import line to read

from currency.converter import CurrencyConverter
but the latter is not an object of the former so that didn't work.

Rather than fix this, can we find another package that doesn't have so many dependencies and has been update

FYI @bl-young

TiVA datasets are "after redefinitions"

The core models we use in USEEIO use the "before redefinitions" tables. TiVA data are only available "after redefinitions". Will this impact the values for some commodities?

Use satellite.M in place of impacts.M from EXIO 3

Right now we get this characterized matrix ..this is equivalent to our N.

But there is also satellite.M
There are many flows for the major GHGs in satellite.M which is perhaps why we choose a characterized version, however, we are missing some important flows like. We should probably get the unit data as well.
We can use grep on all the flows and get those starting with the major GHGs.

If we use satellite.M we can also get SF6, HFCs (as a group) and PFCs (as a group). It's more complete than the three gases that we are getting now.

Non-environment flows lack a category

Under the OpenLCA schema, all objects should be categorized. Flows that are elementary have elementary categories; however, many flows are not categorized. See the following two examples, chosen at random from a recent build:

{
  "@type": "Flow",
  "@id": "0a69c698-a3b0-3945-884c-0a75e5f4a444",
  "name": "1,4-Dichloro-2-butene",
  "flowType": "ELEMENTARY_FLOW",
  "flowProperties": [
    {
      "referenceFlowProperty": true,
      "conversionFactor": 1.0,
      "flowProperty": {
        "@id": "93a60a56-a3c8-11da-a746-0800200b9a66"
      }
    }
  ],
  "category": {
    "@id": "42c9fee0-d374-30e8-b2c5-32fa901a691e"
  }
}
{
  "@type": "Flow",
  "@id": "946a7ad3-1042-3ded-8a7f-8368643372ac",
  "name": "Compensation of employees",
  "flowType": "ELEMENTARY_FLOW",
  "flowProperties": [
    {
      "referenceFlowProperty": true,
      "conversionFactor": 1.0,
      "flowProperty": {
        "@id": "3bf53920-157c-4c2f-bddd-7c92c9d35f10"
      }
    }
  ]
}

EUTR factor wrong for NOx to air

Reported by Zia Chowdury.
EUTR factor for air/unspecified/nitrogen oxides is 0.08.
The correct value from TRACI 2.1 is 0.04429.

Review ROW country classifications

WL,Saint Lucia,ROW,2487,OthWestHem
WE,West Bank,ROW,5083,MiddleEast
WF,Wallis and Futuna,ROW,6413,AsiaAndPac

These three minor countries are the only contributors to these BEA regions. I'm a bit confused as to why that is and what that does to our RoW emission factor. Note that AsiaAndPac shows up in a contributions by region here, but I doubt that Wallis and Futuna is a good proxy for that

Imports of Other and Used gets dropped

t_df = get_tiva_data(year)
corr = (pd.read_csv(conPath / 'bea_imports_corr.csv',
usecols=['BEA Imports', 'BEA Summary'])
.drop_duplicates())
# ^^ requires mapping of import codes to summary codes. These codes are
# between detail and summary.
t_c = (t_df
.reset_index()
.rename(columns={'IOCode': 'BEA Imports'})
.merge(corr, on='BEA Imports', how='left', validate='one_to_many')
.drop(columns='BEA Imports')
.groupby('BEA Summary').agg('sum'))

There are significant imports of Other goods and some of Used goods (see rows from t_df from 2012 these are in million current USD)

IOCode CA CN EU JP MX APAC ROW
Used 2907 325 1456 179 713 360 578
Other 7766 3381 55516 12738 5021 15549 20653

but they get dropped after this merge because they are not in the concordance.

These would account for substantial embodied emissions and need to be handled.

Improve NAICS year specification for mappings

          > @Jnamovich where did the census NAICS -> BEA mapping come from? it's missing some NAICS that only exist in 2012 but no longer exist in 2017

Good catch. Looks like those data were using 2012 NAICS until 2019 when they switched to 2017 NAICS. If that switch is not described in the data its something we should report to the API maintainers and maintain a config file mapping the source by data year to the right NAICS year and make sure our crosswalk has both like we have here in flowsa under NAICS timeseries

Originally posted by @WesIngwersen in #25 (comment)

Index out of range errors on renaming sectors to USEEIO names

INFO Renaming sectors to USEEIO names in satellite tables...
Traceback (most recent call last):
File "useeiopyExample.py", line 9, in
useeio1pt1 = useeiopy.assemble("USEEIOv1.1")
File "c:\users\wingwers\useeio-public-test-jun7\useeiopy_init_.py", line 63, in assemble
Satellite.renameSatelliteSectors(satcsvfiles, sattablepath)
File "c:\users\wingwers\useeio-public-test-jun7\useeiopy\Satellite.py", line 61, in renameSatelliteSectors
names = read_names(Crosswalkrelpath + '/MasterCrosswalk.csv')
File "c:\users\wingwers\useeio-public-test-jun7\useeiopy\Satellite.py", line 78, in read_names
names[row[6].strip()] = row[8].strip()
IndexError: list index out of range

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.