@@ -6191,6 +6191,38 @@ def arrayskip_test(tmp_path):
6191
6191
pass
6192
6192
6193
6193
6194
+ def test_sr_dict (tmp_path ):
6195
+ xs = np .arange (1000 , 2000 , 10 )
6196
+ ys = np .arange (2000 , 3000 , 10 )
6197
+ sr_dict = {(i , j ): (x ,y ) for i , y in enumerate (ys ) for j , x in enumerate (xs )}
6198
+ gs = pyemu .geostats .GeoStruct (variograms = pyemu .geostats .ExpVario (contribution = 1 , a = 250 ))
6199
+
6200
+ parfile = pd .DataFrame (sr_dict .keys (), columns = ['i' , 'j' ])
6201
+ parfile ['q' ] = range (len (parfile .index ))
6202
+
6203
+ md = Path (tmp_path , 'eg' )
6204
+ md .mkdir (parents = True , exist_ok = True )
6205
+ parfile .to_csv (Path (md , "parfile.csv" ), index = False , header = False )
6206
+ parfile .to_csv (Path (md , "obsfile.csv" ), index = False , header = True )
6207
+ pf = PstFrom (original_d = md , new_d = Path (tmp_path , 'template' ),
6208
+ remove_existing = True ,
6209
+ longnames = True , spatial_reference = sr_dict ,
6210
+ zero_based = True )
6211
+ pf .add_parameters ("parfile.csv" ,
6212
+ par_type = "grid" ,
6213
+ index_cols = [0 , 1 ],
6214
+ use_cols = [2 ],
6215
+ geostruct = gs )
6216
+ pf .add_observations ("obsfile.csv" ,
6217
+ insfile = "obsfile.csv.ins" ,
6218
+ prefix = "obs_file" ,
6219
+ index_cols = ['i' ,'j' ],
6220
+ use_cols = 'q' ,
6221
+ ofile_sep = ',' )
6222
+ pass
6223
+
6224
+
6225
+
6194
6226
6195
6227
if __name__ == "__main__" :
6196
6228
#add_py_function_test('.')
@@ -6235,9 +6267,9 @@ def arrayskip_test(tmp_path):
6235
6267
# # pstfrom_profile()
6236
6268
# mf6_freyberg_arr_obs_and_headerless_test()
6237
6269
#usg_freyberg_test(".")
6238
- #vertex_grid_test()
6270
+ # vertex_grid_test('.' )
6239
6271
#direct_quickfull_test()
6240
- #list_float_int_index_test()
6272
+ # list_float_int_index_test('.' )
6241
6273
#freyberg_test()
6242
6274
6243
6275
0 commit comments