-
Notifications
You must be signed in to change notification settings - Fork 2
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
save json #92
Comments
Hi @TomasPetro , glad you're interested! I can look in more detail tomorrow, but can you make sure pip is up to date ( |
Thanks for answer. Yes, I checked it yesterday and it was up to date and my python version is 3.9.9 so a bit older. I was looking for requirmens on it in project and did not found any. |
The tests run with 3.8-3.10 right now, so 3.9.9 should be fine. Are you using a virtual environment (conda, pyenev-virtualenv) or system level python? I don't use windows myself, so there may be something funny going on with the editable install with windows that I haven't caught (though the GitHub tests do use windows). Are you able to install the pypi version (not from the local copy of the source)? |
One other quick thing to try: use |
OH, actually, is there more to the error message that was cut off in your screenshot? Looks like there might be. that'd be helpful to see. And, try updating |
Installing on a virtual machine would be worth a try - I develop on Mac and Ububtu machines, and haven't had this problem. So it'd be good to confirm if it's just happening on windows for you. That said I see no reason why it shouldn't work for you... Can you send over the contents of Sorry this has been so annoying. Hopefully we get it sorted quickly (though I wont be online ievr the weekend, I'll set aside time on Monday to help more with this). |
Currently working on Ubuntu. I will answer next day on previous messages. |
So, finnaly I installed ubuntu and also that command When I compared pip on ubuntu and windows, versions were same. So it did not solve issues on windows. Should i compare that pip list and check if there are any differences ? I´ve one more question. How to run this plugin in developer mode? You know to see changes and so on. |
Great! That's a relief. What version of python are you running on Ubuntu? And yes, comparing pip list would be useful if you don't mind. As for development mode -- I don't actually think there is a great way. Because of the way napari loads plugins, you have to restart the python kernel and napari between code changes (I would love to be wrong about this...). So I find it easiest to start napari from a jupyter notebook. That way after you make code changes you can just hit the restart kernel -> run all cells to restart napari. It still takes a bit of extra time but it cuts down on clicking. And later today I'll send along a few quick notes on where to look in the code for making this change (I'm on my phone at the moment)-- the saving should be very easy as the widget validates entries against the same pydantic model as the json loader, so should be pretty quick to be able to save off a json after that validation step. Loading might take a bit more thought. |
Sorry for the delay, @TomasPetro , but here's a quick overview of how I'd recommend that you get started... if you're new to ytIn the docs I recommend doing a full installation
that should get you the dependencies needed to follow the yt-napari notebook examples. To actually load in data you'll need to download sample data. The example notebooks uses data from the widget overviewBoth the So I think what you'd need to do is refactor each |
Thanks for info. I plan to work on it today, I hope I won't have to reinstall linux and everything with it again |
you could also try using conda with windows -- there's likely some environment issue that I haven't encountered since I don't develop on windows. might be that using an environment manager like conda would help. |
I know, I worked in conda before but I also need linux for othes school projects. Can you give me your email addres to send you comparison of pip lists from ubuntu and windows? |
I'd rather keep discussion here -- just save them into text files and attach them here ( |
you could also join the yt slack (instructions and invite link are at https://yt-project.org/community.html) and send me a direct message with the files. |
@chrishavlin I found another error. This time when I starded example from documentation. I changed the codec to utf-8 and when I did it there were no errors but napari did not start either. |
Looks like you're running from a plain python shell within pycharm or vscode? These examples are notebooks, so you'll need to use either ipython or jupyter. I know you can do this from pycharm/vscode but at least to get started you should try from a standard jupyter lab browser environment (sometimes running notebooks within pycharm/vscode can have weird side effects). So do that first. And if that doesn't work, check that you can run a plain yt command from the notebook (the error you're getting is coming from yt, not yt-napari or napari): import yt
ds = yt.load_sample("IsolatedGalaxy")
slc = yt.SlicePlot(ds, 'x', ('gas', 'density'))
slc.show() |
also, seems like you should walk through https://napari.org/stable/tutorials/fundamentals/getting_started.html to make sure you have installed napari succesfully |
Thanks a lot for info, yes this error ocured in VScode i will try jupiter notebook |
@TomasPetro |
hmm. those just look like warnings to me from QT, don't think that would impact things. Though the last one about the event loop might be an issue... Some ideas: threading?The timeseries loader that you have the screenshot of puts the load into a separate thread, so there might be something going wrong with the QT threading (either due to a bug on the yt-napari side or in napari or an issue with QT?). You can turn off the threading by toggling this line yt-napari/src/yt_napari/_widget_reader.py Line 211 in c90261c
and then the load will block the QT thread. You can also try just the base reader: that one does everything within the main QT thread (the one in the screenshot here https://yt-napari.readthedocs.io/en/latest/quickstart.html#the-yt-napari-yt-reader ). dataset setupI would think this would raise an error... but how did you download
If you've only got one of those BUT, I'd be surprised if this was this issue -- if no files were found when you hit |
Looks like that error is coming for your filepath: I can reproduce the error with just the following (note, the problematic character is this one: >>> b = u"\u010D"
>>> b.encode('latin-1')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'latin-1' codec can't encode character '\u010d' in position 0: ordinal not in range(256) I couldn't tell you why |
With yt-napari, you can also load from a JSON file by clicking "File -> Open": https://yt-napari.readthedocs.io/en/latest/quickstart.html#loading-a-json-file-from-the-napari-gui So the initial aim is to simply save off a JSON file that will work when you re-load using "File -> Open". Note that it's not just as simple as creating a JSON from the fields, it has to follow the yt-napari schema. That's why I suggested earlier to:
The JSON you have above is missing fields, so it will not be a valid yt-napari/src/yt_napari/_widget_reader.py Line 142 in c90261c
Seems like you've made some progress though! feel free to submit a work-in-progress PR if you want me to look over what you've done so far. |
Should add a button to the GUI loader to save a yt-napari json so that you can easily re-load the configuration you've typed up in the GUI.
might be able to add an equivalent functionality to the notebook helper functions as well.
The text was updated successfully, but these errors were encountered: