Skip to content

Commit

Permalink
Merge branch 'main' into allocation_input
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Oct 26, 2023
2 parents 0ce3d67 + fd4d9d3 commit be5b63e
Show file tree
Hide file tree
Showing 18 changed files with 8,264 additions and 398 deletions.
12 changes: 5 additions & 7 deletions build/create_binaries/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.9.3"
manifest_format = "2.0"
project_hash = "d99377ff8fe51b02cfd3a3aaf109a7ed1b45b3d2"
project_hash = "71b2262fd2a2bd6f9c0ade48d4062e051c3f39eb"

[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
Expand Down Expand Up @@ -113,9 +113,9 @@ version = "1.2.0"

[[deps.PackageCompiler]]
deps = ["Artifacts", "Glob", "LazyArtifacts", "Libdl", "Pkg", "Printf", "RelocatableFolders", "TOML", "UUIDs"]
git-tree-sha1 = "2838fa7697780395ef328861b7716925ac7dd48a"
git-tree-sha1 = "d24f0920777c64c0265e9725eb4a3ec450bc36dd"
uuid = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
version = "2.1.11"
version = "2.1.10"

[[deps.Parsers]]
deps = ["Dates", "PrecompileTools", "UUIDs"]
Expand Down Expand Up @@ -191,10 +191,8 @@ uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
version = "1.10.0"

[[deps.TimeZones]]
deps = ["Artifacts", "Dates", "Downloads", "InlineStrings", "Mocking", "Printf", "Scratch", "TZJData", "Unicode", "p7zip_jll"]
git-tree-sha1 = "6f2a9362603a79a916c54a10fc7c9a4ff2ca0848"
repo-rev = "cldr"
repo-url = "https://github.com/visr/TimeZones.jl"
deps = ["Artifacts", "Dates", "Downloads", "InlineStrings", "LazyArtifacts", "Mocking", "Printf", "Scratch", "TZJData", "Unicode", "p7zip_jll"]
git-tree-sha1 = "89e64d61ef3cd9e80f7fc12b7d13db2d75a23c03"
uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53"
version = "1.13.0"

Expand Down
2 changes: 1 addition & 1 deletion build/create_binaries/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"

[compat]
PackageCompiler = "2"
TimeZones = "1.13"
TimeZones = "=1.13.0"
julia = "1.9"
2 changes: 2 additions & 0 deletions build/create_binaries/create_app.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ using PackageCompiler
using TOML
using LibGit2

include("strip_cldr.jl")

# change directory to this script's location
cd(@__DIR__)

Expand Down
2 changes: 2 additions & 0 deletions build/create_binaries/create_lib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ using PackageCompiler
using TOML
using LibGit2

include("strip_cldr.jl")

cd(@__DIR__)

project_dir = "../libribasim"
Expand Down
24 changes: 24 additions & 0 deletions build/create_binaries/strip_cldr.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# The cldr artifact has such long paths that it errors on Windows unless long paths are enabled.
# Also the artifact has many files and is over 300 MB, while we only need a single small file.
# This modifies the artifact to remove everything except the file we need.
# Since the artifact is only used on Windows, only strip do it there.
# This needs exactly TimeZones 1.13.0, which is fixed in the Project.toml.
# https://github.com/JuliaTime/TimeZones.jl/issues/373

using Artifacts

if Sys.iswindows()
# Get the artifact directory and the file path we need to keep
hash = Base.SHA1("40b35727ea0aff9a9f28b7454004b68849caf67b")
@assert artifact_exists(hash)
artifact_dir = artifact_path(hash)
keep_file =
normpath(artifact_dir, "cldr-release-43-1/common/supplemental/windowsZones.xml")
@assert isfile(keep_file)

# Read the file into memory, empty the artifact dir, and write the file back
keep_file_content = read(keep_file)
rm(artifact_dir; recursive = true)
mkpath(dirname(keep_file))
write(keep_file, keep_file_content)
end
2 changes: 1 addition & 1 deletion build/libribasim/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.3.0"

[[deps.Ribasim]]
deps = ["Arrow", "BasicModelInterface", "CodecLz4", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "Dictionaries", "DiffEqCallbacks", "FiniteDiff", "ForwardDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "Logging", "LoggingExtras", "OrdinaryDiffEq", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "StructArrays", "Tables", "TerminalLoggers", "TimeZones", "TimerOutputs", "TranscodingStreams"]
deps = ["Arrow", "BasicModelInterface", "CodecLz4", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "Dictionaries", "DiffEqCallbacks", "FiniteDiff", "ForwardDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "Logging", "LoggingExtras", "OrdinaryDiffEq", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "StructArrays", "Tables", "TerminalLoggers", "TimerOutputs", "TranscodingStreams"]
path = "../../core"
uuid = "aac5e3d9-0b8f-4d4f-8241-b1a7a9632635"
version = "0.3.0"
Expand Down
2 changes: 1 addition & 1 deletion build/ribasim_cli/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.3.0"

[[deps.Ribasim]]
deps = ["Arrow", "BasicModelInterface", "CodecLz4", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "Dictionaries", "DiffEqCallbacks", "FiniteDiff", "ForwardDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "Logging", "LoggingExtras", "OrdinaryDiffEq", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "StructArrays", "Tables", "TerminalLoggers", "TimeZones", "TimerOutputs", "TranscodingStreams"]
deps = ["Arrow", "BasicModelInterface", "CodecLz4", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "Dictionaries", "DiffEqCallbacks", "FiniteDiff", "ForwardDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "Logging", "LoggingExtras", "OrdinaryDiffEq", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "StructArrays", "Tables", "TerminalLoggers", "TimerOutputs", "TranscodingStreams"]
path = "../../core"
uuid = "aac5e3d9-0b8f-4d4f-8241-b1a7a9632635"
version = "0.3.0"
Expand Down
8 changes: 3 additions & 5 deletions core/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.9.3"
manifest_format = "2.0"
project_hash = "734d92f362e5faf41ff9058fcbfa26406306498c"
project_hash = "c63b237aec6a6bf6314284b2b07a94b93a9f0a36"

[[deps.ADTypes]]
git-tree-sha1 = "5d2e21d7b0d8c22f67483ef95ebdc39c0e6b6003"
Expand Down Expand Up @@ -1257,10 +1257,8 @@ uuid = "8290d209-cae3-49c0-8002-c8c24d57dab5"
version = "0.5.2"

[[deps.TimeZones]]
deps = ["Artifacts", "Dates", "Downloads", "InlineStrings", "Mocking", "Printf", "Scratch", "TZJData", "Unicode", "p7zip_jll"]
git-tree-sha1 = "6f2a9362603a79a916c54a10fc7c9a4ff2ca0848"
repo-rev = "cldr"
repo-url = "https://github.com/visr/TimeZones.jl"
deps = ["Artifacts", "Dates", "Downloads", "InlineStrings", "LazyArtifacts", "Mocking", "Printf", "Scratch", "TZJData", "Unicode", "p7zip_jll"]
git-tree-sha1 = "89e64d61ef3cd9e80f7fc12b7d13db2d75a23c03"
uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53"
version = "1.13.0"
weakdeps = ["RecipesBase"]
Expand Down
2 changes: 1 addition & 1 deletion core/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SciMLBase = "1.60, 2"
StructArrays = "0.6.13"
Tables = "1"
TerminalLoggers = "0.1.7"
TimeZones = "1.13"
TimeZones = "=1.13.0"
TimerOutputs = "0.5"
TranscodingStreams = "0.9, 0.10"
julia = "1.9"
Expand Down
8 changes: 4 additions & 4 deletions core/src/create.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function parse_static_and_time(
)
if !is_valid
errors = true
@error "A $parameter_name time series for $nodetype node $(repr(node_name)) (#$node_id) has repeated times, this can not be interpolated."
@error "A $parameter_name time series for $nodetype node $(repr(node_name)) #$node_id has repeated times, this can not be interpolated."
end
else
# Activity of transient nodes is assumed to be true
Expand All @@ -168,7 +168,7 @@ function parse_static_and_time(
getfield(out, parameter_name)[node_idx] = val
end
else
@error "$nodetype node $(repr(node_name)) (#$node_id) data not in any table."
@error "$nodetype node $(repr(node_name)) #$node_id data not in any table."
errors = true
end
end
Expand Down Expand Up @@ -359,11 +359,11 @@ function TabulatedRatingCurve(db::DB, config::Config)::TabulatedRatingCurve
push!(interpolations, interpolation)
push!(active, true)
else
@error "TabulatedRatingCurve node $(repr(node_name)) (#$node_id) data not in any table."
@error "TabulatedRatingCurve node $(repr(node_name)) #$node_id data not in any table."
errors = true
end
if !is_valid
@error "A Q(h) relationship for TabulatedRatingCurve $(repr(node_name)) (#$node_id) from the $source table has repeated levels, this can not be interpolated."
@error "A Q(h) relationship for TabulatedRatingCurve $(repr(node_name)) #$node_id from the $source table has repeated levels, this can not be interpolated."
errors = true
end
end
Expand Down
4 changes: 2 additions & 2 deletions core/test/validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ end
@test length(logger.logs) == 2
@test logger.logs[1].level == Error
@test logger.logs[1].message ==
"A Q(h) relationship for TabulatedRatingCurve \"\" (#1) from the static table has repeated levels, this can not be interpolated."
"A Q(h) relationship for TabulatedRatingCurve \"\" #1 from the static table has repeated levels, this can not be interpolated."
@test logger.logs[2].level == Error
@test logger.logs[2].message ==
"A Q(h) relationship for TabulatedRatingCurve \"\" (#2) from the time table has repeated levels, this can not be interpolated."
"A Q(h) relationship for TabulatedRatingCurve \"\" #2 from the time table has repeated levels, this can not be interpolated."
end

@testset "Neighbor count validation" begin
Expand Down
34 changes: 0 additions & 34 deletions environment.yml

This file was deleted.

Loading

0 comments on commit be5b63e

Please sign in to comment.