I know, I know, modelgrid and whatnot, but a lot of us still rely on SpatialReference. This code shows the problem:
import flopy
m = flopy.modflow.Modflow("test",xll=12345,yll=12345)
flopy.modflow.ModflowDis(m,10,10,10)
m.sr.xll = 12345
m.sr.yll = 12345
print(m.sr)
print(m.modelgrid)
m.write_input()
mm = flopy.modflow.Modflow.load("test.nam")
print(mm.sr)
print(mm.modelgrid)
The loaded model (mm) does not have the right sr information.
So Im sure someone will tell me to get with the times, which I have tried. I tried to use modelgrid, but unlike sr, which caches the xcentergrid and ycentergrid arrays after first call, modelgrid.xcellcenters is dynamically refilling the arrays with every call! I guess I get the arrays I need once and then process with them, but I like the encapsulation of caching them for users - this breaks the idea of "just find and replace sr with modelgrid". Anyway, can someone please fix sr?
I know, I know,
modelgridand whatnot, but a lot of us still rely onSpatialReference. This code shows the problem:The loaded model (
mm) does not have the rightsrinformation.So Im sure someone will tell me to get with the times, which I have tried. I tried to use
modelgrid, but unlikesr, which caches thexcentergridandycentergridarrays after first call,modelgrid.xcellcentersis dynamically refilling the arrays with every call! I guess I get the arrays I need once and then process with them, but I like the encapsulation of caching them for users - this breaks the idea of "just find and replacesrwithmodelgrid". Anyway, can someone please fixsr?