Closed XINGXING-ZHANG closed 6 months ago
@XINGXING-ZHANG let me look into this over the weekend as this issue (#44) should have been fixed long time ago.
For now, I can suggest the following workaround:
Please git clone, e.g.
git clone git@github.com:tomjanus/reemission.git
or
git clone https://github.com/tomjanus/reemission.git
depending on your git/github setup
and in the main directory where setup.py and setup.cfg are located,
please run: pip install -e .
This should install reemission in the editable mode, i.e. Python interpreter will read files directly from the repository.
I shall fix the remaining problems in the next couple of days.
Thanku for reply. But when I use reemission --help. It keeps prompting for missing and error-prone components, including various libraries being absent, and issues arising from code version discrepancies due to Python versions. One fix leads to another, and so on.
and so on
continue
After fix one by one. It works now. Thank for u nice work tomjanus
TypeError: The following constraints cannot be applied to typing.List[float]: 'ge'
"""
area_fractions: List[float] = Field(
ge=0, description="Inundated area fractions of landuse types, -",
default_factory=list)
"""
area_fractions: conlist(
confloat(ge=0), description="Inundated area fractions of landuse types, -", default_factory=list
) = Field(
description="Inundated area fractions of landuse types, -",
default_factory=list)
"""
area_fractions: List[float] = Field(
ge=0, description="Area fractions of landuse types, -",
default_factory=list)
"""
area_fractions: conlist(
confloat(ge=0), description="Area fractions of landuse types, -", default_factory=list
) = Field(
..., description="Area fractions of landuse types, -",
default_factory=list)
Still have some problem, when run-demo. @tomjanus $ reemission run-demo C:\Users\User\anaconda3\Lib\site-packages\pydantic_internal_config.py:334: UserWarning: Valid config keys have changed in V2:
| | | | | _ () _(_) | |) | | __| | | ' ` | / / | |/ | ' \ | <| ||| || | | | | | _ _ \ | () | | | | || \___| |__|| || |||//|_/|| ||
RUNNING CALCULATIONS FOR A SUBSET OF EXISTING AND FUTURE HYDROELECTRIC RESERVOIRS IN MYANMAR...
Fetching the demo dabase of dams from external sources... The DAMS database folder C:\Users\User\reemission\examples\demo\reemission_demo_dam_db exists and has the correct size. Fetching the dam database from external sources not required.
Fetching reservoir and catchment delineations from external sources... The DAMS database folder C:\Users\User\reemission\examples\demo\reemission_demo_delineations exists an d has the correct size. Fetching the dam database from external sources not required.
Creating the outputs folder C:\Users\User\reemission\examples\demo\heet_outputs ... Folder already exists: C:\Users\User\reemission\examples\demo\heet_outputs
Merging tabular data into a single CSV file and saving to C:\Users\User\reemission\examples\demo\he et_outputs\heet_outputs.csv ... C:\Users\User\anaconda3\Lib\site-packages\pydantic_internal_config.py:334: UserWarning: Valid config keys have changed in V2:
Merging shape files for individual reservoirs into combined shape files... C:\Users\User\anaconda3\Lib\site-packages\pydantic_internal_config.py:334: UserWarning: Valid config keys have changed in V2:
Converting HEET tabular data to the RE-Emission input JSON file C:\Users\User\anaconda3\Lib\site-packages\pydantic_internal_config.py:334: UserWarning: Valid config keys have changed in V2:
Creating the outputs folder C:\Users\User\reemission\examples\demo\reemission_outputs ... Folder already exists: C:\Users\User\reemission\examples\demo\reemission_outputs
Calculating GHG emissions with RE-EMISSION C:\Users\User\anaconda3\Lib\site-packages\pydantic_internal_config.py:334: UserWarning: Valid config keys have changed in V2:
| | | | | _ () _(_) | |) | | __| | | ' ` | / / | |/ | ' \ | <| ||| || | | | | | _ _ \ | () | | | | || \___| |__|| || |||//|_/|| ||
Usage: reemission calculate [OPTIONS] INPUT_FILE
Try 'reemission calculate --help' for help ╭─ Error ────────────────────────────────────────────────────────────────────────────────────────────╮ │ Invalid value for 'INPUT_FILE': Path │ │ 'C:\Users\User\reemission\examples\demo\heet_outputs\reemission_inputs.json' does not │ │ exist. │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯
Merging input and output data into shape files
Traceback (most recent call last):
File "
@tomjanus in step 4, the error happened
@XINGXING-ZHANG I suspect you've fixed the installation issues with missing rich-click package and with lack os support for pydantic v2. The dependency needs to be down,graded to v1. I shall update the repository shortly, including setuptools, the demo and the jupyter notebooks which are outdated due to some recent developments - mainly new input variables and input data templating with pydantic. Thank you for your patience.
Respect for your sharing! Pypi does not have reemission. What‘s version of python you have used when Install from loca source? I have try all Install methods. Cannot install still.