Closed Ntkrell closed 4 years ago
This looks like the same problem of overwriting variables in the average_soil_moisture function.
Also, the average soil moisture function is only supposed to return the average soil moisture for a specific day. That's why we pass it a DOY.
This is the problem. https://docs.python.org/2/library/copy.html
In the average_soil_moisture
function, we need to create a copy of the model.crop
object. We are still changing the model.crop.lgp
value because we are assigning by reference instead of making a copy of the object. It's a python thing.
Sweet! Thanks for the tips and for giving this time!! Will pick back up a little later.
@kcaylor Maybe you can see the issue more clearly just by looking at it than I can. Why is the output below only 27 days long? I think this has to do with the
average_soil_moisture()
calculation which is returning a length of 27....etc
Question: I think the problem is in the average_soil_moisture() function: shouldn't it return a year's worth of soil moisture? Currently line 177 in
functions.py
prevents us from doing so:output = [ models[i].run(do_output=True, planting_date=doy+1, t_before=t_before, t_after=0) for i in np.arange(n_sims) ]