Wrap fitcircle - #1550
Conversation
|
I don't think I'm able to come up with a good way to format the output; I'm going to close this PR for the time being. If anyone has a solution please feel free to reopen it! |
|
I'm reopening the issue so it's more visible to people who'd like to help. |
| """ | ||
| Load the sample data from the @sat_03 remote file. | ||
| """ | ||
| fname = which("@sat_03.txt", download="c") |
There was a problem hiding this comment.
This @sat_03.txt file will need to be added to the cache list at https://github.com/GenericMappingTools/pygmt/blob/v0.19.0/pygmt/helpers/caching.py
| return lib.virtualfile_to_dataset( | ||
| vfname=vouttbl, | ||
| output_type=output_type, | ||
| column_names=["longitude", "latitude", "method"], |
There was a problem hiding this comment.
These output columns might change depending on whether -L/norm=1/2 or -L/norm=3/True ? Could we do something like:
column_names=["longitude", "latitude", "method"] if kwargs.get("L") in {1, 2} else ["longitude_l1", "latitude_l1", "longitude_l2", "latitude_l2"],or whatever column names make sense for norm=3.
Alternatively, we can just disable the ability to output to pandas format for norm=3/norm=True if it gets too complicated.
There was a problem hiding this comment.
Decided to disable the pandas format for norm=3/True, as that seemed more straightforward.
| S="small_circle", | ||
| ) | ||
| def fitcircle( | ||
| data: PathLike | TableLike, |
There was a problem hiding this comment.
Should support parameters x/y, too.
| $table_classes. | ||
| $output_type | ||
| $outfile | ||
| norm : int or bool |
There was a problem hiding this comment.
1, 2, 3 are not readable arguments. GMT recommends absolutes/squares/both instead.
As for the parameter, GMT supports norm and solution, while GMT.jl uses norm (https://www.generic-mapping-tools.org/GMTjl_doc/documentation/modules/fitcircle.html).
|
@willschlitzer Could you please an issue for tracking this module, using the template at https://github.com/GenericMappingTools/pygmt/blob/main/.github/ISSUE_TEMPLATE/3-module_request.md |
This pull request wraps the module
fitcircle.Preview at https://pygmt-dev--1550.org.readthedocs.build/en/1550/api/generated/pygmt.fitcircle.html
Reminders
make formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.Slash Commands
You can write slash commands (
/command) in the first line of a comment to performspecific operations. Supported slash commands are:
/format: automatically format and lint the code/test-gmt-dev: run full tests on the latest GMT development version