UW-Hydro / VIC

The Variable Infiltration Capacity (VIC) Macroscale Hydrologic Model
http://vic.readthedocs.io
MIT License
260 stars 383 forks source link

how does the python driver works? #902

Open iacopoff opened 4 years ago

iacopoff commented 4 years ago

So far I have been using VIC 5 image driver, I would like to try the VIC python driver but, apart from installing it, I can't find any documentation about how it works.

A short example would be great, for example how should I run it?

thanks

sandgrules commented 4 years ago

@iacopoff - were you able to get as far as what is shown in the documentation (https://vic.readthedocs.io/en/master/Documentation/Drivers/Python/PythonDriver/)? I get an error when doing the import statement: ModuleNotFoundError Traceback (most recent call last)

in ----> 1 from vic import lib as vic_lib ~/Tools/VIC/vic/drivers/python/vic/__init__.py in ----> 1 from .vic import * 2 VIC_DRIVER = b'Python' ~/Tools/VIC/vic/drivers/python/vic/vic.py in 25 """ 26 ---> 27 from ._vic import ffi 28 29 ModuleNotFoundError: No module named 'vic._vic' Were you able to get this to work?
sandgrules commented 4 years ago

NVM, after some trial and error I realized that i needed to run in from ../vic/drivers/python/build/lib.linux-x86_64-3.7. However, I agree a little longer example would be nice!

jhamman commented 4 years ago

@sandgrules - Glad you were able to get this to work. Something seems odd with your found solution so I think we'd be happy to take any contributions to improve the workflow and/or documentation here.

For you and @iacopoff - the Python driver, as implemented today, is just bindings to the internal components of the VIC model. We use this for testing but it would be possible to implement a full driver. We'd love to see someone contribute a full example for how this can be done but its not something we have to share right now.