Skip to content

Commit 6447ee8

Browse files
committed
Merge remote-tracking branch 'origin'
2 parents 5936d99 + 3e2c9c5 commit 6447ee8

92 files changed

Lines changed: 8859 additions & 183 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,9 @@ pest++/sweep/sweep
7777

7878
/dev_tests
7979
/benchmarks/g07
80+
81+
# Sphinx / Doxygen docs build artifacts
82+
docs/_build/
83+
docs/_doxygen/
84+
docs/_manual_assets/
85+
docs/users_manual_processed.md

.readthedocs.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-24.04
5+
tools:
6+
python: "3.12"
7+
apt_packages:
8+
- doxygen
9+
jobs:
10+
pre_build:
11+
# Generate Doxygen XML that Breathe will consume
12+
- doxygen Doxyfile
13+
# Preprocess users manual: convert HTML anchors to MyST targets
14+
- python docs/preprocess_manual.py documentation/pestpp_users_manual.md docs/users_manual_processed.md
15+
# Copy users manual media assets so Sphinx places them at _build/html/media/
16+
- mkdir -p docs/_manual_assets/media
17+
- cp -r documentation/media/. docs/_manual_assets/media/
18+
19+
sphinx:
20+
configuration: docs/conf.py
21+
fail_on_warning: false
22+
23+
python:
24+
install:
25+
- requirements: docs/requirements.txt

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This is the top-level CMake file for PEST++
22
cmake_minimum_required(VERSION 3.15)
3-
3+
set(CMAKE_VERBOSE_MAKEFILE,ON)
44
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
55
add_compile_definitions(_DEBUG)
66
endif()

Doxyfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Doxyfile for PEST++
2+
# Doxygen generates XML consumed by Breathe/Sphinx for ReadTheDocs.
3+
4+
PROJECT_NAME = "PEST++"
5+
PROJECT_NUMBER = 5
6+
PROJECT_BRIEF = "Parameter ESTimation tool ++ - uncertainty analysis and data assimilation"
7+
8+
OUTPUT_DIRECTORY = docs/_doxygen
9+
10+
# Input source directories (project code only, not third-party Eigen)
11+
INPUT = src/libs/common \
12+
src/libs/pestpp_common \
13+
src/libs/run_managers \
14+
src/programs/gsa \
15+
src/programs/pest++ \
16+
src/programs/pestpp-da \
17+
src/programs/pestpp-ies \
18+
src/programs/pestpp-mou \
19+
src/programs/pestpp-opt \
20+
src/programs/pestpp-sqp \
21+
src/programs/sweep
22+
23+
RECURSIVE = YES
24+
FILE_PATTERNS = *.cpp *.h
25+
26+
# Exclude third-party libraries
27+
EXCLUDE = src/libs/Eigen \
28+
src/libs/mio \
29+
src/libs/propack
30+
31+
EXCLUDE_PATTERNS = */Eigen/* */mio/* */propack/*
32+
33+
# Extract everything — even undocumented items
34+
EXTRACT_ALL = YES
35+
EXTRACT_PRIVATE = NO
36+
EXTRACT_STATIC = YES
37+
38+
# Doxygen output: XML only (consumed by Breathe)
39+
GENERATE_HTML = NO
40+
GENERATE_LATEX = NO
41+
GENERATE_XML = YES
42+
XML_OUTPUT = xml
43+
XML_PROGRAMLISTING = NO
44+
45+
# Enable Doxygen to follow #include chains
46+
ENABLE_PREPROCESSING = YES
47+
MACRO_EXPANSION = YES
48+
EXPAND_ONLY_PREDEF = NO
49+
50+
# Source browsing
51+
SOURCE_BROWSER = NO
52+
INLINE_SOURCES = NO
53+
54+
# Warnings
55+
WARN_IF_UNDOCUMENTED = NO
56+
QUIET = YES

benchmarks/basic_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,7 @@ def fr_timeout_test():
14031403
pst.pestpp_options["ies_num_reals"] = 10
14041404
pst.pestpp_options["ies_include_base"] = False
14051405
pst.pestpp_options["max_run_fail"] = 1
1406+
pst.pestpp_options["panther_ping_interval_secs"] = 2
14061407

14071408
#pst.pestpp_options["panther_transfer_on_fail"] = "10par_xsec.list"
14081409
pst.pestpp_options["panther_agent_freeze_on_fail"] = False

benchmarks/glm_test_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,13 +801,13 @@ def tenpar_fosm_external_stdev_test():
801801

802802
if __name__ == "__main__":
803803
#freyberg_stress_test()
804-
tenpar_xsec_stress_test()
804+
#tenpar_xsec_stress_test()
805805
#tenpar_base_test()
806806
#tenpar_fosm_external_stdev_test()
807807
#tenpar_superpar_restart_test()
808808
#freyberg_basic_restart_test()
809809
# jac_diff_invest()
810-
#new_fmt_load_test()
810+
new_fmt_load_test()
811811
#tenpar_hotstart_test()
812812
#tenpar_normalform_test()
813813
#freyberg_stress_test()

benchmarks/ies_test_part4.py

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2025,6 +2025,7 @@ def tenpar_adjust_weights_test():
20252025
obs.loc[:,"standard_deviation"] = 0.1
20262026
obs.loc[pst.obs_names[12:],"standard_deviation"] = 1e-11
20272027
obs.loc[pst.obs_names[12:],"obsval"] = 1e-9
2028+
#these values are hard coded later...
20282029
with open(os.path.join(template_d,"phi.csv"),'w') as f:
20292030
f.write("og1,0.333333\n")
20302031
f.write("og3,0.333333\n")
@@ -2044,6 +2045,29 @@ def tenpar_adjust_weights_test():
20442045
pst.pestpp_options['ies_verbose_level'] = 4
20452046
pst.pestpp_options["ies_bad_phi_sigma"] = -1.5
20462047

2048+
pst.control_data.noptmax = 0
2049+
pst.pestpp_options["ies_drop_conflicts"] = False
2050+
pst.pestpp_options["ies_phi_factor_file"] = "phi.csv"
2051+
pst_name = "pest_adj.pst"
2052+
pst.write(os.path.join(template_d,pst_name),version=2)
2053+
if os.path.exists(test_d):
2054+
shutil.rmtree(test_d)
2055+
shutil.copytree(template_d, test_d)
2056+
pyemu.os_utils.run("{0} {1}".format(exe_path, pst_name), cwd=test_d)
2057+
pst.set_res(os.path.join(test_d,pst_name.replace(".pst",".base.rei")))
2058+
print(pst.phi_components)
2059+
obs = pst.observation_data
2060+
aobs = pd.read_csv(os.path.join(test_d,pst_name.replace(".pst",".0.adjusted.obs_data.csv")),index_col=0)
2061+
obs.loc[aobs.index,"weight"] = aobs.weight.values
2062+
print(pst.phi_components)
2063+
print(pst.phi_components_normalized)
2064+
pcn = pst.phi_components_normalized
2065+
assert np.isclose(pcn["og3blahblah"],0.33333,1e-3)
2066+
assert np.isclose(pcn["og4yadayada"],0.33333,1e-3)
2067+
2068+
2069+
pst.pestpp_options.pop("ies_phi_factor_file")
2070+
20472071

20482072
pst.control_data.noptmax = 2
20492073
pst.pestpp_options["ies_drop_conflicts"] = False
@@ -5007,10 +5031,48 @@ def large_invest():
50075031
pyemu.os_utils.run("{0} pest.pst /e".format(exe_path),cwd=t_d)
50085032

50095033

5034+
def tenpar_xsec_combined_autoadaloc_mm_stress_test():
5035+
"""testing combined matrix + autoadaloc"""
5036+
model_d = "ies_10par_xsec"
5037+
test_d = os.path.join(model_d, "master_comb_aal_test1")
5038+
template_d = os.path.join(model_d, "test_template")
5039+
5040+
if not os.path.exists(template_d):
5041+
raise Exception("template_d {0} not found".format(template_d))
5042+
pst_name = os.path.join(template_d, "pest.pst")
5043+
pst = pyemu.Pst(pst_name)
5044+
5045+
if os.path.exists(test_d):
5046+
shutil.rmtree(test_d)
5047+
shutil.copytree(template_d, test_d)
5048+
pst.pestpp_options = {}
5049+
pst.pestpp_options["ies_num_reals"] = 30
5050+
5051+
mat = pyemu.Matrix.from_names(pst.nnz_obs_names, pst.adj_par_names).to_dataframe()
5052+
mat.loc[:, :] = 1
5053+
mat.loc[:, pst.adj_par_names[::2]] = 0
5054+
pyemu.Matrix.from_dataframe(mat).to_ascii(os.path.join(template_d, "loc.mat"))
50105055

5056+
pst.pestpp_options["ies_localizer"] = "loc.mat"
5057+
pst.pestpp_options["ies_autoadaloc"] = True
5058+
pst.pestpp_options["ies_verbose_level"] = 3
5059+
pst.pestpp_options["ies_debug_fail_remainder"] = True
5060+
pst.pestpp_options["ies_debug_fail_subset"] = True
5061+
pst.pestpp_options["ies_debug_bad_phi"] = True
5062+
pst.pestpp_options["ies_multimodal_alpha"] = 0.99
5063+
5064+
pst.control_data.noptmax = 3
50115065

5066+
pst.write(os.path.join(template_d, "pest_aal_restart.pst"))
5067+
pyemu.os_utils.start_workers(template_d, exe_path, "pest_aal_restart.pst", num_workers=10,
5068+
master_dir=test_d, verbose=True, worker_root=model_d,
5069+
port=port)
5070+
50125071

50135072
if __name__ == "__main__":
5073+
tenpar_xsec_combined_autoadaloc_mm_stress_test()
5074+
5075+
#tenpar_adjust_weights_test()
50145076
#large_invest()
50155077
#tenpar_fixed_transform_test()
50165078
#tenpar_reg_factor_test()
@@ -5031,7 +5093,7 @@ def large_invest():
50315093
#tenpar_reg_factor_test()
50325094
#tenpar_high_phi_test()
50335095
#tenpar_iqr_bad_phi_sigma_test()
5034-
multimodal_test()
5096+
#multimodal_test()
50355097
#plot_mm1_sweep_results()
50365098
#plot_mm1_results()
50375099
#plot_mm1_results_seq()

benchmarks/mou_tests_2.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2703,19 +2703,8 @@ def pi_output_test():
27032703
assert len([f for f in os.listdir(m1) if "pi_pop" in f]) > 0
27042704

27052705

2706-
def mou_bound_handling_test():
2707-
test_d = "freyberg_mou"
2708-
org_t_d = os.path.join(test_d,"template")
2709-
new_t_d = org_t_d.replace("template","boundtest")
2710-
if os.path.exists(new_t_d):
2711-
shutil.rmtree(new_t_d)
2712-
shutil.copytree(org_t_d,new_t_d)
2713-
2714-
pyemu.os_utils.run("{0} test1.pst".format(exe_path),cwd=new_t_d)
2715-
27162706

27172707
if __name__ == "__main__":
2718-
#mou_bound_handling_test()
27192708
basic_pso_test()
27202709
#test_restart_all()
27212710
#chance_consistency_test()

docs/api/common.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Common Library
2+
==============
3+
4+
Core utilities, networking, and error handling shared across all PEST++ tools.
5+
6+
Utilities
7+
---------
8+
9+
.. doxygenfile:: utilities.cpp
10+
:project: pestpp
11+
12+
.. doxygenfile:: utilities.h
13+
:project: pestpp
14+
15+
Transformable
16+
-------------
17+
18+
.. doxygenfile:: Transformable.cpp
19+
:project: pestpp
20+
21+
.. doxygenfile:: Transformable.h
22+
:project: pestpp
23+
24+
Network Package
25+
---------------
26+
27+
.. doxygenfile:: network_package.cpp
28+
:project: pestpp
29+
30+
.. doxygenfile:: network_package.h
31+
:project: pestpp
32+
33+
Network Wrapper
34+
---------------
35+
36+
.. doxygenfile:: network_wrapper.cpp
37+
:project: pestpp
38+
39+
.. doxygenfile:: network_wrapper.h
40+
:project: pestpp
41+
42+
Error Handling
43+
--------------
44+
45+
.. doxygenfile:: pest_error.cpp
46+
:project: pestpp
47+
48+
.. doxygenfile:: pest_error.h
49+
:project: pestpp
50+
51+
System Variables
52+
----------------
53+
54+
.. doxygenfile:: system_variables.cpp
55+
:project: pestpp
56+
57+
.. doxygenfile:: system_variables.h
58+
:project: pestpp
59+
60+
Fortran Wrappers
61+
----------------
62+
63+
.. doxygenfile:: fortran_wrappers.cpp
64+
:project: pestpp

docs/api/index.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
C++ API Reference
2+
=================
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
:caption: Libraries
7+
8+
common
9+
pestpp_common
10+
run_managers
11+
12+
.. toctree::
13+
:maxdepth: 1
14+
:caption: Programs
15+
16+
programs

0 commit comments

Comments
 (0)