Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bifbof
Copy link
Collaborator

@bifbof bifbof commented Sep 5, 2023

Adding the Trips classes to trackintel.
I changed the accessor to the trips function to create either the TripsDataFrame or TripsGeoDataFrame class, depending on whether a geocolumn is present or not.
When I implemented these changes, I sometimes thought it would be easier to implement a single class, aka a Trips class with no fallback mechanism, as Nina suggested in a meeting. So that it remains a Trips class even if it loses the geometry column. I would be open to discuss if this alternative implementation would be more appropriate.
In another PR, I should add documentation explaining this split into two classes and the complicated fallback pattern.

@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.25% 🎉

Comparison is base (ec2391a) 93.05% compared to head (0ba7e73) 93.31%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #518      +/-   ##
==========================================
+ Coverage   93.05%   93.31%   +0.25%     
==========================================
  Files          34       34              
  Lines        2074     2153      +79     
  Branches      388      409      +21     
==========================================
+ Hits         1930     2009      +79     
  Misses        130      130              
  Partials       14       14              
Files Changed Coverage Δ
trackintel/__init__.py 100.00% <100.00%> (ø)
trackintel/io/file.py 100.00% <100.00%> (ø)
trackintel/io/postgis.py 96.07% <100.00%> (ø)
trackintel/model/__init__.py 100.00% <100.00%> (ø)
trackintel/model/trips.py 100.00% <100.00%> (ø)
trackintel/model/util.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hongyeehh hongyeehh requested a review from NinaWie September 7, 2023 08:13
Copy link
Member

@NinaWie NinaWie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look, thanks for the great work on this complicated issue due to the DataFrame / GeoDataFrame fallbacks. In response to your comment, I would still prefer to have a dedicated class Trips, so that the user does not need to care about the dataframe / geodataframe stuff. Some of my comments are related to this. Before changing everything to having a Trips class, I would however wait whether @hongyeehh or @henrymartin1 agree to that.

Copy link
Member

@NinaWie NinaWie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanations and changes, from my side, it is fine now :)

Copy link
Member

@hongyeehh hongyeehh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the additional explanation. This is also ready from my side. Great effort!

@hongyeehh hongyeehh merged commit 296f397 into mie-lab:master Sep 17, 2023
@bifbof bifbof deleted the trips_to_class branch September 19, 2023 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants