WorldWideTelescope / pywwt

Python interface to WorldWide Telescope :milky_way:
https://pywwt.readthedocs.io
BSD 3-Clause "New" or "Revised" License
51 stars 15 forks source link

Allow toggling whether a table layer is selectable #334

Closed Carifio24 closed 2 years ago

Carifio24 commented 2 years ago

This PR adds the ability to select whether or not a table layer is selectable - basically, exposing the functionality from https://github.com/WorldWideTelescope/wwt-webgl-engine/pull/183. As in that PR, allowing client applications to make layers non-selectable should help performance when there are a lot of points, with glue-wwt being one example of an application that can benefit from having layers be non-selectable most of the time. To make this possible, I've added a boolean selectable traitlet to the table layer class. Since selectability is a property at the research app level, rather than of the engine layer, I've set wwt=None in the traitlet metadata.

codecov[bot] commented 2 years ago

Codecov Report

Merging #334 (90b814e) into master (33fce4a) will decrease coverage by 0.01%. The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master     #334      +/-   ##
==========================================
- Coverage   55.47%   55.46%   -0.02%     
==========================================
  Files          25       25              
  Lines        2785     2791       +6     
==========================================
+ Hits         1545     1548       +3     
- Misses       1240     1243       +3     
Impacted Files Coverage Δ
pywwt/layers.py 73.83% <50.00%> (-0.22%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

pkgw commented 2 years ago

Looks like one of the macOS CI builds spuriously timed out, so I've restarted it. It would be nice to get test coverage of this, but seems like it might be hard ... any thoughts about whether/how that can be done?

Carifio24 commented 2 years ago

The only thing I can think of is using some of Qt's mouse functionality to move the pointer to a specific location where we know a source will be, toggling selectability, and seeing if the cursor shape changes. That feels like it'd be very brittle, though.

pkgw commented 2 years ago

Yeah :-/