-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2022-12 Change filter wastewater structures #94
base: master
Are you sure you want to change the base?
Conversation
- filtering on fk_wastewater_structures instead of selected wastewater_nodes: - replaced query = query.filter(QGEP.wastewater_networkelement.obj_id.in_(subset_ids)) with query = query.filter(QGEP.wastewater_networkelement.fk_wastewater_structure.in_(wws_ids)) - to be able to do that qgep_export needs new argument selection2 with the obj_id's of the selected elements from vw_gep_wastewater_structure - this needs a new function def selected_wws(self) in gui_export.py - adapting the qgep_export call in _init_.py: qgep_export(selection=export_dialog.selected_ids, selection2=export_dialog.selected_wws, labels_file=labels_file_path)
if only changed to wws_ids then we get the aditional wastewater_nodes in a structure but we miss wastewater_nodes of nodes without a structure (this can happen in Secondary network, should not be in the primary network except if we have two reaches in a channel): query = query.filter(QGEP.wastewater_networkelement.fk_wastewater_structure.in_(wws_ids) or QGEP.wastewater_networkelement.obj_id.in_(subset_ids))
Should fix #93 |
@olivierdalang will review this. |
@sjib Could you add a regression test (a test that would fail without your fix, and that works with your fix) ? You can copy If you're not sure how this can be done, can you give me an example of an object id to select that creates an export with missing objects, also stating the ids of the missing objects in the export ? Once that's in place, I will suggest some refactoring directly in the code:
(it's better to do the regression test first, so we can ensure your fix will still work after refactoring) |
I cannot find an example in the testdataset Arbon at the moment. I have to check back on the data with the issue. |
(converting this to draft so we don't merge by accident until comment are sorted) |
@sjib do we want this for 1.6.1 or do we save it for later? What has to be achieved to finish this work? |
The main point that Olivier suggested was to write a regression test. I tried, but I was not sucessful to find a suitable example in our demodata. |
query = query.filter(QGEP.wastewater_networkelement.fk_wastewater_structure.in_(wws_ids))