JJguri / bestiapop

Python package to automatically generate gridded climate data to be used as input for crop models
Other
13 stars 6 forks source link

pip install bestiapop install old version #44

Open SasankhM opened 1 year ago

SasankhM commented 1 year ago

It seems that pip install bestiapop seems to install the old version (uses the old NASAPOWER API). The pip distribution needs to be updated?

JJguri commented 1 year ago

I am using the code you stated to install and it is working well. Try to update the pip version and see what happens.

SasankhM commented 1 year ago

I have the latest pip version (pip 22.2.2) and bestiapop (3.0.10), but when I look into the source files, the nasapower_connector.py is still deprecated i.e. nasapower_api_url = "https://power.larc.nasa.gov/cgi-bin/v1/DataAccess.py"

JJguri commented 1 year ago

did you try to use conda to install it?

SasankhM commented 1 year ago

It says bestiapop is not available from conda's current channels!

JJguri commented 1 year ago

is the problem the bestiapop installation or the use of bestiapop to get a weather file?

If the issue is the installation, following these steps, you should be able to install and activate bestiapop:

  1. Clone this repo
  2. Install required packages.
  3. Create Custom Environment with Anaconda
    conda env create --name bestiapop --file environment.yml
    conda activate bestiapop

I also tested it for NASAPOWER just now and it produce the required output with no flags or errors.

If the issue is when you run the package, please send me a screen shoot with the error description after running including the command you are running. Thanks

Fernigithub commented 6 months ago

I found an issue when handling nasapower requests, it's due to the difference between the code published in GitHub and PyPI,

this code crashed the script in the Pypi version. bestiapop/connectors/nasapower_connector.py self.climate_metadata_coordinates = json_data['features'][0]['geometry']['coordinates'] self.climate_data = json_data['features'][0]['properties']['parameter']

this is the same line in the GitHub code. bestiapop/connectors/nasapower_connector.py self.climate_metadata_coordinates = json_data['geometry']['coordinates'] self.climate_data = json_data['properties']['parameter']

Looks like the last changes in the GitHub code have not been mirrored in the PyPI release.