Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"Ribasim"
],
"files.insertFinalNewline": true,
"julia.executablePath": "julia +1.11.7",
"julia.executablePath": "julia +1.12.4",
"julia.additionalArgs": [
"--check-bounds=yes"
],
Expand Down
264 changes: 127 additions & 137 deletions Manifest.toml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name = "root"
authors = ["Deltares and contributors <ribasim.info@deltares.nl>"]
description = "Meta-project used to share the Manifest of Ribasim and its dependents"

[workspace]
projects = ["core"]

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Expand Down Expand Up @@ -80,6 +83,7 @@ TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"

[sources]
PackageCompiler = {rev = "bundle_less_artifacts_v1.12", url = "https://github.com/visr/PackageCompiler.jl"}
Ribasim = {path = "core"}

[compat]
Expand Down
13 changes: 4 additions & 9 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,10 @@ In [1]: from ctypes import CDLL, c_int, c_char_p, create_string_buffer, byref

In [2]: c_dll = CDLL("libribasim", winmode=0x08) # winmode for Windows

In [3]: argument = create_string_buffer(0)
...: c_dll.init_julia(c_int(0), byref(argument))
Out[3]: 1
In [3]: config_path = "ribasim.toml"

In [4]: config_path = "ribasim.toml"
In [4]: c_dll.initialize(c_char_p(config_path.encode()))
Out[4]: 0

In [5]: c_dll.initialize(c_char_p(config_path.encode()))
In [5]: c_dll.update()
Out[5]: 0

