Skip to content

Commit

Permalink
Merged main.
Browse files Browse the repository at this point in the history
  • Loading branch information
evetion committed Nov 2, 2023
2 parents 6d70886 + ac648be commit e2510be
Show file tree
Hide file tree
Showing 45 changed files with 17,042 additions and 10,379 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,11 @@ jobs:
- name: Render Quarto Project
run: pixi run quarto-render

- name: Set up Quarto for publish
uses: quarto-dev/quarto-actions/setup@v2
- name: Publish Quarto Project
if: github.ref == 'refs/heads/main'
uses: quarto-dev/quarto-actions/publish@v2
uses: peaceiris/actions-gh-pages@v3
with:
path: docs
render: false
target: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_site
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit_auto_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
- uses: browniebroke/pre-commit-autoupdate-action@main
- uses: peter-evans/create-pull-request@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
- uses: pre-commit/[email protected]
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -14,7 +14,7 @@ repos:
exclude: '.teamcity'
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.2
rev: v0.1.3
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
Expand All @@ -26,6 +26,6 @@ repos:
hooks:
- id: nbstripout
- repo: https://github.com/crate-ci/typos
rev: v1.16.15
rev: v1.16.21
hooks:
- id: typos
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ libraries, notably [ModelingToolkit.jl](https://mtk.sciml.ai/stable/).
For most users the [latest release](https://github.com/Deltares/Ribasim/releases/latest) is recommended, it can be downloaded here:

- Ribasim executable: [ribasim_cli.zip](https://github.com/Deltares/Ribasim/releases/latest/download/ribasim_cli.zip).
- Python package: [ribasim-0.4.0-py3-none-any.whl](https://github.com/Deltares/Ribasim/releases/latest/download/ribasim-0.4.0-py3-none-any.whl)
- Python package: [ribasim-0.5.0-py3-none-any.whl](https://github.com/Deltares/Ribasim/releases/latest/download/ribasim-0.5.0-py3-none-any.whl)
- QGIS plugin: [ribasim_qgis.zip](https://github.com/Deltares/Ribasim/releases/latest/download/ribasim_qgis.zip).
- Generated testmodels: [generated_testmodels.zip](https://github.com/Deltares/Ribasim/releases/latest/download/generated_testmodels.zip)

The nightly builds contain the latest developments and can be found below. It is important to either use the release or nightly for all components.

- Ribasim executable: [ribasim_cli.zip](https://ribasim.s3.eu-west-3.amazonaws.com/teamcity/Ribasim_Ribasim/BuildRibasimCliWindows/latest/ribasim_cli.zip).
- Python package: [ribasim-0.4.0-py3-none-any.whl](https://ribasim.s3.eu-west-3.amazonaws.com/teamcity/Ribasim_Ribasim/BuildRibasimCliWindows/latest/ribasim-0.4.0-py3-none-any.whl)
- Python package: [ribasim-0.5.0-py3-none-any.whl](https://ribasim.s3.eu-west-3.amazonaws.com/teamcity/Ribasim_Ribasim/BuildRibasimCliWindows/latest/ribasim-0.5.0-py3-none-any.whl)
- QGIS plugin: [ribasim_qgis.zip](https://ribasim.s3.eu-west-3.amazonaws.com/teamcity/Ribasim_Ribasim/BuildRibasimCliWindows/latest/ribasim_qgis.zip).

Currently only Windows builds for `ribasim_cli.zip` are available.
Expand Down
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
58 changes: 29 additions & 29 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 All @@ -16,9 +16,9 @@ version = "0.4.4"

[[deps.Adapt]]
deps = ["LinearAlgebra", "Requires"]
git-tree-sha1 = "76289dc51920fdc6e0013c872ba9551d54961c24"
git-tree-sha1 = "02f731463748db57cc2ebfbd9fbc9ce8280d3433"
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "3.6.2"
version = "3.7.1"
weakdeps = ["StaticArrays"]

[deps.Adapt.extensions]
Expand Down Expand Up @@ -188,9 +188,9 @@ version = "1.0.5+0"

[[deps.ComponentArrays]]
deps = ["ArrayInterface", "ChainRulesCore", "ForwardDiff", "Functors", "LinearAlgebra", "PackageExtensionCompat", "StaticArrayInterface", "StaticArraysCore"]
git-tree-sha1 = "3ee12062466a73b5f9c04113375e4934f174bc2c"
git-tree-sha1 = "f1ac18d8d4e8a6303d6d2d1c870528c3c52f0895"
uuid = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
version = "0.15.3"
version = "0.15.4"

[deps.ComponentArrays.extensions]
ComponentArraysAdaptExt = "Adapt"
Expand Down Expand Up @@ -300,9 +300,9 @@ version = "0.3.25"

[[deps.DiffEqBase]]
deps = ["ArrayInterface", "ChainRulesCore", "DataStructures", "DocStringExtensions", "EnumX", "EnzymeCore", "FastBroadcast", "ForwardDiff", "FunctionWrappers", "FunctionWrappersWrappers", "LinearAlgebra", "Logging", "Markdown", "MuladdMacro", "Parameters", "PreallocationTools", "PrecompileTools", "Printf", "RecursiveArrayTools", "Reexport", "Requires", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Static", "StaticArraysCore", "Statistics", "Tricks", "TruncatedStacktraces", "ZygoteRules"]
git-tree-sha1 = "95b6df71e218379a831874215b0effaac791d7d7"
git-tree-sha1 = "36a590efdbee58b38f903ffc3b378f4a5336bc3f"
uuid = "2b5f629d-d688-5b77-993f-72d75c75574e"
version = "6.133.1"
version = "6.134.0"

[deps.DiffEqBase.extensions]
DiffEqBaseDistributionsExt = "Distributions"
Expand Down Expand Up @@ -501,9 +501,9 @@ version = "1.9.0"

[[deps.HiGHS]]
deps = ["HiGHS_jll", "MathOptInterface", "PrecompileTools", "SparseArrays"]
git-tree-sha1 = "9d75ef949c17a2a150b91b8365a6e5bc43a2a0d3"
git-tree-sha1 = "fce13308f09771b160232903cad57be39a8a0ebb"
uuid = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
version = "1.7.3"
version = "1.7.5"

[[deps.HiGHS_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"]
Expand Down Expand Up @@ -577,9 +577,9 @@ version = "0.21.4"

[[deps.JuMP]]
deps = ["LinearAlgebra", "MacroTools", "MathOptInterface", "MutableArithmetics", "OrderedCollections", "Printf", "SnoopPrecompile", "SparseArrays"]
git-tree-sha1 = "3700a700bc80856fe673b355123ae4574f2d5dfe"
git-tree-sha1 = "25b2fcda4d455b6f93ac753730d741340ba4a4fe"
uuid = "4076af6c-e467-56ae-b986-b466b2749572"
version = "1.15.1"
version = "1.16.0"

[deps.JuMP.extensions]
JuMPDimensionalDataExt = "DimensionalData"
Expand Down Expand Up @@ -661,9 +661,9 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[deps.LinearSolve]]
deps = ["ArrayInterface", "ConcreteStructs", "DocStringExtensions", "EnumX", "EnzymeCore", "FastLapackInterface", "GPUArraysCore", "InteractiveUtils", "KLU", "Krylov", "Libdl", "LinearAlgebra", "MKL_jll", "PrecompileTools", "Preferences", "RecursiveFactorization", "Reexport", "Requires", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Sparspak", "SuiteSparse", "UnPack"]
git-tree-sha1 = "31353ba539d14a342908f765407abffd8db5f3c7"
git-tree-sha1 = "a563cd835c9ed5295c35a7d140e0bf0a514bb10a"
uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
version = "2.11.0"
version = "2.13.0"

[deps.LinearSolve.extensions]
LinearSolveBandedMatricesExt = "BandedMatrices"
Expand Down Expand Up @@ -756,9 +756,9 @@ uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[deps.MathOptInterface]]
deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test", "Unicode"]
git-tree-sha1 = "5c9f1e635e8d491297e596b56fec1c95eafb95a3"
git-tree-sha1 = "13b3d40084d04e609e0509730f05215fb2a2fba4"
uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
version = "1.20.1"
version = "1.21.0"

[[deps.MbedTLS_jll]]
deps = ["Artifacts", "Libdl"]
Expand Down Expand Up @@ -813,9 +813,9 @@ version = "1.2.0"

[[deps.NonlinearSolve]]
deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "EnumX", "FiniteDiff", "ForwardDiff", "LineSearches", "LinearAlgebra", "LinearSolve", "PrecompileTools", "RecursiveArrayTools", "Reexport", "SciMLBase", "SimpleNonlinearSolve", "SparseArrays", "SparseDiffTools", "StaticArraysCore", "UnPack"]
git-tree-sha1 = "ee92770e0832314ccd424d83a0ab4c75fc6dc91f"
git-tree-sha1 = "9203b3333c9610664de2e8cbc23cfd726663df7d"
uuid = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
version = "2.3.0"
version = "2.4.0"

[deps.NonlinearSolve.extensions]
NonlinearSolveFastLevenbergMarquardtExt = "FastLevenbergMarquardt"
Expand Down Expand Up @@ -1021,17 +1021,19 @@ version = "3.43.0+0"

[[deps.SciMLBase]]
deps = ["ADTypes", "ArrayInterface", "ChainRulesCore", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FillArrays", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables", "TruncatedStacktraces", "ZygoteRules"]
git-tree-sha1 = "6134c8970f82f23c43d3580d79c3e47acf232083"
git-tree-sha1 = "1c2a4e245744dd76b2eb677d3535ffad16d8b989"
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
version = "2.4.1"
version = "2.5.0"

[deps.SciMLBase.extensions]
SciMLBasePartialFunctionsExt = "PartialFunctions"
SciMLBasePyCallExt = "PyCall"
SciMLBasePythonCallExt = "PythonCall"
SciMLBaseRCallExt = "RCall"
SciMLBaseZygoteExt = "Zygote"

[deps.SciMLBase.weakdeps]
PartialFunctions = "570af359-4316-4cb7-8c74-252c00c2016b"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
RCall = "6f49c342-dc21-5d91-9882-a32aef131414"
Expand Down Expand Up @@ -1076,9 +1078,9 @@ uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[[deps.SimpleNonlinearSolve]]
deps = ["ArrayInterface", "DiffEqBase", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "PackageExtensionCompat", "PrecompileTools", "Reexport", "SciMLBase", "StaticArraysCore"]
git-tree-sha1 = "e308d089f5d0e733a017b61784c5813e672f760d"
git-tree-sha1 = "15ff97fa4881133caa324dacafe28b5ac47ad8a2"
uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7"
version = "0.1.22"
version = "0.1.23"

[deps.SimpleNonlinearSolve.extensions]
SimpleNonlinearSolveNNlibExt = "NNlib"
Expand Down Expand Up @@ -1231,9 +1233,9 @@ version = "1.0.1"

[[deps.Tables]]
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits"]
git-tree-sha1 = "a1f34829d5ac0ef499f6d84428bd6b4c71f02ead"
git-tree-sha1 = "cb76cf677714c095e535e3501ac7954732aeea2d"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
version = "1.11.0"
version = "1.11.1"

[[deps.Tar]]
deps = ["ArgTools", "SHA"]
Expand All @@ -1257,10 +1259,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 Expand Up @@ -1340,9 +1340,9 @@ version = "1.5.5+0"

[[deps.ZygoteRules]]
deps = ["ChainRulesCore", "MacroTools"]
git-tree-sha1 = "977aed5d006b840e2e40c0b48984f7463109046d"
git-tree-sha1 = "9d749cd449fb448aeca4feee9a2f4186dbb5d184"
uuid = "700de1a5-db45-46bc-99cf-38207098b444"
version = "0.2.3"
version = "0.2.4"

[[deps.libblastrampoline_jll]]
deps = ["Artifacts", "Libdl"]
Expand Down
4 changes: 2 additions & 2 deletions core/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Ribasim"
uuid = "aac5e3d9-0b8f-4d4f-8241-b1a7a9632635"
authors = ["Deltares and contributors <[email protected]>"]
version = "0.3.0"
version = "0.4.0"

[deps]
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
Expand Down 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
2 changes: 1 addition & 1 deletion core/src/Ribasim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module Ribasim
import IterTools
import BasicModelInterface as BMI
import HiGHS
import JuMP
import JuMP.Model as JuMPModel
import TranscodingStreams

Expand All @@ -43,7 +44,6 @@ using Graphs:
outneighbors,
rem_edge!

using JuMP: @variable, @constraint, @objective, set_normalized_rhs, optimize!, value
using Legolas: Legolas, @schema, @version, validate, SchemaVersion, declared
using Logging: current_logger, min_enabled_level, with_logger
using LoggingExtras: EarlyFilteredLogger, LevelOverrideLogger
Expand Down
Loading

0 comments on commit e2510be

Please sign in to comment.