VirtualWatershed / prms-vegetation-scenarios

Online tool for PRMS modeling of multiple vegetation scenarios
BSD 3-Clause "New" or "Revised" License
0 stars 4 forks source link

A veg-modifier-model-run-prototype is created #43

Open ruiwu1990 opened 8 years ago

ruiwu1990 commented 8 years ago
  1. http://192.168.99.100:5010/scenario_table is the main page
  2. The basic workflow is that users go to /scenario_table to create a scenario or view an existing scenario. If users choose to create one, then the system will go to http://192.168.99.100:5010/create_new_scenario, a list of model runs will be shown in a table. Users use a 2D map tool to modify veg variables; Give scenario a name; Run scenario; system redirect users to the main page and the new created scenario will be shown in the table.
  3. Users need to have at least a model run in Moinul’s server. This is because the workflow. This will cause a problem (have no model run to create a scenario), if you are a new users and do not have any model runs in Moinul server, you may go to http://192.168.99.100:5010 to create a model run.
  4. I have done a small test that different scenarios are different: change all the HRU into bare ground vs shrub, the hydrographs are different
  5. You may have a problem with authorization if you use Chrome instead of FireFox. I do not know why some times Chrome complains the API key (JWT authorize) expired but FireFox never does that.

TODO:

  1. In http://192.168.99.100:5010/create_new_scenario, only display finished model run
  2. Add authorization in the system.
mt-digital commented 8 years ago

This isn't ready for a merge yet, there are quite a few problems. In general I need you to be more careful submitting pull requests: don't include errant data and please follow style standards. Also make sure to merge the current master branch before opening pull requests.

Also, it appears you are developing with a Dockerized version of the system. Please include instructions both on how to run Docker and how to work with the code running in the Docker container.

Regarding 3)

Users need to have at least a model run in Moinul’s server. This is because the workflow. This will cause a problem (have no model run to create a scenario), if you are a new users and do not have any model runs in Moinul server, you may go to http://192.168.99.100:5010 to create a model run.

This won't work. There has to be a default, pre-initialized set of inputs to use. We have to enable new users to get going even if they don't have data ready.

ruiwu1990 commented 8 years ago

I tried to merge the latest master branch, but I found you have deleted 'PRMSCoverageTool.py'. I have modified this file and use some functions in this file. Can you let me use this file for current version? 3. is fixed. Users do not need to have inital model run.

mt-digital commented 8 years ago

The scenario tool doesn't seem to be working for me. I followed your instructions and tried to create a new scenario.

When I navigate to /create_new_scenario I see the screen below:

screenshot 2016-05-04 10 34 55

However in the console there is an error. Here's the traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask_cors/extension.py", line 188, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask_cors/extension.py", line 188, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/var/www/prms-veg/app/api/views.py", line 116, in scenarios
    BASE_PARAMETER_NC = input_file_folder + app.config['TEMP_PARAM']
KeyError: 'TEMP_PARAM'

When I click the "Choose Me" nothing happens and there is another error in the console. Here is the request and traceback:

192.168.99.1 - - [04/May/2016 17:41:09] "GET /api/scenarios/download_input_files/http:++++++192.168.99.100:5000+++api+++modelresources+++download+++lc.control---http:++++++192.168.99.100:5000+++api+++modelresources+++download+++lc-data.nc---http:++++++192.168.99.100:5000+++api+++modelresources+++download+++grassy-knoll-tester.nc HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask_cors/extension.py", line 188, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask_cors/extension.py", line 188, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/var/www/prms-veg/app/api/views.py", line 99, in download_model_inputs
    download_prms_inputs(control_url, data_url, param_url)
  File "/var/www/prms-veg/app/api/util.py", line 151, in download_prms_inputs
    os.mkdir(app_root)
OSError: [Errno 2] No such file or directory: '/var/www/prms-veg/app/api/../static/user_data/maturner01@gmail'