Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Figure.meca: Fix beachball offsetting with dict/pandas inputs #2202
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
Figure.meca: Fix beachball offsetting with dict/pandas inputs #2202
Changes from all commits
2b167a9
74072c7
4208308
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Hmm, I was re-reading #1129 again and was gonna say, it's a little surprising that a 2D numpy array passed in with
plot_longitude
andplot_latitude
columns (stored in float) works (since thetest_meca_spec_2d_array
unit test is passing fine). I guess the GMT C code is smart enough with handling data fromvirtualfile_from_matrix
vsvirtualfile_from_vectors
.Nothing to do here, just a random comment.
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's a good point. I think it shouldn't work. The
test_meca_spec_2d_array
test passes because bothplot_longitude
andplot_latitude
are 0 (which means no offsetting due to backward compatibility issues).I'll find some time and see if offsetting using a 2D numpy array works, and if not, will try to find a fix.
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.
Ah yes, so we should probably update the test to use a non-zero offset. I actually wanted to parse all the user inputs into a
pandas.DataFrame
(which can hold different dtypes like int, str, float) in #1613 (comment) which meant everything goes throughvirtualfile_from_vectors
, but that was superseded by #1784 that maintained two separate paths going viavirtualfile_from_vectors
fordict
/pd.DataFrame
orvirtualfile_from_matrix
for 2Dnp.ndarray
inputs. Just as an idea 🙂If this ends up getting too complicated, we can merge in this PR first to fix offsets for dict/pandas inputs, and have a separate one to handle offsets for 2D numpy array inputs.
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.
I prefer to work on it in a separate PR.