Py_DSSATTools icon indicating copy to clipboard operation
Py_DSSATTools copied to clipboard

VARIABLE ERROR

Open mhwahla opened this issue 1 year ago • 4 comments

Hello @daquinterop I hope you are doing great, we have got this error while creating weather instance, can you give us hint on this ? thanks

TypeError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_7804\2970603011.py in 7 'Cumulative precipitation(mm)': 'RAIN', 8 'Cumulative solar radiation(MJ/m2)': 'SRAD', ----> 9 'Average relative humidity(%)': 'RHUM' 10 } 11 )

TypeError: init() got an unexpected keyword argument 'variables' image

apologies if its very basic , we are super new to this.

Create a WeatherData instance

WTH_DATA = Weather( dt, variables={ 'Absolute maximum temperature (°C)': 'TMAX', 'Absolute minimum temperature (°C)': 'TMIN', 'Cumulative precipitation(mm)': 'RAIN', 'Cumulative solar radiation(MJ/m2)': 'SRAD', 'Average relative humidity(%)': 'RHUM' } )

Write a weather data file

dt.to_csv('weather.csv')

# Create a WeatherStation instance

wth = WeatherStation( WTH_DATA, { 'ELEV': float(X_data['ELEV'].values[0]), 'LAT': float(X_data['LAT'].values[0]), 'LON': float(X_data['LON'].values[0]), 'INSI': X_data['INSI'].values[0] } )

thanks

mhwahla avatar Oct 11 '23 12:10 mhwahla

Hi. Quick question, what version of the library are you using?

daquinterop avatar Oct 11 '23 13:10 daquinterop

Heyy its 2.1.1

image

mhwahla avatar Oct 11 '23 13:10 mhwahla

hello @daquinterop I hope you had great day. changed the version of error persists even with this older version. image

mhwahla avatar Oct 12 '23 07:10 mhwahla

Change the variables argument for vars. Or simply pass the arguments as non-positional arguments, I think that's how I do it in the example notebooks.

On Thu, Oct 12, 2023, 2:56 AM mhwahla @.***> wrote:

hello @daquinterop https://github.com/daquinterop I hope you had great day. changed the version of error persists even with this older version. [image: image] https://user-images.githubusercontent.com/51794945/274524604-80067e5f-561b-4820-abad-518e761c4478.png

— Reply to this email directly, view it on GitHub https://github.com/daquinterop/Py_DSSATTools/issues/20#issuecomment-1759117800, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXEPKSZMQKZNJ7HTFRHG43X66PDBANCNFSM6AAAAAA535WM3U . You are receiving this because you were mentioned.Message ID: @.***>

daquinterop avatar Oct 12 '23 11:10 daquinterop