Menu Close

Reply To: Python Libraries?

Taylor MutchTaylor Mutch

Hi Colin,

That is excellent news! By nature of my question I am personally leaning Python (though R is also known to me), and I have begun to do the command-line calls using Python 3.5 and the subprocess module.

One thing that we are really finding useful is the ability to set the initial conditions based on user input from our web interface. For example, we are allowing the user to adjust the percent cover of a given state class for a vegetation type, and we are planning to let the user have a scaler/slider that adjusts existing probabilistic transitions (e.x. fire, grazing) and run the model based on these new values to gather differences between different model runs. Currently this involves writing out to a .csv and then importing that as a sheet (e.x. importing into --import --sheet=STSim_InitialConditionsNonSpatialDistribution --file=path/to/myfile.csv --sid=123). While this isn’t an awful way to go at it by no means, it would be nice to have some sort of interface to say 1) grab each row, 2) list those values, and 3) update each value in that row at runtime. This could be treated as a python object that gets updated by the program and then applied back to the library, does some sanity checking to make sure that the vegetation and stateclass values are valid from the project definitions, and then executes the transaction change.

Extracting out the transitional and deterministic pathways as a connected graph data structure would also be useful, since the visualization we are developing is attempting to illustrate the change from one state class to another within the vegetation type, since we can use the quantity transitioned specified in the transition-stateclass-summary report to symbolize the change from one to another along a given transition pathway (e.x. showing fire when a portion of the landscape transitions due to fire).

These are just two things that come to mind directly.

Thoughts on either of these?