qwat-data-model
qwat-data-model copied to clipboard
[WIP] Network intervention simulation
This pull request aims to add some features for the user to simulate network incidents :
- network leakage
- network interruption
- network pollution
You've used my proposal for adding network path capabilities to QWAT. The pipe_reference table should be explained a little bit more, it needed geometry because otherwise we couldn't have a real path shown. The pipe_reference table must be kept up to date because otherwise the path could be different from what the user sees.
@benoitblanc Does this has a connection with what kind of network simulation software? Does this comply with the SIA405 water datamodel (Hydraulischer_Strang, hydraulischer_Knoten)?
does it fix #171 ?
Since there are only deltas, the network simulation are not initialized when initializing from scratch :
https://github.com/qwat/qwat-data-model/blob/master/init_qwat.sh
Please add the necessary files (same content as the deltas) and code adaptation to make it work for new users of TEKSI water module.
@ponceta I have added code from deltas to data-model and init_qwat.sh
Something doesn't please the CI. Is it possible that the delta initialize the functions but does not run these and therefore does not create the tables or vice versa?
Check...DIFFERENCES FOUND tables
- ('qwat_network', 'network') columns
- ('qwat_network', 'network', 'cost', None, 'YES', 'double precision', None, '5
- ('qwat_network', 'network', 'geometry', None, 'YES', 'USER-DEFINED', None, No
- ('qwat_network', 'network', 'id', None, 'YES', 'integer', None, '32', '2', No
- ('qwat_network', 'network', 'network_id', "nextval('qwat_network.network_netw
- ('qwat_network', 'network', 'reverse_cost', None, 'YES', 'double precision',
- ('qwat_network', 'network', 'source', None, 'YES', 'integer', None, '32', '2'
- ('qwat_network', 'network', 'target', None, 'YES', 'integer', None, '32', '2' constraints
- ('pipe_reference_fk_pipe_fkey', 'qwat_network.pipe_reference.fk_pipe', 'qwat_ views sequences
- ('network_network_id_seq', 'qwat_network')
@benoitblanc could you rename the deltas to 1.4.0_XXX
@ponceta I have renamed deltas to match v 1.4.0
Tests are fine, upgrade is fine.
We have issues on scalability tests and scalability tests multithreaded :
https://github.com/qwat/qwat-data-model/actions/runs/3912471610/jobs/6687155084#step:7:2289
Could you have a look at it? (It is probably due to our last merge of fk_distributor inheritance and should maybe be adressed in another pull request )
Set baseline...OK
*** QWAT was successfuly initialized! ***
/home/runner/work/qwat-data-model/qwat-data-model
Running initializations...
SET
SET
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
OK
Launching requests...
Iteration 0
Traceback (most recent call last):
File "/home/runner/work/qwat-data-model/qwat-data-model/tests/test_scalability.py", line 206, in <module>
test_scalability(args.pg_service, args.nb_iterations)
File "/home/runner/work/qwat-data-model/qwat-data-model/tests/test_scalability.py", line 27, in test_scalability
_execute_statements(cur, conn, TEST_SCRIPT, nb_iteration)
File "/home/runner/work/qwat-data-model/qwat-data-model/tests/test_scalability.py", line 191, in _execute_statements
res = cur.execute(statement)
File "/home/runner/.local/lib/python3.10/site-packages/psycopg2/extras.py", line 146, in execute
return super().execute(query, vars)
psycopg2.errors.DatatypeMismatch: column "fk_distributor" is of type integer[] but expression is of type integer
LINE 5: ...at_vl.part_type WHERE value_fr = 'bouchon'), 101, 1, 101, st...
^
HINT: You will need to rewrite or cast the expression.
@olivierdalang can we have a red light when scalability tests are not working fine?
@benoitblanc if you're ready to merge, please remove the [WIP] Tag in the name of your pull request.