USEPA / standardizedinventories

Standardized Release and Waste Inventories
MIT License
25 stars 16 forks source link

v.1.0.5 SteWI issue with Posix path. While the solution seems simple str() but this issue cropped up recently. #138

Closed tjlca closed 1 year ago

tjlca commented 1 year ago

File "/Users/tghosh/Box Sync/FECM inventory/Industrial-Emissions-Inventory_2011/fecm_data_explorationv2.py", line 23, in import stewi,stewicombo File "/Users/tghosh/Box Sync/FECM inventory/Industrial-Emissions-Inventory_2011/standardizedinventories-1.0.5/stewi/init.py", line 10, in from stewi.globals import log, add_missing_fields,\ File "/Users/tghosh/Box Sync/FECM inventory/Industrial-Emissions-Inventory_2011/standardizedinventories-1.0.5/stewi/globals.py", line 43, in paths.local_path = os.path.realpath(paths.local_path + "/stewi") TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'

tjlca commented 1 year ago

Is this because of esupy update? I updated the posix path issue locations with str() and finally was stuck with an esupy error.

bl-young commented 1 year ago

All current release of StEWI (< = 1.0.6) need to use esupy <= 0.2.2.

If you updated esupy from develop, but not stewi than you are likely to run into an error.

If you use the current master of both (1.0.6, and 0.2.2) I don't believe you will get this error.

bl-young commented 1 year ago

Note the requirements of v 1.0.6:

https://github.com/USEPA/standardizedinventories/blob/70158b16c42eb78eb81751f0882663d3149f5a30/setup.py#L3

tjlca commented 1 year ago
install_requires=['esupy @ git+https://github.com/USEPA/esupy#egg=esupy',
                  'numpy>=1.20.1',
                  'pandas>=1.3',
                  'requests>=2.20',
                  'beautifulsoup4>=4.9.3',
                  'PyYAML>=5.1',
                  'openpyxl>=3.0.7',
                  'xlrd>=2.0.0',
                  ]

StEWI v1.0.5 setup file misses the parameter asking for esupy version 0.2.2 which results in all previous versions of StEWI not working any more. Could you kindly add the line

'esupy @ git+https://github.com/USEPA/esupy@v0.2.2#egg=esupy',

in the setup files of the previous versions?

The issue is resolved by this solution.

bl-young commented 1 year ago

We won't go back and amend prior releases. If you need to do a custom install with v1.0.5, I'd recommend cloning the repository at a certain point, updating setup.py yourself and doing a pip install .

However, I would just recommend using v1.0.6 instead as there are some bug fixes. I'm not sure v1.0.5 will work as is anyway given some minor changes in the underlying dataset that were fixed in v1.0.6.