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 colormap creation #117
Conversation
Started work on refactoring colormap creation. Move some functionality from Satpy to here. Deprecate passing a string containing a CSV to ``Colormap.from_file``, this should now use ``Colormap.from_string`` instead.
Codecov Report
@@ Coverage Diff @@
## main #117 +/- ##
==========================================
+ Coverage 93.16% 93.36% +0.20%
==========================================
Files 11 11
Lines 3509 3619 +110
==========================================
+ Hits 3269 3379 +110
Misses 240 240
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Improve documentation in colormap class and rewrite from_sequence_of_colors in terms of other methods available.
Refactor from_xrda and rename it from_array_with_metadata. This is the method with somewhat funny behaviour that was copied from satpy.composites.ColormapCompositor.build_colormap. It includes some behaviour that I cannot explain, such as cutting off the last value of the colour palette when meanings are not provided. I copied this behaviour as-is from Satpy.
Add a flag to disable the behaviour to remove the last value from the colormap/values.
Fixxing one merge conflict.
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.
Very nice PR, thanks a lot for putting it together.
Moved the test-cmap-from-string test method out of the class and changed it into its own function, because it doesn't read from a file.
Refactoring colormap creation. Move most colormap creation functionality from Satpy to here. Deprecate passing a string containing a CSV to
Colormap.from_file
, this should now useColormap.from_string
instead.There remain some inconsistencies in the API, such as how values are guessed when not explicitly provided, but changing this would affect backward compatibility when coming from Satpy.
This PR also fixes numpy 1.24 compatibility.
git diff origin/master **/*py | flake8 --diff
(remove if you did not edit any Python files)