@@ -64,7 +64,7 @@ def _to_shaped_array(
6464 warn (f"Failed to resolve dimension names: { ', ' .join (unresolved )} " )
6565 return value
6666 elif value .shape == ():
67- return np .ones (shape ) ** value .item ()
67+ return np .full (shape , value .item () )
6868 elif value .shape != shape :
6969 raise ValueError (
7070 f"Shape mismatch, got { value .shape } , expected { shape } "
@@ -288,28 +288,40 @@ def __attrs_post_init__(self):
288288class Npf :
289289 # no options, just arrays for now
290290 icelltype : NDArray [np .integer ] = field (
291- metadata = {"block" : "griddata" , "shape" : "(nodes)" }
291+ converter = _to_array , metadata = {"block" : "griddata" , "shape" : "(nodes)" }
292292 )
293293 k : NDArray [np .floating ] = field (
294- metadata = {"block" : "griddata" , "shape" : "(nodes)" }
294+ converter = _to_array , metadata = {"block" : "griddata" , "shape" : "(nodes)" }
295295 )
296296 k22 : Optional [NDArray [np .floating ]] = field (
297- default = None , metadata = {"block" : "griddata" , "shape" : "(nodes)" }
297+ converter = _to_array ,
298+ default = None ,
299+ metadata = {"block" : "griddata" , "shape" : "(nodes)" },
298300 )
299301 k33 : Optional [NDArray [np .floating ]] = field (
300- default = None , metadata = {"block" : "griddata" , "shape" : "(nodes)" }
302+ converter = _to_array ,
303+ default = None ,
304+ metadata = {"block" : "griddata" , "shape" : "(nodes)" },
301305 )
302306 angle1 : Optional [NDArray [np .floating ]] = field (
303- default = None , metadata = {"block" : "griddata" , "shape" : "(nodes)" }
307+ converter = _to_array ,
308+ default = None ,
309+ metadata = {"block" : "griddata" , "shape" : "(nodes)" },
304310 )
305311 angle2 : Optional [NDArray [np .floating ]] = field (
306- default = None , metadata = {"block" : "griddata" , "shape" : "(nodes)" }
312+ converter = _to_array ,
313+ default = None ,
314+ metadata = {"block" : "griddata" , "shape" : "(nodes)" },
307315 )
308316 angle3 : Optional [NDArray [np .floating ]] = field (
309- default = None , metadata = {"block" : "griddata" , "shape" : "(nodes)" }
317+ converter = _to_array ,
318+ default = None ,
319+ metadata = {"block" : "griddata" , "shape" : "(nodes)" },
310320 )
311321 wetdry : Optional [NDArray [np .floating ]] = field (
312- default = None , metadata = {"block" : "griddata" , "shape" : "(nodes)" }
322+ converter = _to_array ,
323+ default = None ,
324+ metadata = {"block" : "griddata" , "shape" : "(nodes)" },
313325 )
314326 model : Optional [Model ] = field (default = None )
315327
@@ -376,7 +388,7 @@ def __attrs_post_init__(self):
376388tdis = Tdis (sim = sim , nper = 1 , perioddata = [Tdis .PeriodData ()])
377389gwf = Gwf (sim = sim )
378390dis = Dis (model = gwf )
379- ic = Ic (model = gwf , strt = 1 )
391+ ic = Ic (model = gwf , strt = 1.0 )
380392oc = Oc (model = gwf , perioddata = [Oc .Steps ()])
381393npf = Npf (model = gwf , icelltype = 0 , k = 1.0 )
382394
0 commit comments