In [6]: c_dll.update()
Out[6]: 0
```
5 changes: 0 additions & 5 deletions build/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ fn main() -> ExitCode {
}
};

// Init Julia
let init_julia: Symbol<unsafe extern "C" fn(i32, *const libc::c_char) -> i32> =
lib.get(b"init_julia").unwrap();
init_julia(0, CString::default().as_ptr());

// Execute
let execute: Symbol<unsafe extern "C" fn(*const libc::c_char) -> i32> =
lib.get(b"execute").unwrap();
Expand Down
33 changes: 5 additions & 28 deletions core/Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name = "Ribasim"
uuid = "aac5e3d9-0b8f-4d4f-8241-b1a7a9632635"
authors = ["Deltares and contributors <ribasim.info@deltares.nl>"]
manifest = "../Manifest.toml"
version = "2026.1.0-rc1"

[workspace]
projects = ["test"]

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Expand Down Expand Up @@ -57,14 +59,11 @@ TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
[compat]
ADTypes = "1.13"
Accessors = "0.1"
Aqua = "0.8"
Arrow = "2.3"
BasicModelInterface = "0.1"
CSV = "0.10"
CodecZstd = "0.7, 0.8"
Configurations = "0.17"
DBInterface = "2.4"
DataFrames = "1.4"
DataInterpolations = "8.3"
DataStructures = "0.18, 0.19"
Dates = "1"
Expand All @@ -74,10 +73,8 @@ DifferentiationInterface = "0.6.48, 0.7"
EnumX = "1.0"
FiniteDiff = "2.21"
ForwardDiff = "0.10.38, 1"
Glob = "1.3.1"
Graphs = "1.9"
HiGHS = "1.7"
IOCapture = "0.2, 1"
IterTools = "1.4"
JuMP = "1.15"
LinearAlgebra = "1"
Expand All @@ -98,40 +95,20 @@ OrdinaryDiffEqSDIRK = "1.1"
OrdinaryDiffEqTsit5 = "1.1"
PrecompileTools = "1.2.1"
Preferences = "1.4.3"
Printf = "1.11.0"
Printf = "1"
SQLite = "1.5.1"
SciMLBase = "2.36"
SparseArrays = "1"
SparseConnectivityTracer = "1"
SparseMatrixColorings = "0.4.14"
Statistics = "1"
StructArrays = "0.6.13, 0.7"
TOML = "1"
Tables = "1"
TerminalLoggers = "0.1.7"
Test = "1"
TestItemRunner = "1"
TranscodingStreams = "0.9, 0.10, 0.11"
julia = "1.11"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
IOCapture = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
julia = "1.12"

[preferences.LinearSolve]
LoadMKL_JLL = false

[preferences.Ribasim]
precompile_workload = false

[targets]
test = ["Aqua", "CSV", "DataFrames", "Glob", "IOCapture", "Logging", "Statistics", "TerminalLoggers", "Test", "TOML", "TestItemRunner"]
52 changes: 52 additions & 0 deletions core/test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[deps]
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
BasicModelInterface = "59605e27-edc0-445a-b93d-c09a3a50b330"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CodecZstd = "6b39b394-51ab-5f42-8807-6242bab2b4c2"
Configurations = "5218b696-f38b-4ac9-8b61-a12ec717816d"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
IOCapture = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
LoggingExtras = "e6f89c97-d47a-5376-807f-9c37f3926c36"
MetaGraphsNext = "fa8bd995-216d-47f1-8a91-f3b68fbeb377"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
OrdinaryDiffEqBDF = "6ad6398a-0878-4a85-9266-38940aa047c8"
OrdinaryDiffEqCore = "bbf590c4-e513-4bbe-9b18-05decba2e5d8"
OrdinaryDiffEqNonlinearSolve = "127b3ac7-2247-4354-8eb6-78cf4e7c58e8"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Ribasim = "aac5e3d9-0b8f-4d4f-8241-b1a7a9632635"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"

[sources]
Ribasim = {path = "core"}

[compat]
Aqua = "0.8"
CSV = "0.10"
DataFrames = "1.4"
Glob = "1.3"
IOCapture = "0.2, 1"
Statistics = "1"
TOML = "1"
Test = "1"
TestItemRunner = "1"
6 changes: 1 addition & 5 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test-ribasim-python-cov = "pytest --numprocesses=4 --cov=ribasim --cov-report=xm
test-ribasim-api = "pytest --basetemp=python/ribasim_api/tests/temp --junitxml=report.xml python/ribasim_api/tests"
# Installation
# Keep Julia version synced with julia.executablePath in .vscode/settings.json
install-julia = "juliaup add 1.11.7 && juliaup override set 1.11.7"
install-julia = "juliaup add 1.12.4 && juliaup override set 1.12.4"
install-pre-commit = "pre-commit install"
# Note that this has a Windows specific override
install-ci = { depends-on = ["install-julia", "update-registry-julia"] }
Expand Down Expand Up @@ -258,10 +258,6 @@ quarto-preview = { cmd = "echo 'Skipping quarto preview on ARM64 Linux (Quarto n
quarto-check = { cmd = "echo 'Skipping quarto check on ARM64 Linux (Quarto not supported)'" }
quarto-render = { cmd = "echo 'Skipping quarto render on ARM64 Linux (Quarto not supported)'" }

[target.win.activation]
# Workaround a conflict between conda openssl activation and julia < 1.12
scripts = ["utils/unset-ssl-cert.bat"]

[dependencies]
datacompy = ">=0.16"
geopandas = ">=1.0"
Expand Down
9 changes: 0 additions & 9 deletions python/ribasim_api/ribasim_api/ribasim_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# %%
from ctypes import byref, c_int, create_string_buffer

from xmipy import XmiWrapper


Expand All @@ -21,13 +19,6 @@ def get_constant_int(self, name: str) -> int:
return 1025
raise ValueError(f"{name} does not map to an integer exposed by Ribasim")

def init_julia(self) -> None:
argument = create_string_buffer(0)
self.lib.init_julia(c_int(0), byref(argument))

def shutdown_julia(self) -> None:
self.lib.shutdown_julia(c_int(0))

def update_subgrid_level(self) -> None:
self.lib.update_subgrid_level()

Expand Down
13 changes: 0 additions & 13 deletions python/ribasim_api/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from ribasim_api import RibasimApi
from ribasim_testmodels import (
basic_model,
basic_transient_model,
leaky_bucket_model,
two_basin_model,
user_demand_model,
Expand All @@ -23,13 +22,6 @@ def libribasim_paths() -> tuple[Path, Path]:
return lib_path, lib_folder


@pytest.fixture(scope="session", autouse=True)
def load_julia(libribasim_paths) -> None:
lib_path, lib_folder = libribasim_paths
libribasim = RibasimApi(lib_path, lib_folder)
libribasim.init_julia()


@pytest.fixture(scope="function")
def libribasim(libribasim_paths, request) -> RibasimApi:
lib_path, lib_folder = libribasim_paths
Expand All @@ -46,11 +38,6 @@ def basic() -> ribasim.Model:
return basic_model()


@pytest.fixture(scope="session")
def basic_transient(basic) -> ribasim.Model:
return basic_transient_model(basic)


@pytest.fixture(scope="session")
def leaky_bucket() -> ribasim.Model:
return leaky_bucket_model()
Expand Down
6 changes: 0 additions & 6 deletions utils/unset-ssl-cert.bat

This file was deleted.

Loading