From fd777213f0f222364b97dc3f22dbaae86e8043c6 Mon Sep 17 00:00:00 2001 From: jingx <50790703+chooron@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:14:51 +0800 Subject: [PATCH] update doc --- docs/Manifest.toml | 67 +--------------------------------- docs/Project.toml | 1 - docs/make.jl | 3 +- docs/src/code/build_model.jl | 69 ------------------------------------ 4 files changed, 3 insertions(+), 137 deletions(-) delete mode 100644 docs/src/code/build_model.jl diff --git a/docs/Manifest.toml b/docs/Manifest.toml index 081b65b..cded172 100644 --- a/docs/Manifest.toml +++ b/docs/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.10.4" manifest_format = "2.0" -project_hash = "6e29b825734117b406b953711ef9188548ec6139" +project_hash = "dbdad56003708d8a14d1aec67a567ff483dac89a" [[deps.ADTypes]] git-tree-sha1 = "72af59f5b8f09faee36b4ec48e014a79210f2f4f" @@ -1015,12 +1015,6 @@ git-tree-sha1 = "53bb909d1151e57e2484c3d1b53e19552b887fb2" uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe" version = "1.0.2" -[[deps.HCubature]] -deps = ["Combinatorics", "DataStructures", "LinearAlgebra", "QuadGK", "StaticArrays"] -git-tree-sha1 = "19ef9f0cb324eed957b7fe7257ac84e8ed8a48ec" -uuid = "19dc6840-f33b-545b-b366-655c7e3ffd49" -version = "1.7.0" - [[deps.HTTP]] deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "PrecompileTools", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] git-tree-sha1 = "ae350b8225575cc3ea385d4131c81594f86dfe4f" @@ -1055,12 +1049,6 @@ git-tree-sha1 = "50aedf345a709ab75872f80a2779568dc0bb461b" uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" version = "2.11.2+1" -[[deps.HydroModels]] -deps = ["Accessors", "ComponentArrays", "DataInterpolations", "Graphs", "Integrals", "LinearAlgebra", "LinearSolve", "Lux", "LuxCore", "ModelingToolkit", "NNlib", "Random", "Reexport", "RuntimeGeneratedFunctions", "SparseArrays", "StableRNGs", "SymbolicUtils", "Symbolics", "TOML"] -git-tree-sha1 = "72a42f12341cd13b0a5eaa32197c91639a2b8cbf" -uuid = "7e3cde01-c141-467b-bff6-5350a0af19fc" -version = "0.1.1" - [[deps.HypergeometricFunctions]] deps = ["LinearAlgebra", "OpenLibm_jll", "SpecialFunctions"] git-tree-sha1 = "b1c2585431c382e3fe5805874bda6aea90a95de9" @@ -1107,31 +1095,6 @@ git-tree-sha1 = "b8ffb903da9f7b8cf695a8bead8e01814aa24b30" uuid = "18e54dd8-cb9d-406c-a71d-865a43cbb235" version = "0.1.2" -[[deps.Integrals]] -deps = ["CommonSolve", "HCubature", "LinearAlgebra", "MonteCarloIntegration", "QuadGK", "Random", "Reexport", "SciMLBase"] -git-tree-sha1 = "cfdc4fb8d21c8f596572a59912ae863774123622" -uuid = "de52edbc-65ea-441a-8357-d3a637375a31" -version = "4.5.0" - - [deps.Integrals.extensions] - IntegralsArblibExt = "Arblib" - IntegralsCubaExt = "Cuba" - IntegralsCubatureExt = "Cubature" - IntegralsFastGaussQuadratureExt = "FastGaussQuadrature" - IntegralsForwardDiffExt = "ForwardDiff" - IntegralsMCIntegrationExt = "MCIntegration" - IntegralsZygoteExt = ["Zygote", "ChainRulesCore"] - - [deps.Integrals.weakdeps] - Arblib = "fb37089c-8514-4489-9461-98f9c8763369" - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - Cuba = "8a292aeb-7a57-582c-b821-06e4c11590b1" - Cubature = "667455a9-e2ce-5579-9412-b964f529a492" - FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838" - ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" - MCIntegration = "ea1e2de9-7db7-4b42-91ee-0cd1bf6df167" - Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" - [[deps.IntelOpenMP_jll]] deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl"] git-tree-sha1 = "10bd689145d2c3b2a9844005d01087cc1194e79e" @@ -1320,12 +1283,6 @@ version = "0.16.5" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" SymEngine = "123dc426-2d89-5057-bbad-38513e3affd8" -[[deps.LatticeRules]] -deps = ["Random"] -git-tree-sha1 = "7f5b02258a3ca0221a6a9710b0a0a2e8fb4957fe" -uuid = "73f95e8e-ec14-4e6a-8b18-0d2e271c4e55" -version = "0.0.1" - [[deps.LayoutPointers]] deps = ["ArrayInterface", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface"] git-tree-sha1 = "a9eaadb366f5493a5654e843864c13d8b107548c" @@ -1760,12 +1717,6 @@ version = "9.54.0" HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327" LabelledArrays = "2ee39098-c373-598a-b85f-a56591580800" -[[deps.MonteCarloIntegration]] -deps = ["Distributions", "QuasiMonteCarlo", "Random"] -git-tree-sha1 = "722ad522068d31954b4a976b66a26aeccbf509ed" -uuid = "4886b29c-78c9-11e9-0a6e-41e1f4161f7b" -version = "0.2.0" - [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" version = "2023.1.10" @@ -2424,16 +2375,6 @@ weakdeps = ["Enzyme"] [deps.QuadGK.extensions] QuadGKEnzymeExt = "Enzyme" -[[deps.QuasiMonteCarlo]] -deps = ["Accessors", "ConcreteStructs", "LatticeRules", "LinearAlgebra", "Primes", "Random", "Requires", "Sobol", "StatsBase"] -git-tree-sha1 = "cc086f8485bce77b6187141e1413c3b55f9a4341" -uuid = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b" -version = "0.3.3" -weakdeps = ["Distributions"] - - [deps.QuasiMonteCarlo.extensions] - QuasiMonteCarloDistributionsExt = "Distributions" - [[deps.REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" @@ -2688,12 +2629,6 @@ git-tree-sha1 = "58e6353e72cde29b90a69527e56df1b5c3d8c437" uuid = "ce78b400-467f-4804-87d8-8f486da07d0a" version = "1.1.0" -[[deps.Sobol]] -deps = ["DelimitedFiles", "Random"] -git-tree-sha1 = "5a74ac22a9daef23705f010f72c81d6925b19df8" -uuid = "ed01d8cd-4d21-5b2a-85b4-cc3bdc58bad4" -version = "1.5.0" - [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" diff --git a/docs/Project.toml b/docs/Project.toml index 2e18a9c..25b0cad 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -7,7 +7,6 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" -HydroModels = "7e3cde01-c141-467b-bff6-5350a0af19fc" JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" Lux = "b2108857-7c20-44ae-9111-449ecde12c47" LuxCore = "bb33d45b-7691-41d6-9220-0943567d0623" diff --git a/docs/make.jl b/docs/make.jl index b7f9834..ee99532 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,6 +1,6 @@ push!(LOAD_PATH, "../src/") using Documenter -using HydroModels +# using HydroModels # English Documentation makedocs( @@ -21,6 +21,7 @@ makedocs( linkcheck = true, source = "src", build = "build_en", + warnonly = true, # 配置页面结构 pages = [ "Home" => "index.md", diff --git a/docs/src/code/build_model.jl b/docs/src/code/build_model.jl deleted file mode 100644 index 09fdfe7..0000000 --- a/docs/src/code/build_model.jl +++ /dev/null @@ -1,69 +0,0 @@ -using CSV -using DataFrames -using ComponentArrays -using BenchmarkTools -using NamedTupleTools -using Plots -using HydroModels -using HydroModelTools -using OrdinaryDiffEq -include("../models/ExpHydro.jl") -println(exphydro_model) - -# Define model parameters -params = ComponentVector( - f = 0.01674478, # Infiltration parameter - Smax = 1709.461015, # Maximum soil water storage - Qmax = 18.46996175, # Maximum discharge - Df = 2.674548848, # Degree-day factor - Tmax = 0.175739196, # Maximum temperature threshold - Tmin = -2.092959084 # Minimum temperature threshold -) - -# Define initial states -inistates = ComponentVector( - snowpack = 0.0, # Snow accumulation - soilwater = 1303.004248 # Soil water content -) - -pas = ComponentVector(params=params,initstates=inistates) - -# Read input data -file_path = "../data/exphydro/01013500.csv" -df = DataFrame(CSV.File(file_path)) -ts = collect(1:10000) # Time series length -input_ntp = (lday=df[ts, "dayl(day)"], temp=df[ts, "tmean(C)"], prcp=df[ts, "prcp(mm/day)"]) -input = Matrix(reduce(hcat, collect(input_ntp[HydroModels.get_input_names(exphydro_model)]))') - -# Configure solver -# solver = HydroModels.ManualSolver{true}() -solver = ODESolver() - -# Run model with benchmarking -@btime result = exphydro_model(input, pas, config=(solver=solver, timeidx=ts)); - -@btime result1 = exphydro_model(input, pas, config=(solver=ODESolver(alg=Tsit5(), abstol=1e-3, reltol=1e-3), timeidx=ts)); -@btime result2 = exphydro_model(input, pas, config=(solver=DiscreteSolver(), timeidx=ts)); - -# convert to NamedTuple -model_total_output_names = vcat(HydroModels.get_state_names(exphydro_model), HydroModels.get_output_names(exphydro_model)) -result_ntp = NamedTuple{Tuple(model_total_output_names)}(eachslice(result, dims=1)) - -DataFrame(result_ntp) -# Visualize results -plot(result_ntp.flow, label="Simulated") -plot!(df[ts, "flow(mm)"], label="Observed") - -savefig("exphydro_predict.png") - -# Setup multiple nodes -node_num = 10 # Number of nodes -inputs = repeat(reshape(input, size(input)[1], 1, size(input)[2]), 1, node_num, 1) -ptypes = [Symbol(:node, i) for i in 1:node_num] - -# Configure parameters and states for multiple nodes -params_multi = ComponentVector(NamedTuple{Tuple(ptypes)}(repeat([params], node_num))) -init_states_multi = ComponentVector(NamedTuple{Tuple(ptypes)}(repeat([inistates], node_num))) -pas_multi = ComponentVector(params=params_multi, initstates=init_states_multi) -# Run multi-node simulation -results = exphydro_model(inputs, pas_multi, config=(solver=solver, timeidx=ts)) \ No newline at end of file