-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add Coreg.fit_and_apply()
to run everything in one step
#527
Conversation
@@ -25,14 +25,15 @@ class TestRobustFitting: | |||
def test_robust_norder_polynomial_fit(self, pkg_estimator: str) -> None: | |||
|
|||
# Define x vector | |||
x = np.linspace(1, 10, 1000) | |||
x = np.linspace(-50, 50, 10000) |
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.
This is to reduce random errors triggered on Mac sometimes (strange because random_state
is fixed... Couldn't find a logical explanation).
@@ -1351,6 +1351,140 @@ def apply( | |||
else: | |||
return applied_elev, out_transform | |||
|
|||
@overload | |||
def fit_and_apply( |
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.
Simple !
I think 99% of the users will only need to use that function. Maybe we could just add a note in the other functions fit
and apply
that this one should be used in priority. The only reasons I can see to split the two is 1) if making changes to the coregistration or 2) to run the same coregistration to several DEMs. Do you see any other reason?
It would almost make sense to hide the two step functions...
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 added an issue to make sure we update the examples in the doc to encourage using this function: #532
Resolves #513