-
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
LGVISIUM-102: common parent class "Sidebar" for LayerIdentifierColumn and DepthColumn #105
LGVISIUM-102: common parent class "Sidebar" for LayerIdentifierColumn and DepthColumn #105
Conversation
# Conflicts: # src/stratigraphy/depthcolumn/depthcolumn.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the structure and naming -- it's much more intuitive for me now to understand which class does what.
Question regarding parent classes: AAboveBSidebar
and AToBSidebar
and LayerIdentifierSidebar
are child classes of Sidebar
, which makes perfect sense to me. For the corresponding extractors AAboveBSidebarExtractor
and AtoBSidebarExtractor
and LayerIdentifierSidebarExtractor
this is not the case. How do you decide when to use parent classes for certain classes?
Regarding the #todo: automatic AAboveBInterval
: will it be possible somehow to determine the interval type based on the sidebar type?
@lhaibach Generally speaking, main reasons for using a parent class are:
Re the TODO in |
I have now created a ticket for that last TODO: https://jira.swisstopo.ch/browse/LGVISIUM-104 |
@stijnvermeeren-swisstopo thanks for explaining :) ! |
A lot of lines changes, but a lot of it is simple renaming, moving code to different files and documentation.
Main renamed classes:
BoundaryDepthColumn
->AAboveBSidebar
LayerDepthColumn
->AToBSidebar
LayerIdentifierColumn
->LayerIdentifierSidebar
These three classes now extend from a common parent class (
Sidebar
).Logic for finding these different "sidebars" in borehole profiles is contained in respective SidebarExtractor classes.
Code for all of these is now more cleanly contained in a single
sidebar
package.The bounding boxes for depth columns and material descriptions, that are part of the predictions.json output, are now more elegantly represented by a new class BoundaryBoxes, removing the need to implement JSON serialization logic from the actual Sidebar (formerly DepthColumn) classes.
There is a very small / almost negligible effect on the benchmarking scores, caused by the fact that we no longer automatically reject material descriptions to which we cannot associate any depth interval.
This PR also updates the documentation for the predictions.json format, moving it to a separate markdown file, and removing a few redundant entries from the JSON output