titusjan / argos

Argos: a data viewer that can read HDF5, NetCDF4, and other file formats.
GNU General Public License v3.0
175 stars 26 forks source link

"Line Plot" unusable because "QtCore" is not defined #20

Closed yhidaka closed 2 years ago

yhidaka commented 2 years ago

I was getting this warning message when I try to plot a line for a 1-D vector or 2-D matrix:

2021-10-04 10:10:03.459 :                basereg.py:216  : WARNING : Unable to import 'argos.inspector.pgplugins.lineplot1d.PgLinePlot1d': name 'QtCore' is not defined
2021-10-04 10:10:03.459 :             mainwindow.py:615  : WARNING : Unable to create 'lineplot' inspector because Class not successfully imported: name 'QtCore' is not defined
2021-10-04 10:10:03.459 :             mainwindow.py:637  : WARNING : Unable to create 'lineplot' inspector because Class not successfully imported: name 'QtCore' is not defined

Even though the message was warning, line plotting functionality was not working.

This error disappeared and I was able to plot lines after modifying the file "argos/inspector/pgplugins/pghistlutitem.py" by adding the following line at the top:

from pyqtgraph.Qt import QtCore

Could anybody apply this simple bug fix and push the new version to conda-forge?

Thank you very much for this nice tool! I've been looking for a good alternative to hdfview for a very long time.

p.s. By the way, importing QtCore from argos.qt failed with the error message module 'PyQt5.QtCore' has no attribute 'Signal'.

p.p.s The conda environment I tested was created as follows:

$ conda create -p argos_test argos pyqt h5py -c conda-forge

And the following is the output of $ conda list:

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
alsa-lib                  1.2.3                h516909a_0    conda-forge
argos                     0.3.1              pyhd8ed1ab_0    conda-forge
c-ares                    1.17.2               h7f98852_0    conda-forge
ca-certificates           2021.5.30            ha878542_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cmlib                     1.1.1              pyhd8ed1ab_0    conda-forge
dbus                      1.13.6               h48d8840_2    conda-forge
expat                     2.4.1                h9c3ff4c_0    conda-forge
fontconfig                2.13.1            hba837de_1005    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
gettext                   0.19.8.1          h73d1719_1008    conda-forge
glib                      2.68.4               h9c3ff4c_1    conda-forge
glib-tools                2.68.4               h9c3ff4c_1    conda-forge
gst-plugins-base          1.18.5               hf529b03_0    conda-forge
gstreamer                 1.18.5               h76c114f_0    conda-forge
h5py                      3.4.0           nompi_py39h7e08c79_101    conda-forge
hdf5                      1.12.1          nompi_h2750804_100    conda-forge
icu                       68.1                 h58526e2_0    conda-forge
jpeg                      9d                   h36c2ea0_0    conda-forge
krb5                      1.19.2               hcc1bbae_2    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
libblas                   3.9.0           11_linux64_openblas    conda-forge
libcblas                  3.9.0           11_linux64_openblas    conda-forge
libclang                  11.1.0          default_ha53f305_1    conda-forge
libcurl                   7.79.1               h2574ce0_1    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libevent                  2.1.10               hcdb4288_3    conda-forge
libffi                    3.4.2                h9c3ff4c_4    conda-forge
libgcc-ng                 11.2.0               h1d223b6_9    conda-forge
libgfortran-ng            11.2.0               h69a702a_9    conda-forge
libgfortran5              11.2.0               h5c6108e_9    conda-forge
libglib                   2.68.4               h174f98d_1    conda-forge
libgomp                   11.2.0               h1d223b6_9    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
liblapack                 3.9.0           11_linux64_openblas    conda-forge
libllvm11                 11.1.0               hf817b99_2    conda-forge
libnghttp2                1.43.0               h812cca2_1    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.17          pthreads_h8fe5266_1    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libpq                     13.3                 hd57d9b9_0    conda-forge
libssh2                   1.10.0               ha56f1ee_2    conda-forge
libstdcxx-ng              11.2.0               he4da1e4_9    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libxcb                    1.13              h7f98852_1003    conda-forge
libxkbcommon              1.0.3                he3ba5ed_0    conda-forge
libxml2                   2.9.12               h72842e0_0    conda-forge
libzlib                   1.2.11            h36c2ea0_1013    conda-forge
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
mysql-common              8.0.25               ha770c72_2    conda-forge
mysql-libs                8.0.25               hfa10184_2    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
nspr                      4.30                 h9c3ff4c_0    conda-forge
nss                       3.69                 hb5efdd6_1    conda-forge
numpy                     1.21.2           py39hdbf815f_0    conda-forge
openssl                   1.1.1l               h7f98852_0    conda-forge
pcre                      8.45                 h9c3ff4c_0    conda-forge
pgcolorbar                1.1.1              pyhd8ed1ab_0    conda-forge
pip                       21.2.4             pyhd8ed1ab_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pyqt                      5.12.3           py39hf3d152e_7    conda-forge
pyqt-impl                 5.12.3           py39h0fcd23e_7    conda-forge
pyqt5-sip                 4.19.18          py39he80948d_7    conda-forge
pyqtchart                 5.12             py39h0fcd23e_7    conda-forge
pyqtgraph                 0.12.2             pyhd8ed1ab_0    conda-forge
pyqtwebengine             5.12.1           py39h0fcd23e_7    conda-forge
python                    3.9.7           hb7a2778_3_cpython    conda-forge
python_abi                3.9                      2_cp39    conda-forge
qt                        5.12.9               hda022c4_4    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
setuptools                58.0.4           py39hf3d152e_2    conda-forge
sqlite                    3.36.0               h9cd32fc_2    conda-forge
tk                        8.6.11               h27826a3_1    conda-forge
tzdata                    2021b                he74cb21_0    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h36c2ea0_1013    conda-forge
zstd                      1.5.0                ha95c52a_0    conda-forge
Potemkinkuliss commented 2 years ago

