Skip to content

Commit

Permalink
Merge pull request #159 from DHI/minor/update_mike1d_to_23.0
Browse files Browse the repository at this point in the history
Update MIKE 1D NuGet packages to version 23.0
  • Loading branch information
ryan-kipawa authored Feb 7, 2025
2 parents 65087d9 + 65a61c4 commit 2d3a702
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
15 changes: 6 additions & 9 deletions scripts/nuget_retriever.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Module retrieving MIKE 1D nuget packages for runnig MIKE IO 1D."""

import os
import shutil
import urllib.request
Expand All @@ -9,9 +11,7 @@


class NuGetPackageInfo:
"""
Information about NuGet package to retrieve
"""
"""Information about NuGet package to retrieve."""

root = "https://www.nuget.org/api/v2/package/"

Expand All @@ -28,9 +28,7 @@ def __init__(self, name, version, path):


class NuGetRetriever:
"""
Retrieves necessary DHI NuGet packages and installs them into bin folder of MIKE IO 1D.
"""
"""Retrieves necessary DHI NuGet packages and installs them into bin folder of MIKE IO 1D."""

# Default path
path_default = f".{os.sep}"
Expand All @@ -42,7 +40,7 @@ class NuGetRetriever:
bin_dir_name = os.path.join("mikeio1d", "bin")

# Default version of DHI NuGet packages to retrieve
version_default = "22.0.3"
version_default = "23.0.3"

# DHI NuGet packages to install
package_names = [
Expand All @@ -66,7 +64,6 @@ class NuGetRetriever:

version_map = {
"DHI.corlib": "1.0.0",
"DHI.Mike1D.ResultDataAccess": "22.0.4",
"NetTopologySuite": "2.0.0",
"DHI.MikeCore.Linux.rhel7": "20.0.0",
}
Expand Down Expand Up @@ -181,7 +178,7 @@ def check_file_candidate(self, file_candidate):

@staticmethod
def install(version=version_default):
"""Installs NuGet packages into mikeio1d/bin folder"""
"""Installs NuGet packages into mikeio1d/bin folder."""
cwd = os.getcwd()
path, _ = os.path.split(os.path.join(cwd, __file__))
path = os.path.normpath(os.path.join(path, ".."))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_swmm_catchments.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_read(test_file):

def test_quantities(test_file):
quantities = test_file.quantities
assert len(quantities) == 36
assert len(quantities) == 37


@pytest.mark.parametrize(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_swmm_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_read(test_file):

def test_quantities(test_file):
quantities = test_file.quantities
assert len(quantities) == 36
assert len(quantities) == 37


def test_info(test_file):
Expand All @@ -43,7 +43,7 @@ def test_data_item_dicts(test_file):
assert len(swmm_out.catchments) == 8
assert len(swmm_out.nodes) == 14
assert len(swmm_out.reaches) == 13
assert len(swmm_out.global_data) == 14
assert len(swmm_out.global_data) == 15


@pytest.mark.parametrize(
Expand Down
Binary file modified tests/testdata/expected_results/swmm_out.parquet
Binary file not shown.

0 comments on commit 2d3a702

Please sign in to comment.