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

Changing the colors in the annotated html #2766

Open
pharshalp opened this Issue Dec 22, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@pharshalp
Copy link

pharshalp commented Dec 22, 2018

Is there a way to change the annotation colors from shades of yellow to a sequential colormap? say like the "summer" colormap from Matplotlib.

screen shot 2018-12-22 at 2 13 18 am

This might make the annotations easier to look at.

@scoder

This comment has been minimized.

Copy link
Contributor

scoder commented Dec 22, 2018

There currently isn't, but I wouldn't mind adding something like that. It's really just CSS, see Annotate.py.

Personally, I like the yellow, because it has little valuation in it. Something that includes red would suggest risk or danger, for example. But then, it's up to the users how they want to interpret it anyway.

PR welcome.

@robertwb

This comment has been minimized.

Copy link
Contributor

robertwb commented Dec 22, 2018

I think this is a reasonable request as well, but as noted, the particular shade doesn't have a lot of value. Mostly it's useful for seeing where there's unexpected (or more than expected) Python interaction. If you care about performance, not all Python interaction is of equal cost (in fact it varies a huge amount in ways that can't be captured by what this does, which is a simply lexicographic search for strings like "Py_" and "_Pyx" in the generated source).

One improvement that could be done is annotating those interactions guarded by a if (unlikely(...)) clause.

@pharshalp

This comment has been minimized.

Copy link

pharshalp commented Dec 22, 2018

Thanks for your detailed comments and suggestions. I still consider myself a novice user of Cython and my knowledge of C can be described as rudimentary at best :D. I will try to tackle this in a couple of months (If anyone else is interested, please feel free to take it up).

@scoder

This comment has been minimized.

Copy link
Contributor

scoder commented Dec 25, 2018

This doesn't have much to do with C, really. It's more about simple text processing, where the data happens to be generated C code.

@pharshalp

This comment has been minimized.

Copy link

pharshalp commented Dec 28, 2018

After carefully reading and understanding the comments, I think I understand why shades of yellow were chosen in order to not signify precise valuation.

One improvement that could be done is annotating those interactions guarded by a if (unlikely(...)) clause.

This doesn't have much to do with C, really. It's more about simple text processing, where the data happens to be generated C code.

This seems doable. I will give it a try.

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