-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactor enhancement application #3
Refactor enhancement application #3
Conversation
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.
Thanks for putting this together. I think it is a step in the right direction. However, I don't see this as cleaner code even if each of the functions has fewer arguments. You've now used partial
in a lot of places and it makes the code, especially for newcomers, pretty difficult to read. I realize most of that is due to the complexity of the argument binding that was being taken advantage of before but I wouldn't say this is overall cleaner.
satpy/enhancements/__init__.py
Outdated
else: | ||
band_data_arr = func(band_data_arr, **extra_kwargs) | ||
return band_data_arr | ||
def on_separate_bands(func): |
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.
Does the order of this decorator with the other dask decorators matter? If so, can it be documented here.
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.
Yes it does, since on_dask_array
for example make the decorated function act on a dask array as the docstring says.
I could write in the on_separate_bands
docstring that it acts on DataArrays, ok?
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.
That would help, but you could even go as far as saying "If this is used in combination with on_dask_array...., then it should be used after those decorators. For example:" and then show the combination of the two decorators. Just thinking about the emails I'm going to have to answer when someone gets it wrong.
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.
done
I agree that the usage of |
Awesome! Thank you! |
I notice linting is failing, I think this branch (mine and now yours) need to be merged with upstream main. |
I can do that |
Merging main did add a bunch of commits. Maybe I should revert and let you do that in your PR? |
@mraspaud Yeah I'm ok with that. |
Pull Request Test Coverage Report for Build 2804455664
💛 - Coveralls |
def51bb
to
d82d36d
Compare
Done. |
This is pretty nifty 😉 Let's merge it and see what happens. Thanks for rewriting all of this. It really feels like it puts the "control" back into the individual enhancement functions. |
AUTHORS.md
if not there already