I can confirm the issue pip freeze: alabaster==0.7.12 argos==0.3.1 arrow==1.2.0 Babel==2.9.1 backcall==0.2.0 Cartopy==0.20.1 Cerberus==1.3.4 certifi==2021.10.8 cftime==1.5.1 charset-normalizer==2.0.6 click==8.0.3 cmlib==1.1.1 coriolis==0.0.1 cycler==0.10.0 Cython==0.29.24 debugpy==1.5.0 decorator==5.1.0 docrep==0.3.2 docutils==0.17.1 entrypoints==0.3 fasteners==0.16.3 funcargparse==0.2.5 idna==3.2 imagesize==1.2.0 install==1.3.4 ipykernel==6.4.1 ipython==7.28.0 ipython-genutils==0.2.0 jedi==0.18.0 Jinja2==3.0.2 jupyter-client==7.0.6 jupyter-core==4.8.1 kiwisolver==1.3.2 MarkupSafe==2.0.1 matplotlib==3.4.3 matplotlib-inline==0.1.3 nc-time-axis==1.3.1 ncagg==0.8.11 nest-asyncio==1.5.1 netCDF4==1.5.7 numpy==1.21.2 packaging==21.0 pandas==1.3.3 parso==0.8.2 pexpect==4.8.0 pgcolorbar==1.1.1 pickleshare==0.7.5 Pillow==8.3.2 proj==0.2.0 prompt-toolkit==3.0.20 psy-maps==1.4.0 psy-simple==1.4.0 psy-view==0.2.0 psyplot==1.4.0 psyplot-gui==1.4.0 ptyprocess==0.7.0 Pygments==2.10.0 pykdtree==1.3.4 pyparsing==2.4.7 pyproj==3.2.1 PyQt5==5.15.4 PyQt5-Qt5==5.15.2 PyQt5-sip==12.9.0 pyqtgraph==0.12.3 pyshp==2.1.3 python-dateutil==2.8.2 pytz==2021.3 PyYAML==6.0b1 pyzmq==22.3.0 qtconsole==5.1.1 QtPy==1.11.2 requests==2.26.0 scipy==1.7.1 Shapely==1.7.1 six==1.16.0 snowballstemmer==2.1.0 Sphinx==4.2.0 sphinx-rtd-theme==1.0.0 sphinxcontrib-applehelp==1.0.2 sphinxcontrib-devhelp==1.0.2 sphinxcontrib-htmlhelp==2.0.0 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 tornado==6.1 traitlets==5.1.0 urllib3==1.26.7 wcwidth==0.2.5 xarray==0.19.0

oxanagig commented 2 years ago

Same issue.

Package Version


argos 0.3.1 cftime 1.5.1 cmlib 1.1.1 cycler 0.10.0 entrypoints 0.3 h5py 3.4.0 kiwisolver 1.3.2 matplotlib 3.4.3 netCDF4 1.5.7 numpy 1.20.3 pandas 1.3.4 pathlib 1.0.1 pgcolorbar 1.1.1 Pillow 8.4.0 pip 21.3 pyobjc-core 7.3 pyobjc-framework-Cocoa 7.3 pyparsing 2.4.7 PyQt5 5.15.5 PyQt5-Qt5 5.15.2 PyQt5-sip 12.9.0 pyqtgraph 0.12.3 pysasupport 1.0.0 python-dateutil 2.8.2 pytz 2021.3 QtPy 1.11.2 scipy 1.7.1 seaborn 0.11.2 setuptools 56.0.0 six 1.16.0 xarray 0.18.2

yhidaka commented 2 years ago

I just created a pull request.

I'm new to pull requests, so please let me know if I made a mistake.

scontini76 commented 2 years ago

The same issue can be found using the "Image Plot", I solve with a similar approach described on the pull #21.

Should I open a specific bug? Or maybe this bug should be about generic QtCore missing imports around the project?

titusjan commented 2 years ago

Apologies for the late reply all. And thanks for the pull request @yhidaka but I fixed it myself. It should also be fixed or the Image plot.

I made a new release (version 0.4.0), please let me know if there are any issues.