-
Notifications
You must be signed in to change notification settings - Fork 222
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
Standardize parameter name for table data inputs #1479
Comments
One option to reduce the amount of deprecation notices is to keep two parameters, but with this rule:
This way, we'll only need to do the renaming for |
One complication is that many modules can be plotting or processing (e.g., |
Those types of dual-purpose functions (e.g.
Ok, sounds like we need a vote. So the options are:
Place your vote on this comment. Only one vote per person 😛 |
Can we also set the conventional order for the positional arguments as Here's the current count:
|
Yes, good point. I would say just go with
Debating on whether we should go through a deprecation cycle (2 releases) for the |
Sounds good. If we will make the change for the functions that have |
Just want to confirm that we have reached a consensus that we will use
It's unclear to me how to raise a warning for this case. For users who do |
Yes, I think so.
If the user passes in |
Here are a list of modules that may need to rename
|
It looks like a good solution. I'll work on it. |
I'm rethinking the decorator implemented in #1541. We're changing the parameter order from Thus, actually, we should raise the warning only if For plotting functions, there is always the |
In addition to len(args), we might actually want to check the type or shape of args[0] (for processing) or args[1] (for plotting). For example, in #1546 someone could pass in |
Users can pass |
OK, that was a bad example. An alternate example for plot: |
I've implemented it in 95fa173 as part of PR #1548.
I prefer NOT to check these complicated cases:
|
After #1565 is merged, all functions will use consistent parameter name
I think these exceptions are reasonable and don't need more changes. Thus, we can close the issue after #1565 is merged. Agree? |
Wrapping the triangulate function which does "Delaunay triangulation or Voronoi partitioning and gridding of Cartesian data". Original GMT documentation can be found at https://docs.generic-mapping-tools.org/6.3/triangulate.html. Aliased outgrid (G), spacing (I), projection (J), region (R), verbose (V), registration (r). * Refactor triangulate to use virtualfile_from_data * Refactor triangulate implementation to use pygmt.io.load_dataarray * Alias binary(b), nodata(d), find(e), coltypes(f), header(h), incols(i) * Rename the parameter 'table' to 'data' As per #1479. * Refactor test_triangulate to use Table_5_11_mean.xyz instead of tut_ship * Refactor test_triangulate_with_outgrid to use xr.testing.assert_allclose * Refactor test_triangulate_input_xyz to use pd.testing.assert_frame_equal * Implement regular_grid and delaunay_triples staticmethod for triangulate * Let list inputs to spacing (I) and incols (i) work Use I="sequence" and i="sequence_comma". * Ensure triangulate.delaunay_triples output_type is valid Must be either one of numpy, pandas or file * Autocorrect output_type to 'file' if outfile parameter is set * Allow only str or None inputs to outgrid parameter Xref #1807 * Use gmt get GMT_TRIANGULATE to check whether Watson or Shewchuk is used * State that Shewchuk is the default triangulation algorithm As per GenericMappingTools/gmt#6438 * Actually document the output_type parameter for delaunay_triples Co-authored-by: Will Schlitzer <[email protected]> Co-authored-by: Meghan Jones <[email protected]> Co-authored-by: Dongdong Tian <[email protected]>
Wrapping the triangulate function which does "Delaunay triangulation or Voronoi partitioning and gridding of Cartesian data". Original GMT documentation can be found at https://docs.generic-mapping-tools.org/6.3/triangulate.html. Aliased outgrid (G), spacing (I), projection (J), region (R), verbose (V), registration (r). * Refactor triangulate to use virtualfile_from_data * Refactor triangulate implementation to use pygmt.io.load_dataarray * Alias binary(b), nodata(d), find(e), coltypes(f), header(h), incols(i) * Rename the parameter 'table' to 'data' As per GenericMappingTools#1479. * Refactor test_triangulate to use Table_5_11_mean.xyz instead of tut_ship * Refactor test_triangulate_with_outgrid to use xr.testing.assert_allclose * Refactor test_triangulate_input_xyz to use pd.testing.assert_frame_equal * Implement regular_grid and delaunay_triples staticmethod for triangulate * Let list inputs to spacing (I) and incols (i) work Use I="sequence" and i="sequence_comma". * Ensure triangulate.delaunay_triples output_type is valid Must be either one of numpy, pandas or file * Autocorrect output_type to 'file' if outfile parameter is set * Allow only str or None inputs to outgrid parameter Xref GenericMappingTools#1807 * Use gmt get GMT_TRIANGULATE to check whether Watson or Shewchuk is used * State that Shewchuk is the default triangulation algorithm As per GenericMappingTools/gmt#6438 * Actually document the output_type parameter for delaunay_triples Co-authored-by: Will Schlitzer <[email protected]> Co-authored-by: Meghan Jones <[email protected]> Co-authored-by: Dongdong Tian <[email protected]>
Description of the desired feature
Originally posted by @meghanrjones in #1441 (comment)
Are you willing to help implement and maintain this feature? Discuss first
The text was updated successfully, but these errors were encountered: