Closed PaulHax closed 11 months ago
Nice! The synchronous wrapping is added with the @fetch_value
decorator, and you'll need to make make anything awaiting a network request async:
@property
@fetch_value
async def vmin(self):
range = await self.get_image_color_range()
return range[0]
@vmin.setter
@fetch_value
async def vmin(self, vmin):
range = await self.get_image_color_range()
range[0] = value
self.set_image_color_range(range)
And just a reminder that if you're providing an example we need to resolve anything requiring a network request in the next cell (for now at least):
viewer.vmin = 10
vmin = viewer.vmin
vmin
I don't know how to wrap get/set of color range with matplotlib like vmin and vmax properties. How to do synchronous wrapping of async Viewer methods?
Goal is something like adding this to Viewer class