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

Adjustable style sources #1145

Closed
manthey opened this issue May 3, 2023 · 1 comment · Fixed by #1296
Closed

Adjustable style sources #1145

manthey opened this issue May 3, 2023 · 1 comment · Fixed by #1296
Assignees

Comments

@manthey
Copy link
Member

manthey commented May 3, 2023

Currently, when we open a source, the style is fixed on open. This has virtues for caching and parallel threads serving tiles with the same style. However, in some environments (e.g., Jupyter, Trame), there is a single user and no benefit is gained from this caching. In these cases, it would be nice is style was a setter. However, just calling _setStyle will cause issues with the cache.

One approach to resolve this is to add a tile source creation option that would bypass the cache. It would use create a new class instance as is done with a cache miss, duplicating the unstyled class, but would not place the result into the cache. This would guarantee that changing the style would not alter class instances held by other threads. We could add adjustableStyle as parameter, that, if set, would do this cache bypass. It would also set flag on the class to allow use of a style setter. This setter could throw an exception if the style was not adjustable explaining how to open the class so that it is adjustable.

Further, if the adjustableStyle could have a default value from the config, then for examples in Jupyter or Trame we could set this config value and the casual user could then adjust styles without creating new source instances or remembering to pass the appropriate flag.

manthey added a commit that referenced this issue Sep 13, 2023
When opening a tile source, pass `noCache=True`.  In this mode, the tile
source can directly have its style modified (e.g., `source.style = <new
value>`).  This is also used when importing images into girder to avoid
flushing the cache of tile sources that are in active use.

This closes #1294.

This closes #1145.

There is a config value `cache_sources`, that, if False, makes `noCache`
default to False.

This closes #1206.
@manthey
Copy link
Member Author

manthey commented Sep 13, 2023

With #1296, this is now accomplished by opening a tile source with noCache=True.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant