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

taup: fix colors in ray path plots #2478

Open
wants to merge 2 commits into
base: master
from

Conversation

@megies
Copy link
Member

commented Oct 9, 2019

What does this PR do?

Fix colors in ray path plots and properly cycle through our fixed colors. Plots are gonna change colors, so might need updating image test, I guess..

Why was it initiated? Any relevant Issues?

Fixes #2470

PR Checklist

  • Correct base branch selected? master for new features, maintenance_... for bug fixes
  • This PR is not directly related to an existing issue (which has no PR yet).
  • If the PR is making changes to documentation, docs pages can be built automatically.
    Just remove the space in the following string after the + sign: "+ DOCS"
  • If any network modules should be tested for the PR, add them as a comma separated list
    (e.g. clients.fdsn,clients.arclink) after the colon in the following magic string: "+TESTS:"
    (you can also add "ALL" to just simply run all tests across all modules)
  • All tests still pass.
  • Any new features or fixed regressions are be covered via new tests.
  • Any new or changed features have are fully documented.
  • Significant changes have been added to CHANGELOG.txt .
  • First time contributors have added your name to CONTRIBUTORS.txt .

+DOCS

properly cycle through our fixed colors
@megies megies added this to the 1.2.0 milestone Oct 9, 2019
@megies megies requested a review from QuLogic Oct 9, 2019
@megies

This comment has been minimized.

Copy link
Member Author

commented Oct 9, 2019

@okling would be nice if you could review this change

@megies megies added this to Waiting for Review in Release 1.2.0 Oct 9, 2019
@@ -346,17 +346,15 @@ def plot_rays(self, phase_list=None, plot_type="spherical",

intp = matplotlib.cbook.simple_linear_interpolation
radius = self.model.radius_of_planet
phase_names_encountered = set([ray.name for ray in arrivals])

This comment has been minimized.

Copy link
@QuLogic

QuLogic Oct 10, 2019

Member

Can use a set literal.

Suggested change
phase_names_encountered = set([ray.name for ray in arrivals])
phase_names_encountered = {ray.name for ray in arrivals}
@@ -346,17 +346,15 @@ def plot_rays(self, phase_list=None, plot_type="spherical",

intp = matplotlib.cbook.simple_linear_interpolation
radius = self.model.radius_of_planet
phase_names_encountered = set([ray.name for ray in arrivals])
colors = {name: COLORS[i % len(COLORS)]
for i, name in enumerate(phase_names_encountered)}

This comment has been minimized.

Copy link
@QuLogic

QuLogic Oct 10, 2019

Member

This probably won't be sorted, so it might not be consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Release 1.2.0
Waiting for Review
2 participants
You can’t perform that action at this time.