Open weiji14 opened 4 years ago
This issue was mentioned in https://github.com/GenericMappingTools/pygmt/issues/1120, but it is not clear to me how this would be changed in a backwards compatible way. Does anyone have ideas for how to follow the deprecation policy here? Or should it be considered a bug where the deprecation policy may not apply?
This issue was mentioned in #1120, but it is not clear to me how this would be changed in a backwards compatible way. Does anyone have ideas for how to follow the deprecation policy here? Or should it be considered a bug where the deprecation policy may not apply?
My guess for why this was brought up is that if the default option is return a dictionary, this will break functions that expect a string returned. Truth be told, I think the people most affected by this deprecation would be pygmt maintainers because of the number of tests that use grdinfo
to check the answers.
My thought for the implementation of this is a parameter along the lines of info_type=dictionary
that would return a dictionary by default, but passing string
instead would get the original format returned.
Just wanted to surface a point I made in https://github.com/GenericMappingTools/pygmt/pull/1418#discussion_r700746488. Please try and refrain from using grdinfo
while writing unit tests for new wrapper functions (otherwise we'll have lots of code to change if the pygmt.grdinfo
implementation changes). Instead, use numpy.testing.assert_allclose
or xarray.testing.assert_allclose
(or similar) to test the output data array directly. E.g.
Try to keep this in mind when reviewing PRs or wrapping new modules. We should also maybe start migrating tests using grdinfo
to check output values to use npt.assert_allclose
instead before refactoring pygmt.grdinfo
itself.
I would be pretty excited to see this in the next release, so I will get started on refactoring the tests. Here is a list of modules in pygmt/tests/
that contain grdinfo
. If anyone wants to help, please edit this comment to add your username next to the module or post a comment below to avoid redundant work.
I would be pretty excited to see this in the next release, so I will get started on refactoring the tests. Here is a list of modules in
pygmt/tests/
that containgrdinfo
. If anyone wants to help, please edit this comment to add your username next to the module or post a comment below to avoid redundant work.
Thanks Meghan for making the list! I'm just wondering though, since the SRTM+v2.3 grids will be coming soon-ish (https://github.com/GenericMappingTools/gmtserver-admin/issues/105), if we should refactor the grd* tests now, or wait until the new @earth_relief
grids are available. Just want to try to cut down on the amount of maintenance work we need to do :slightly_smiling_face:
Oh, and by next release, do you mean PyGMT v0.5.0 or v0.6.0?
I would be pretty excited to see this in the next release, so I will get started on refactoring the tests. Here is a list of modules in
pygmt/tests/
that containgrdinfo
. If anyone wants to help, please edit this comment to add your username next to the module or post a comment below to avoid redundant work.Thanks Meghan for making the list! I'm just wondering though, since the SRTM+v2.3 grids will be coming soon-ish (GenericMappingTools/gmtserver-admin#105), if we should refactor the grd* tests now, or wait until the new
@earth_relief
grids are available. Just want to try to cut down on the amount of maintenance work we need to do 🙂Oh, and by next release, do you mean PyGMT v0.5.0 or v0.6.0?
I was (probably naively) hoping for v0.5.0. But since we have a bit of a backlog in PRs and not much time until the release, we could hold off until v0.6.0 and after the remaking of earth_relief grids.
Description of the desired feature
Certain
pygmt.grdinfo
return values can be in an array form rather than a string. This would be a good first issue to take up, and would be similar to #575 but for grids instead of tables.Originally posted by @liamtoney in https://github.com/GenericMappingTools/pygmt/issues/147#issuecomment-450018956
Are you willing to help implement and maintain this feature? Yes/No