GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix double filtering in psevents when using -q option by Esteban82 · Pull Request #9086 · GenericMappingTools/gmt

Conversation

@Esteban82

@Esteban82 Esteban82 commented Jul 3, 2026

Copy link
Copy Markdown
Member

Assisted by Qwen 3.7 Plus

Bug:

psevents applies the -q filter, and writes the selected data to temporary files. Afterwards, it calls internal modules to plot the symbols/labels from these temporary files. Because the -q option remained active, the internal modules applied the exact same filter a second time on the already-filtered temporary files.

Solution:

Implemented a local patch to temporarily suspend the -q option before calling the internal modules, and restore it immediately after.

Alternative solution:

I also considered modifying the global gmt_disable_bghio_opts() and gmt_reenable_bghio_opts() functions in gmt_io.c to include -q. However, this will affect dozens of other modules, and I'm not sure if the -q option should also be disabled for them. But maybe it should.

Test with:

I use -qi0:30: to plot a data point every 30.

gmt math -T0/360/1 T SIND = sin_curve.txt
cat << 'EOF' > main.sh
gmt begin
	gmt basemap -R0/360/-1.2/1.6 -JX22c/11.5c -X1c -Y1c -Bxa30g30f -By
	gmt events sin_curve.txt -i0,1,0 -T${MOVIE_FRAME} -Sc0.2c -Gblack -qi0:30:
gmt end
EOF
gmt movie main.sh -Chd -Tsin_curve.txt -Ntest -Ml,png -Zs

test

Closes #8460.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Esteban82
Update psvents.c and fix typo.
8654454
@Esteban82
Esteban82 requested review from a team, joa-quim and seisman July 3, 2026 00:44
@Esteban82 Esteban82 self-assigned this Jul 3, 2026
@Esteban82 Esteban82 added add-changelog Add PR to the changelog AI-assisted All (or most) of the code was written by Artificial Intelligence. labels Jul 3, 2026
joa-quim
joa-quim approved these changes Jul 3, 2026
View reviewed changes

@joa-quim joa-quim left a comment

Copy link
Copy Markdown
Member

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'll be very extra cautious in using other models than Anthropic's (even Sonnet, though Sonnet 5 is a good surprise but previous one was moderately bad). GLM, for example, is ver acclaimed but my experience with it was bad. Have no experience with OpenAI top models though.
This fix seams simple so it should not harm.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Esteban82

Esteban82 commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

I agree. I will ask Sonnet to review the patch before merging, just to get an additional set of eyes on it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Esteban82 added 2 commits July 3, 2026 15:15
@Esteban82
Merge branch 'master' into fix-8460
0d512e2
@Esteban82
Add Claude's suggestions
15c204d
@Esteban82

Esteban82 commented Jul 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Based on Claude's suggestion:

  • I initialized the values to false or 0.
  • I added the {} when the settings are recovered so the if applies to all three statements instead of only the first one.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Esteban82
Merge branch 'master' into fix-8460
927043e
@Esteban82
Esteban82 merged commit ab6f2f3 into master Jul 5, 2026
9 of 13 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Esteban82
Esteban82 deleted the fix-8460 branch July 5, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@joa-quim joa-quim joa-quim approved these changes
@seisman seisman Awaiting requested review from seisman

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@Esteban82 Esteban82

Labels

add-changelog Add PR to the changelog AI-assisted All (or most) of the code was written by Artificial Intelligence.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Bug. Data get filter twice with psevents -q0:inc:

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Esteban82 @joa-quim
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.