-
Notifications
You must be signed in to change notification settings - Fork 34
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
Functional ransac #51
Conversation
@a-hurst can you offer your opinion here as well, please? |
Note that the idea of this code is to be able to do #36 , not to make the ultimate ransac function that in theory should arise from the comparison we make. |
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 suggest to make all functions in ransac.py
except find_bad_by_ransac
private. That means putting an underscore _
in front of the function names.
Furthermore, the new module needs to be documented in api.rst, please only document find_bad_by_ransac
there --> you can copy (or get inspired by) the syntax from the already existing sections.
Lastly, can you please add ransac.find_bad_by_ransac
here:
Lines 1 to 8 in dd618a3
"""initialize pyprep.""" | |
from pyprep.find_noisy_channels import NoisyChannels # noqa: F401 | |
from pyprep.prep_pipeline import PrepPipeline # noqa: F401 | |
from ._version import get_versions | |
__version__ = get_versions()["version"] | |
del get_versions |
for example:
import ransac # noqa: F401
So that users can do from pyprep import ransac
and then call ransac.find_bad_by_ransac
(actually this might be possible also without editing init.py, please feel free to check prior to changing it)
Codecov Report
@@ Coverage Diff @@
## master #51 +/- ##
==========================================
+ Coverage 96.76% 96.80% +0.03%
==========================================
Files 5 6 +1
Lines 526 532 +6
==========================================
+ Hits 509 515 +6
Misses 17 17
Continue to review full report at Codecov.
|
071193e
to
67a4d2c
Compare
@yjmantilla I pushed several commits to master to fix the documentation links and improve a few maintenance features. I now rebased your PR on top of these changes, and also added the new module to the API docs (see 67a4d2c) before continuing to work you will have to:
then it should tell you that everything is up to date and fine. (assuming you have a git remote "upstream" configured to point to sappelhoff/pyprep) I just hope you didn't have non-committed changes in your working directory :-) |
I have not forgotten this yet, just that now I'm doing the final projects of the semester so haven't got time to work on this until around the 25 of January. Cheers! And Happy New Year! |
Happy new year to you too @yjmantilla! |
67a4d2c
to
793af9a
Compare
I finally got the links within the docs working :-) working beautifully now: https://pyprep.readthedocs.io/en/latest/generated/find_noisy_channels.NoisyChannels.html#find_noisy_channels.NoisyChannels try to hover over the types like "float" or "np.random.RandomState" --> these are now links that will lead you to the docs of Python3 or Numpy respectively. I rebased this PR on my changes, you should be able to just continue where you left off once you find time 👍 |
793af9a
to
6f122f1
Compare
6f122f1
to
9ba9599
Compare
Sorry for the lateness (rough year start). Everything should be in place now. After this is merged next step is to make the example file comparing autoreject's and pyprep's versions of ransac. |
Thanks @yjmantilla hope nothing bad happend |
PR Description
Made ransac methods into their function versions.
Then moved the functions into a standalone module called ransac.
Some changes were made to the parameters of the methods as a result.
Since I moved the stuff I dont know what to put in the RST for old entrances (ie :meth:NoisyChannels.run_ransac) and so on. This is now in :func:ransac.run_ransac. But we can move everything back to find_noisy_channels if that is a better way.
I also made the channel_correlations an output of the find_bad_by_ransac function for easier debugging, but I dont know if this is the best approach, so suggestions are welcome. It could also be a class that holds the end results (no mutable attributes), or maybe a dictionary.
Merge Checklist
To merge your PR we need to first take the following points into account:
closes #<issue-number>
to automatically close an issue