Skip to content
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

grdsample: Fix the incorrect handling of -Am and -Ap #8667

Merged
merged 2 commits into from
Jan 4, 2025
Merged

Conversation

seisman
Copy link
Member

@seisman seisman commented Jan 4, 2025

See #8645 (comment) for context.

This PR fixes the sample1d -Am|-Ap issue.

@@ -446,7 +446,7 @@ GMT_LOCAL uint64_t gmtvector_fix_up_path_cartesian (struct GMT_CTRL *GMT, double
if (step <= 0.0) step = 1.0; /* Sanity valve; if step not given we set it to 1 */

for (i = 1; i < n; i++) {
if (mode == GMT_STAIRS_Y) { /* First follow x, then y */
if (mode == GMT_STAIRS_X) { /* First follow x, then y */
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if-statement should check mode == GMT_STAIR_X, because at lines 455, the y values are constant and the x values are changing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and with GMT_STAIRS_Y = 1, GMT_STAIRS_X = 2, that matches now all the comments.
As a matter of fact, I met this issue once, but thought I had made a user error.

@seisman seisman requested a review from a team January 4, 2025 13:11
@seisman seisman added the bug Something isn't working label Jan 4, 2025
@seisman seisman added this to the 6.6.0 milestone Jan 4, 2025
Copy link
Contributor

github-actions bot commented Jan 4, 2025

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
modified test/baseline/sample1d/
modified test/baseline/sample1d/sample.ps

Image diff(s)

Added images

Modified images

Path Old New
test/baseline/sample1d/sample.ps

Report last updated at commit 8a57876

@@ -446,7 +446,7 @@ GMT_LOCAL uint64_t gmtvector_fix_up_path_cartesian (struct GMT_CTRL *GMT, double
if (step <= 0.0) step = 1.0; /* Sanity valve; if step not given we set it to 1 */

for (i = 1; i < n; i++) {
if (mode == GMT_STAIRS_Y) { /* First follow x, then y */
if (mode == GMT_STAIRS_X) { /* First follow x, then y */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and with GMT_STAIRS_Y = 1, GMT_STAIRS_X = 2, that matches now all the comments.
As a matter of fact, I met this issue once, but thought I had made a user error.

@remkos remkos merged commit 3be70b8 into master Jan 4, 2025
16 of 19 checks passed
@remkos remkos deleted the grdsample/-A branch January 4, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants