-
Notifications
You must be signed in to change notification settings - Fork 50
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
ENH: Remove all potential import circles by copying docstrings #541
Conversation
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #541 +/- ##
==========================================
- Coverage 93.43% 93.28% -0.15%
==========================================
Files 32 32
Lines 2162 2114 -48
Branches 434 400 -34
==========================================
- Hits 2020 1972 -48
Misses 129 129
Partials 13 13
☔ View full report in Codecov by Sentry. |
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.
Wow, huge change in the docstrings, thanks for the effort to clean this up and remove circular imports.
It seems that with the new version, it can lead to inconsistencies when someone adapts the docstring and forgets to change it in the other place (despite your comments). I understand your argument that it's important to have documentation in the source code, but I'm still unsure whether we should do that everywhere. In particular in the model/xx.py files it might not be so important to have the docstring for the function in the source code, because every method is just a one-liner calling the actual function. But I leave it up to Henry and Ye, no strong opinion on this.
Okay updated the docstrings, made the minimal change to get this through. |
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.
Looks good to me now :)
This PR removes all imports in the class files that will later lead to circular imports.
In #540 I often used the function
@doc
for this, in this PR that isn't the case.Why? Because removing the docstring from all functions makes the source code harder to read and the advantages that
@doc
gives can also be done easily with just adjusting the docstrings by hand. Also it was so much easier to do.So what does this PR include?
@doc
usage for simpleto_csv
andto_postgis
functions/methods. Here the functions are so simple that the docstring is not necessary, plus all classes share the same docstring anyway.*args, **kwargs
. Argument names are also documentation and should not be avoided.There is a lot of overlap in the documentation of certain methods, e.g.
spatial_filter
. We can move these documentations into theTrackintelGeoDataFrame
and thus reduce the number of copies. However, this is not part of this PR, as this PR is already too large.