Skip to content

Misc fixes : Synthetic plotting, windowing and padding arguments fixes, forward example.#346

Merged
thurinj merged 6 commits into
masterfrom
Misc_fixes
Apr 27, 2026
Merged

Misc fixes : Synthetic plotting, windowing and padding arguments fixes, forward example.#346
thurinj merged 6 commits into
masterfrom
Misc_fixes

Conversation

@thurinj
Copy link
Copy Markdown
Member

@thurinj thurinj commented Apr 22, 2026

I am combing through some of the open issues to try to address them.

Addressing issues:

This small PR has no major theme be covers issues:

image this one being generated with following arguments:
beachball_color='red', dat_kwargs={'color': 'gray'}, syn_kwargs={'color': 'blue', 'linestyle': '--'}

This particular fix took some cues from PR #331 that has never been finalized.

Other changes:

I also took the liberty to update the way we discover entry point by replacing use pkg_resources which was locking us into setuptools<82, the code now use importlib.metadata's entry_points. This does not modify behaviors, but will remove deprecation warning when using setup.py:

UserWarning: pkg_resources is deprecated as an API. 
See https://setuptools.pypa.io/en/latest/pkg_resources.html. 
The pkg_resources package is slated for removal as early as 2025-11-30. 
Refrain from using this package or pin to Setuptools<81.

I also added a new dedicated example for the forward evaluation to address the following issue:

It follow more or less the example script that was provided by @rmodrak in the issue's discussion, with its associated code generator and documentation entry.

thurinj added 6 commits April 21, 2026 11:46
Use `pkg_resources.iter_entry_points` with `importlib.metadata.entry_points` to avoid deprecation warnings and future issues.
…rgs.

Added configurable colors for synthetic traces and moment-tensor beachball figures and pass general savefig kwargs through.

- waveforms: introduce syn_color (default 'red') on plot_waveforms1/2/3, plot_data_greens*, _plot_stream and _plot_trace so synthetic traces use the provided color instead of hard-coded red.
- header: add color parameter to MomentTensorFigureBlock, propagate through build_moment_tensor_header and create_moment_tensor_header, and pass color when rendering beachballs (both inline and via temp file).
- beachball: allow extra keyword args to be forwarded to matplotlib's savefig in _plot_beachball_matplotlib.
Also minor changes in DirectEvaluation.py to conform to the generated file.
…idation.

Uses `parameters.get()` instead of the old `getattr` implementation fixes the issue (since parameters is a Python dict). Fixes issue #334

Also changed handling of assertion for time_shift_max and min. Checking local variable before assignment.
This propagate all the changes to plotting modes 1, 2 and 3.

Modified color arguments for the beachball plot from "color" to "beachabll_color".
Example usage would be: `beachball_color='red', dat_kwargs={'color': 'gray'}, syn_kwargs={'color': 'blue', 'linestyle': '--'}`
@thurinj
Copy link
Copy Markdown
Member Author

thurinj commented Apr 22, 2026

If merged, will close and cancel pending PR #331 which would become redundant.

Staged merge for the end of the week if no comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant