-
Notifications
You must be signed in to change notification settings - Fork 42
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
Allow Raster
s as inputs for Coreg.fit()
and Coreg.apply()
#175
Allow Raster
s as inputs for Coreg.fit()
and Coreg.apply()
#175
Conversation
@@ -379,7 +380,7 @@ def test_z_scale_corr(self): | |||
zcorr.fit(self.ref.data, scaled_dem) | |||
|
|||
# Apply the correction | |||
unscaled_dem = zcorr.apply(scaled_dem, None) | |||
unscaled_dem = zcorr.apply(scaled_dem, self.ref.transform) |
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'm not sure I get why those needed changing?
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.
Raster.apply()
now raises an error if an array is provided but no transform. This makes the tools perfectly consistent (there was no previous mechanism to validate that a transform was given, so the error messages were very confusing). In this particular case, it's a bit redundant, but I think that's an okay sacrifice for consistency! If you and @adehecq disagree, I'm sure we can find another way.
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.
Sounds ok to me
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.
Tip top!
Birds and heat have a much more productively-positive effect on you than me 😆
Actually, a big question raised by this: Should we aim to have xdem working with np.ndarrays and Raster objects interchangeably? If yes, what is left to do? (I think that, @erikmannerfelt, you have the best viewpoint on all this!) |
Since, Long story short, the only way to validate how interchangeable they are is to include more tests!! |
…ster-classes Added warnings for overridden 'transform' argument. Improved argument validation for 'Coreg'
I think I've fixed all of @rhugonnet 's comments. Any other thoughts, @rhugonnet and @adehecq ? |
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.
All good for me!
Maybe we should open an issue on the "interchangeable" discussion?
It would be good if we could say "All xdem functions accept interchangeably np.ndarray
and Raster
subclass objects"
Already done in #178 ! Thanks, @rhugonnet ! |
Fantastic ! |
Solves #174.
See the issue for the new syntax!