Skip to content

Commit 8d8d4b0

Browse files
authored
Merge pull request #50 from OpenWaterAnalytics/dev_ver
Modify solver version func and add an unit test
2 parents 60fccac + 14cc891 commit 8d8d4b0

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

swmm-toolkit/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def exclude_files(cmake_manifest):
7676

7777
setup(
7878
name = "swmm-toolkit",
79-
version = "0.5.0",
79+
version = "0.6.0",
8080

8181
cmake_args = cmake_args,
8282

swmm-toolkit/src/swmm/toolkit/solver.i

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@
6060

6161
%apply char **OUTCHAR {
6262
char **errorMsg,
63-
char **id
63+
char **id,
64+
char **major,
65+
char **minor,
66+
char **patch
6467
};
6568

6669
/* TYPEMAPS FOR MEMORY MANAGEMNET OF DOUBLE ARRAYS */
@@ -81,7 +84,6 @@
8184
}
8285
}
8386

84-
8587
%typemap(in, numinputs=0) SM_NodeStats **in_out_dict (SM_NodeStats *temp){
8688
$1 = &temp;
8789
}
@@ -322,7 +324,7 @@ int swmm_end(void);
322324
int swmm_report(void);
323325
int swmm_getMassBalErr(float *OUTPUT, float *OUTPUT, float *OUTPUT);
324326
int swmm_close(void);
325-
int swmm_getVersion(void);
327+
int swmm_getVersionInfo(char** major, char** minor, char** patch);
326328

327329

328330
// TOOLKIT API

swmm-toolkit/src/swmm/toolkit/solver_rename.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
%rename(report) swmm_report;
2121
%rename(get_mass_bal_err) swmm_getMassBalErr;
2222
%rename(close) swmm_close;
23-
%rename(version) swmm_getVersion;
23+
%rename(version) swmm_getVersionInfo;
2424

2525
//%rename(error_get_message) swmm_getAPIError;
2626
%rename(system_get_routing_stats) swmm_getSystemRoutingStats;

swmm-toolkit/swmm-solver

swmm-toolkit/tests/test_solver.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ def test_step(handle):
9797
solver.report()
9898

9999

100+
def test_version(handle):
101+
major, minor, patch = solver.version()
102+
print(major, minor, patch)
103+
assert major == '5'
104+
105+
100106
def test_simulation_unit(handle):
101107
simulation_system_unit_option = solver.simulation_get_unit(toolkit_enum.UnitProperty.SYSTEM_UNIT)
102108
simulation_flow_unit_option = solver.simulation_get_unit(toolkit_enum.UnitProperty.FLOW_UNIT)

0 commit comments

Comments
 (0)