qwat / qwat-data-model

TEKSI Water module (project QWAT) - PostgreSQL / postgis Datamodel
https://www.teksi.ch
23 stars 24 forks source link

Network intervention simulation #345

Closed benoitblanc closed 1 year ago

benoitblanc commented 2 years ago

This pull request aims to add some features for the user to simulate network incidents :

bogdanvaduva commented 2 years ago

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.

sjib commented 2 years ago

@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)?

3nids commented 2 years ago

does it fix #171 ?

ponceta commented 1 year ago

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.

benoitblanc commented 1 year ago

@ponceta I have added code from deltas to data-model and init_qwat.sh

ponceta commented 1 year ago

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

ponceta commented 1 year ago

@benoitblanc could you rename the deltas to 1.4.0_XXX

benoitblanc commented 1 year ago

@ponceta I have renamed deltas to match v 1.4.0

ponceta commented 1 year ago

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?

ponceta commented 1 year ago

@benoitblanc if you're ready to merge, please remove the [WIP] Tag in the name of your pull request.