Skip to content

Commit

Permalink
Merge pull request #292 from jtwhite79/hotfix_da
Browse files Browse the repository at this point in the history
Hotfix da
  • Loading branch information
jtwhite79 authored Apr 17, 2024
2 parents e07ea82 + 765bb6c commit e0553d7
Show file tree
Hide file tree
Showing 40 changed files with 980 additions and 330 deletions.
49 changes: 48 additions & 1 deletion benchmarks/basic_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ def sweep_forgive_test():
assert diff.max().max() == 0.0




def inv_regul_test():
model_d = "ies_10par_xsec"

Expand Down Expand Up @@ -1437,11 +1439,56 @@ def run():
pyemu.os_utils.start_workers(t_d, exe_path, pst_name, num_workers=15,
worker_root=model_d, port=4004)

def sweep_bin_test():

model_d = "ies_10par_xsec"
t_d = os.path.join(model_d,"template")
m_d = os.path.join(model_d,"master_sweep_bin")
if os.path.exists(m_d):
shutil.rmtree(m_d)
pst = pyemu.Pst(os.path.join(t_d,"pest.pst"))
pe = pyemu.ParameterEnsemble.from_uniform_draw(pst,num_reals=50)#.loc[:,pst.par_names[:2]]

pe.to_csv(os.path.join(t_d,"sweep_in.csv"))
pe._df.index = pe.index.map(str)
print(pe.index)
pe.to_dense(os.path.join(t_d,"sweep_in.bin"))
pst.pestpp_options["ies_par_en"] = "sweep_in.csv"
pst.pestpp_options["sweep_forgive"] = True
pst.pestpp_options["sweep_parameter_file"] = "sweep_in.bin"
pst.control_data.noptmax = -1
pst.pestpp_options.pop("ies_num_reals",None)
pst.write(os.path.join(t_d,"pest_forgive.pst"))
pst.pestpp_options["sweep_output_file"] = "sweep_out.bin"
pst.pestpp_options["sweep_chunk"] = 9
pst.pestpp_options["ies_include_base"] = False
pst.write(os.path.join(t_d,"pest_forgive.pst"))
m_d = os.path.join(model_d,"master_sweep_bin_base")
pyemu.os_utils.start_workers(t_d, exe_path, "pest_forgive.pst", 10, master_dir=m_d,
worker_root=model_d,port=port)
df1 = pd.read_csv(os.path.join(m_d, "pest_forgive.0.obs.csv"),index_col=0)
assert df1.shape[0] == pe.shape[0]
m_d = os.path.join(model_d, "master_sweep_bin")
pyemu.os_utils.start_workers(t_d, exe_path.replace("-ies", "-swp"), "pest_forgive.pst", 10, master_dir=m_d,
worker_root=model_d, port=port)
df2 = pyemu.Matrix.from_binary(os.path.join(m_d,"sweep_out.bin")).to_dataframe()
print(df2)
print(df1)
assert df2.shape == df1.shape
diff = (df1.values - df2.values)
print(diff)
print(diff.max())
print(np.abs(diff).max())
assert np.abs(diff).max() < 1e-7



if __name__ == "__main__":
#run()
#mf6_v5_ies_test()
#prep_ends()
mf6_v5_sen_test()
sweep_bin_test()
#mf6_v5_sen_test()
#shutil.copy2(os.path.join("..","exe","windows","x64","Debug","pestpp-glm.exe"),os.path.join("..","bin","win","pestpp-glm.exe"))
#shutil.copy2(os.path.join("..", "exe", "windows", "x64", "Debug", "pestpp-ies.exe"),
# os.path.join("..", "bin", "win", "pestpp-ies.exe"))
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/ies_10par_xsec/template/10par_xsec.hds
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
1.000 1.200 1.400 1.600 1.800 2.000 2.200 2.400 2.600 2.800
1.000 1.400 1.800 2.200 2.600 3.000 3.400 3.800 4.200 4.600
1 change: 0 additions & 1 deletion benchmarks/ies_10par_xsec/template/hk_Layer_1.ref
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
2.500000000000 2.500000000000 2.500000000000 2.500000000000 2.500000000000 2.500000000000 2.500000000000 2.500000000000 2.500000000000 2.500000000000
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
2.500000000000 2.500000000000 2.500000000000 2.500000000000 2.500000000000 2.500000000000 2.500000000000 2.500000000000 2.500000000000 2.500000000000
1 change: 0 additions & 1 deletion benchmarks/ies_10par_xsec/template/strt_Layer_1.ref
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
1.00000000000000 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
16 changes: 8 additions & 8 deletions benchmarks/mf6_freyberg/template/freyberg6_run_sen.pst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
pcf version=2
* control data keyword
pestmode estimation
noptmax 0
svdmode 1
maxsing 10000000
eigthresh 1e-06
eigwrite 1
ies_par_en prior.jcb
tie_by_group True
pestmode estimation
noptmax 0
svdmode 1
maxsing 10000000
eigthresh 1e-06
eigwrite 1
ies_par_en prior.jcb
tie_by_group true
* parameter groups external
freyberg6_run_sen.pargrp_data.csv
* parameter data external
Expand Down
Binary file not shown.
21 changes: 12 additions & 9 deletions documentation/pestpp_users_manual.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions scripts/build_pestpp_win_no_ifort.bat
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ copy /y *.zip ..\

cd ..
rem call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
rmdir /Q /S build
mkdir build
cd build
Expand Down
12 changes: 6 additions & 6 deletions src/libs/common/common.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,38 +36,38 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug2_dll|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug2_dll|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/libs/common/config_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define CONFIG_OS_H_


#define PESTPP_VERSION "5.2.9";
#define PESTPP_VERSION "5.2.10";

#if defined(_WIN32) || defined(_WIN64)
#define OS_WIN
Expand Down
Loading

0 comments on commit e0553d7

Please sign in to comment.