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

ENH: add support for passing field keys for colors and linewidth in streamline plot annotations #4455

Merged
merged 1 commit into from
Jun 10, 2023

Conversation

neutrinoceros
Copy link
Member

@neutrinoceros neutrinoceros commented May 26, 2023

PR Summary

Closes #4454, incidentally fix a couple small issues with StreamlineCallback's implementation.

demo:

import yt

ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
p = yt.ProjectionPlot(ds, "z", ("gas", "density"))
p.annotate_streamlines(
    ("gas", "velocity_x"),
    ("gas", "velocity_y"),
    linewidth=("gas", "velocity_z"),
    linewidth_upscaling=3,
    color=("gas", "velocity_magnitude"),
    cmap="turbo",
)
p.zoom(20)
p.save("/tmp/")

galaxy0030_Projection_z_density

PR Checklist

  • write error and deprecation messages
  • extra validation of input types (in particular, check consistency with MPL)
  • New features are documented, with docstrings and narrative docs
  • Adds a test for any bugs fixed. Adds tests for new features.

@neutrinoceros neutrinoceros added enhancement Making something better viz: 2D labels May 26, 2023
@neutrinoceros neutrinoceros marked this pull request as draft May 26, 2023 14:28
@neutrinoceros neutrinoceros force-pushed the streamlines_extra_arrays branch 3 times, most recently from e1f69a5 to 6ed6529 Compare May 26, 2023 15:37
@neutrinoceros neutrinoceros force-pushed the streamlines_extra_arrays branch from 6ed6529 to 4786a22 Compare May 26, 2023 18:52
Copy link
Member

@matthewturk matthewturk left a comment

Choose a reason for hiding this comment

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

like it!

yt/visualization/plot_modifications.py Outdated Show resolved Hide resolved
yt/visualization/plot_modifications.py Show resolved Hide resolved
@neutrinoceros neutrinoceros force-pushed the streamlines_extra_arrays branch 5 times, most recently from e0bf5fc to 217e0cf Compare May 27, 2023 12:09
@neutrinoceros neutrinoceros added the deprecation deprecate features or remove deprecated ones label May 27, 2023
@neutrinoceros neutrinoceros force-pushed the streamlines_extra_arrays branch 2 times, most recently from c571955 to 6d899b5 Compare May 27, 2023 12:23
@neutrinoceros neutrinoceros added this to the 4.3.0 milestone May 27, 2023
@neutrinoceros neutrinoceros force-pushed the streamlines_extra_arrays branch from 6d899b5 to ef85dde Compare May 27, 2023 13:53
@neutrinoceros neutrinoceros marked this pull request as ready for review May 27, 2023 13:54
@neutrinoceros neutrinoceros force-pushed the streamlines_extra_arrays branch from ef85dde to 2424f9c Compare May 28, 2023 09:16
@neutrinoceros neutrinoceros changed the title ENH: add support for passing fields keys for colors and linewidth in streamline plot annotations ENH: add support for passing field keys for colors and linewidth in streamline plot annotations May 28, 2023
@neutrinoceros neutrinoceros added the api-consistency naming conventions, code deduplication, informative error messages, code smells... label May 28, 2023
@matthewturk matthewturk enabled auto-merge June 9, 2023 17:05
matthewturk
matthewturk previously approved these changes Jun 9, 2023
@neutrinoceros
Copy link
Member Author

had an insignificant conflict, fixed it

@neutrinoceros
Copy link
Member Author

@matthewturk if you're still up for it, this is now ready to go

Copy link
Member

@matthewturk matthewturk left a comment

Choose a reason for hiding this comment

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

I actually thought I'd already approved!

@matthewturk matthewturk merged commit cfdf7ed into yt-project:main Jun 10, 2023
@neutrinoceros
Copy link
Member Author

you did, I just 'dismissed' your approval when I fixed a conflict !

@neutrinoceros neutrinoceros deleted the streamlines_extra_arrays branch June 10, 2023 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-consistency naming conventions, code deduplication, informative error messages, code smells... deprecation deprecate features or remove deprecated ones enhancement Making something better viz: 2D
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: support using a yt field for streamline line width and color
2 participants