Shapes data does not conform to LayerDataProtocol
See original GitHub issue🐛 Bug
Since Shapes
is a Layer
, its data
should fulfill LayerDataProtocol
. However, (some) internal ways of populating this don’t preserve the required properties
To Reproduce
Steps to reproduce the behavior:
Run the test:
def test_data_protocol():
shp = Shapes()
# Add 2-D ellipse
data = np.ones((2, 2))
data[:, 0] = [20, 20] # Center
data[:, 1] = [10, 10] # Axes
shp.add_ellipses(data)
# Check for properties
assert hasattr(shp.data, 'dtype')
assert hasattr(shp.data, 'shape')
Expected behavior
I would expect that shp.data
would have the shape
and dtype
properties.
Environment
- Please copy and paste the information at napari info option in help menubar here:
napari: 0.4.13
Platform: Linux-5.13.0-28-generic-x86_64-with-glibc2.31
System: Ubuntu 20.04.3 LTS
Python: 3.9.10 | packaged by conda-forge | (main, Feb 1 2022, 21:24:11) [GCC 9.4.0]
Qt: 5.12.9
PyQt5: 5.12.3
NumPy: 1.20.3
SciPy: 1.7.3
Dask: 2022.01.1
VisPy: 0.9.4
OpenGL:
- GL version: 4.6 (Compatibility Profile) Mesa 21.0.3
- MAX_TEXTURE_SIZE: 16384
Screens:
- screen 1: resolution 2560x1440, scale 1.0
- screen 2: resolution 1920x1080, scale 1.0
Plugins:
- Labeling: 0.1.dev9+g4bf5a30
- console: 0.0.4
- scikit-image: 0.4.13
- svg: 0.1.5
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Tensorflow target shape not matching - how to properly format ...
I'm trying to build NLP classifier, data consists of 2 columns, ... but when running the model.fit() method shapes do not match.
Read more >The OSI Model – The Layers That Shape Connections
The OSI model is a framework to help engineers develop Internet protocols. Get all the insights of the different layers and understand how ......
Read more >MGLShapeSource Class Reference - Mapbox docs
MGLShapeSource is a map content source that supplies vector shapes to be shown on the map. The shapes may be instances of MGLShape...
Read more >OSI Model: The 7 Layers of Network Architecture
The OSI Model is a 7-layer framework for network architecture that doesn't have to be complicated. We break it all down for you...
Read more >Quizzes Flashcards - Quizlet
Forward and routing are not in the transport layer they are in the network ... they need to signal the end of sending...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s a great point, yeah. For that reason, we probably shouldn’t do this.
cc @sofroniewn