Currently we use _check to test if the class invariants still hold and if not fallback to GeoDataFrame/DataFrame.
This is nice one hand as we always know that the data will be correct (up to a certain point → e.g. we don't check for geometry in the _constructor)
The negative is that for TripsGeoDataFrame a line of code can have 4 different output types and you have to keep in mind what is what, such that you don't call generate_tours on a GeoDataframe. This is can be a significant cognitive load.
In total we would have three different class types (Positionfixes, TripsGeoDataFrames, Tours) that have three different patterns how they fallback and to what. This is quite hard to explain.
If we would remove _check then we would only have to explain that TripsGeoDataFrame fallback to TripsDataFrame and the rest would be equivalent to GeoPandas.
Additionally we could call the validate in each method to assure the data is in the right shape.
Currently we use
_check
to test if the class invariants still hold and if not fallback toGeoDataFrame
/DataFrame
. This is nice one hand as we always know that the data will be correct (up to a certain point → e.g. we don't check for geometry in the_constructor
) The negative is that forTripsGeoDataFrame
a line of code can have 4 different output types and you have to keep in mind what is what, such that you don't callgenerate_tours
on aGeoDataframe
. This is can be a significant cognitive load. In total we would have three different class types (Positionfixes
,TripsGeoDataFrames
,Tours
) that have three different patterns how they fallback and to what. This is quite hard to explain. If we would remove_check
then we would only have to explain thatTripsGeoDataFrame
fallback toTripsDataFrame
and the rest would be equivalent toGeoPandas
. Additionally we could call thevalidate
in each method to assure the data is in the right shape.