-
Notifications
You must be signed in to change notification settings - Fork 51
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
no rendering using interactive openPMD-viewer #1572
Comments
Hi @BenWibking , Thanks a lot for the report! I moved it over to openPMD-api, because the backend issue in openPMD-viewer is rooted here. Can you provide us some deetails how openPMD-api was installed for your Jupyter/Python/openPMD-viewer stack?
Can you print the |
@BenWibking, for testing your data set, can you do produce a comparable output with The
Does the validator show any errors or warnings? |
For this case, I installed openPMD-api and openPMD-viewer with conda as follows:
Then I used Conda info: (openpmd) ➜ tests git:(development) ✗ conda info
active environment : openpmd
active env location : /opt/homebrew/Caskroom/miniconda/base/envs/openpmd
shell level : 2
user config file : /Users/benwibking/.condarc
populated config files :
conda version : 23.7.4
conda-build version : not installed
python version : 3.11.6.final.0
virtual packages : __archspec=1=arm64
__osx=14.2=0
__unix=0=0
base environment : /opt/homebrew/Caskroom/miniconda/base (writable)
conda av data dir : /opt/homebrew/Caskroom/miniconda/base/etc/conda
conda av metadata url : None
channel URLs : https://repo.anaconda.com/pkgs/main/osx-arm64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/osx-arm64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /opt/homebrew/Caskroom/miniconda/base/pkgs
/Users/benwibking/.conda/pkgs
envs directories : /opt/homebrew/Caskroom/miniconda/base/envs
/Users/benwibking/.conda/envs
platform : osx-arm64
user-agent : conda/23.7.4 requests/2.29.0 CPython/3.11.6 Darwin/23.2.0 OSX/14.2
UID:GID : 501:20
netrc file : None
offline mode : False
The validator shows: (openpmd) ➜ tests git:(development) ✗ openPMD_check_h5 -i hdf5/plt00000.h5
Warning: Attribute author (recommended) does NOT exist in `/`!
Found 1 iteration(s)
Iteration 0 : found 6 meshes
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniconda/base/envs/openpmd/bin/openPMD_check_h5", line 10, in <module>
sys.exit(main())
^^^^^^
File "/opt/homebrew/Caskroom/miniconda/base/envs/openpmd/lib/python3.12/site-packages/openpmd_validator/check_h5.py", line 931, in main
result_array = check_file(file_name, verbose, force_extension_pic)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniconda/base/envs/openpmd/lib/python3.12/site-packages/openpmd_validator/check_h5.py", line 924, in check_file
result_array += check_iterations(f, verbose, extensionStates)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniconda/base/envs/openpmd/lib/python3.12/site-packages/openpmd_validator/check_h5.py", line 495, in check_iterations
result_array += check_meshes(f, iteration, v, extensionStates)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniconda/base/envs/openpmd/lib/python3.12/site-packages/openpmd_validator/check_h5.py", line 603, in check_meshes
result_array += test_record(f[full_meshes_path], field_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniconda/base/envs/openpmd/lib/python3.12/site-packages/openpmd_validator/check_h5.py", line 159, in test_record
%(r.name) )
^^^^^^
AttributeError: 'str' object has no attribute 'name' and openPMD-viewer shows the same error as before:
Here are the files in both HDF5 and BP5 formats: |
This script shows that the data appears to be there, so I'm not sure what's going on...
|
If I change line 159 of $ openPMD_check_h5 -i hdf5/plt00000.h5
/home/benwibking/openpmd_files/openPMD-validator/openpmd_validator/check_h5.py:147: SyntaxWarning: invalid escape sequence '\w'
regEx = re.compile("^\w+$") # Python3 only: re.ASCII
/home/benwibking/openpmd_files/openPMD-validator/openpmd_validator/check_h5.py:407: SyntaxWarning: invalid escape sequence '\.'
result_array += test_attr(f, v, "required", "openPMD", np.string_, "^[0-9]+\.[0-9]+\.[0-9]+$")
/home/benwibking/openpmd_files/openPMD-validator/openpmd_validator/check_h5.py:409: SyntaxWarning: invalid escape sequence '\/'
result_array += test_attr(f, v, "required", "basePath", np.string_, "^\/data\/\%T\/$")
/home/benwibking/openpmd_files/openPMD-validator/openpmd_validator/check_h5.py:414: SyntaxWarning: invalid escape sequence '\/'
result_array += test_attr(f, v, "optional", "meshesPath", np.string_, "^.*\/$")
/home/benwibking/openpmd_files/openPMD-validator/openpmd_validator/check_h5.py:415: SyntaxWarning: invalid escape sequence '\/'
result_array += test_attr(f, v, "optional", "particlesPath", np.string_, "^.*\/$")
/home/benwibking/openpmd_files/openPMD-validator/openpmd_validator/check_h5.py:431: SyntaxWarning: invalid escape sequence '\+'
"^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} [\+|-][0-9]{4}$")
Warning: Attribute author (recommended) does NOT exist in `/`!
Found 1 iteration(s)
Iteration 0 : found 6 meshes
Error: Record x-GasMomentum is NOT named properly (a-Z0-9_)!
Error: Record y-GasMomentum is NOT named properly (a-Z0-9_)!
Error: Record z-GasMomentum is NOT named properly (a-Z0-9_)!
Iteration 0 : found 0 particle species
Result: 3 Errors and 1 Warnings. |
I realized I was also missing |
With fixed iteration encoding, fixed axisLabels, and fixed component names: Still nothing appears in openPMD-viewer. |
I can reproduce this locally with your dataset. Unfortunately, the openPMD-viewer seems to swallow the original exception, so it is not obvious where the error originally stems from. |
The problem is that your files for some reason encode the wrong iteration encoding:
As a consequence, the Aside: In https://github.com/openPMD/openPMD-api/pull/1368/files, we removed two warnings when the encoded iteration encoding did not match the filenames. We should reinstate the first of the two removed warnings. I'll prepare a PR. |
With #1573:
Fixing the iteration encoding in your files should still be the preferred solution. Since ADIOS2 does not really support editing files once written, this is only really possible by copying/recreating the file. |
I tried to fix the iteration encoding issue in these files. The exception no longer appears in the console, but I still don't see any rendering of the data in openPMD-viewer. Can you reproduce this? |
Ah, yep, should have read more carefully. The initial bug was something that needs to be fixed in the openPMD-api anyway, but the remaining issue seems to be an unrelated issue in the openPMD-viewer. What I see is just the GUI of the Viewer, without any actual output, I assume it's the same on your end? |
Let me be honest with you here: I have no idea what either of these two options do, I was just poking things until they worked. But these observations might be interesting to @RemiLehe (maintainer of the openPMD-viewer) and @ax3l, as this sounds at least like a UX issue of the openPMD-viewer, if not a bug. |
According to the matplotlib docs, it looks like |
I am attempting to use the default interactive notebook to visualize a series of BP5 outputs. It recognizes the names of the components, but nothing shows up. In the console, it shows:
Each time I click "Refresh now!", it prints a new line:
The text was updated successfully, but these errors were encountered: