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

Region-related test failures #16

Open
astrofrog opened this issue Mar 1, 2024 · 2 comments
Open

Region-related test failures #16

astrofrog opened this issue Mar 1, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@astrofrog
Copy link
Member

@jfoster17 - I'm seeing two test failures in the CI related to the region stuff:

_____________________ TestRegionScatterViewer.test_subset _____________________

self = <glue_qt.viewers.image.tests.test_display_region_data.TestRegionScatterViewer object at 0x0000020897112200>

    def test_subset(self):
        self.viewer.add_data(self.data_2d)
    
        self.viewer.add_data(self.region_data)
        link1 = LinkSame(self.region_data.center_x_id, self.data_2d.pixel_component_ids[0])
        link2 = LinkSame(self.region_data.center_y_id, self.data_2d.pixel_component_ids[1])
    
        self.data_collection.add_link(link1)
        self.data_collection.add_link(link2)
    
        self.data_collection.new_subset_group(subset_state=self.region_data.center_x_id > 20)
    
        process_events()
    
        assert self.viewer.layers[0].enabled  # image
        assert self.viewer.layers[1].enabled  # scatter
>       assert self.viewer.layers[2].enabled  # image subset
E       assert False
E        +  where False = ScatterRegionLayerArtist for Subset 1.enabled

..\..\.tox\py310-test-pyqt63\Lib\site-packages\glue_qt\viewers\image\tests\test_display_region_data.py:158: AssertionError
______________________ TestWCSRegionDisplay.test_basics _______________________

self = <glue_qt.viewers.image.tests.test_display_region_data.TestWCSRegionDisplay object at 0x0000020897111C90>

    def test_basics(self):
        self.viewer.add_data(self.image1)
    
        link1 = LinkSame(self.region_data.center_x_id, self.image1.world_component_ids[0])
        link2 = LinkSame(self.region_data.center_y_id, self.image1.world_component_ids[1])
    
        self.data_collection.add_link(link1)
        self.data_collection.add_link(link2)
    
        self.viewer.add_data(self.region_data)
    
        self.viewer.state._display_world
        assert len(self.viewer.state.layers) == 2
        assert self.viewer.layers[0].enabled
>       assert self.viewer.layers[1].enabled
E       assert False
E        +  where False = ScatterRegionLayerArtist for My Regions.enabled

would you be able to take a look? Thanks!

@jfoster17
Copy link
Member

Yeah, okay, I'll take a look.

@jfoster17
Copy link
Member

I haven't forgotten about this (though I have had little time to work on it). The problem was introduced in glue-core in my PR (glue-viz/glue#2465), but while attempting to fix that I discovered another (untested) problem with displaying regions on an image with WCS. I'm trying to come up with a less fragile solution for converting the regions...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants