Open felixdellner opened 3 weeks ago
📢 Nice one! Your first issue! Thanks for telling us how to improve geovista
📢
Hey @felixdellner!
Great to hear from you, and thanks for raising this issue :+1:
Thanks also for including the scooby
report, which is really helpful.
I'm guessing that you're using a development installation of geovista
given the version is 0.5.0.dev464
and you also mentioned that the example is working outside vscode
.
I suspect this might be an issue with the lazy-loader package (and vscode
), which we use within geovista
to support lazy imports.
Would it be possible for you to set the EAGER_IMPORT
environment variable to disable lazy imports to see if this is indeed the root of the problem with vscode
, and let me know the outcome?
For reference see here and here.
Also, a quick fix alternative for the example in question might be to explicitly import geovista.pantry
as follows:
import geovista as gv
import geovista.pantry # <------ force the import
from geovista.pantry.data import nemo_orca2_gradient
from geovista.pantry.meshes import ZLEVEL_SCALE_CLOUD
import geovista.theme
Could you also give that a try please?
Thanks :+1:
@all-contributors please add @felixdellner for bug and ideas
@bjlittle
I've put up a pull request to add @felixdellner! :tada:
@bjlittle Huge thanks for the quick reply Bill and the great library! It works just fine on my work Mac and in a separate Notebook. I tried both approaches, and now it compiles! :)
However, now I get a blank frame.
(Assuming you meant os.environ["EAGER_IMPORT"] = "disable"
for a way around the lazy loading)
@felixdellner My pleasure!
Thanks for getting back 👍
Okay, this is really useful to know. I might document this for the community as a known issue within vscode
.
There may be a way to resolve this without disabling lazy importing, but that'll require a wee bit of investigation on my behalf 👍
Yup, just setting the environment variable to anything triggers disabling the lazy loader. Nice one.
So are you happy for now with this work around?
If so, then please close this issue and I'll spin up another separate one to follow-up with some investigations.
Otherwise, happy to keep this issue open and assist further, if I can.
Thanks 👍
However, now I get a blank frame.
What do you mean? Can you explain further or show me a screenshot?
However, now I get a blank frame.
What do you mean? Can you explain further or show me a screenshot?
Sure thing, now it looks like this:
I'll close this issue (while I'd say the problem remains, I agree that this particular issue might not be the best place to deal with it.)
@felixdellner I've done a bit more digging into this, and I've decided to re-open this issue as I believe that I've not fully implemented lazy loading correctly within geovista
, given my rediscovery of https://scientific-python.org/specs/spec-0001/#type-checkers.
I'd like to attempt to re-address this, if you've still got the time and motivation to kick the tyres ?
🐛 Bug Report
ModuleNotFoundError: No module named 'geovista.pantry.data'; 'geovista.pantry' is not a package
How to Reproduce
Trying to run the examples provided here gives the above error, specifically this line raises the error
from geovista.pantry.data import nemo_orca2_gradient
Expected Behaviour
A working example :)
Environment
Tried
or
Additional Context
This only happens in Visual Studio Code - in a separate Jupyter Notebook it runs as expected (where I however can not get VTK to run, but I think this might be my own fault, otherwise I'll submit another issue!)