-
Notifications
You must be signed in to change notification settings - Fork 57
Support transient layers #735
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
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
TODO:
|
Integration tests report: appsharing.space |
How would this work in a collaborative scenario? |
The transient layers would be visible for every user opening the |
Thanks for opening this @davidbrochart. You know I am in favor of this! |
That makes sense, thanks for the explanation! |
Hmm I think this PR won't have the desired effect, because most of the time the model is loaded from the YStore (if there are no out-of-band changes), where the layers are present anyway. |
But looking at jupyter-collaboration's code, the model in the YStore is replaced with the model from the file if their contents differ, so I think this PR will indeed have the desired effect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I have some questions/suggestions:
- do we really need to make both the source and layer transient? If the source is transient, it's probably enough (we should automatically consider the layers pointing to that source as transient)
- we should also change the JSON schemas for the sources to include that new transient parameter
- (maybe for later PR) we should add a small icon on the front-end in the layers tree view for transient layers
Description
There are situations where one wants to add a layer to the shared model without saving it to disk (in the
.jGIS
file). These "transient" layers are not meant to exist forever, like a raster layer that would load tiles from a stable origin (e.g. OSM). For instance, they might be computed by a live kernel, and they disappear as soon as the kernel is shut down. A good example of such ephemeral layers can be generated by jupytergis-tiler.This PR adds a "transient" attribute to a layer model, which is
False
by default. When set toTrue
, the layer won't be saved to the.jGIS
file.Checklist
Resolves #XXX
.Failing lint checks can be resolved with:
pre-commit run --all-files
jlpm run lint
📚 Documentation preview: https://jupytergis--735.org.readthedocs.build/en/735/
💡 JupyterLite preview: https://jupytergis--735.org.readthedocs.build/en/735/lite