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

Support pathlib.Path objects for GISDocument and other interfaces #314

Open
mfisher87 opened this issue Jan 11, 2025 · 1 comment
Open
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@mfisher87
Copy link
Member

Thanks @matthewfeickert for calling attention to this!

This should function the same as if we passed str(path) to GISDocument, but we get an error

from jupytergis_lab import GISDocument
from pathlib import Path

path = Path.cwd() / "france_hiking.jGIS"
path.is_file()

doc = GISDocument(path)
doc
File /home/shared/jupytergis/.venv/lib/python3.10/site-packages/jupyter_client/jsonutil.py:192, in json_clean(obj)
    189     return obj.strftime(ISO8601)
    191 # we don't understand it, it's probably an unserializable object
--> 192 raise ValueError("Can't clean for JSON: %r" % obj)

ValueError: Can't clean for JSON: PosixPath('[/home/shared/jupytergis/examples/france_hiking.jGIS](http://localhost:8888/lab/tree/RTC%3Aexamples/examples/france_hiking.jGIS)')
@mfisher87 mfisher87 added the bug Something isn't working label Jan 11, 2025
@matthewfeickert
Copy link
Contributor

Thanks for opening up an Issue on this! It would be a small, but nice, quality of life use improvement. :)

@martinRenou martinRenou added the good first issue Good for newcomers label Jan 13, 2025
@martinRenou martinRenou added this to the 1.0.0 milestone Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants