In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
In [2]:
PORT=9876
import veneer
v = veneer.Veneer(PORT)
In [3]:
v.source_version()
Out[3]:
In [4]:
network = v.network()
network.plot(links={'color':'black'})
Out[4]:
In [5]:
v.model.node.water_users.names()
Out[5]:
In [6]:
v.model.node.water_users.demands()
Out[6]:
In [7]:
v.model.node.water_users.demands(nodes='IrrigationOnlyForestWU')
Out[7]:
In [11]:
v.model.node.water_users.add_timeseries?
In [12]:
v.model.node.water_users.add_irrigator?
In [9]:
v.model.node.water_users.add_timeseries('my new timeseries demand',nodes='IrrigationOnlyForestWU')
Out[9]:
In [10]:
v.model.node.water_users.demands(nodes='IrrigationOnlyForestWU')
Out[10]:
In [13]:
v.model.node.water_users.set_active_demand('my new timeseries demand')
# SAFE because 'my new timeseries demand' only exists on one node
Out[13]:
In [15]:
v.model.node.water_users.set_param_values('DemandModel.Order',5,nodes='IrrigationOnlyForestWU')
# Note, the above will not take effect if a function is already being used. Need to cancel the function...
# v.model.node.water_users.clear_function_usage('DemandModel.Order',nodes='IrrigationOnlyForestWU')
Out[15]:
Similarly, we can use assign_time_series...
In [16]:
# v.model.node.water_users.assign_time_series('DemandModel.Order','col','datasource',nodes='IrrigationOnlyForestWU')
In [ ]: