Skip to content
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

Merged
merged 7 commits into from
May 23, 2024

Conversation

rhugonnet
Copy link
Contributor

Resolves #513

@@ -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)
Copy link
Contributor Author

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).

@rhugonnet rhugonnet merged commit b76140f into GlacioHack:main May 23, 2024
10 checks passed
@rhugonnet rhugonnet deleted the add_fit_and_apply branch May 23, 2024 22:02
@@ -1351,6 +1351,140 @@ def apply(
else:
return applied_elev, out_transform

@overload
def fit_and_apply(
Copy link
Member

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...

Copy link
Member

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

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.

Add function Coreg.run() or Coreg.fit_and_apply() to run both fit() and apply() steps simultaneously
2 participants