RMGDFT / rmgdft

RMG is an Open Source code for electronic structure calculations and modeling of materials and molecules. It is based on density functional theory and uses a real space basis and pseudopotentials.
GNU General Public License v2.0
47 stars 11 forks source link

Refresh GUI for Modern Python #88

Closed JacksonBurns closed 10 months ago

JacksonBurns commented 1 year ago

Hello!

The GUI for RMG uses Python 2.7, which is of course rather out of date and can no longer access the Python Package Index (as of January 2021). This PR updates RMG_GUI.py and its associated components to run on Python 3. The diff is quite large, but in summary:

The only 'significant' differences between this and the previous version is that the input file generated by the GUI now includes the timestamp of when it was generated (and mentions that it was generated by the UI), and I rewrote one internal function that was hopelessly broken after the transition.

Apologies for the large number of commits - I tried to keep them organized by file, but obviously that stopped working at some point.

elbriggs commented 1 year ago

Thanks Jackson. I won't be able to take a closer look at this until next week but one thing I did notice is that the PR is against master rather than develop. Could you go ahead and switch it to develop?

elbriggs commented 1 year ago

I tried this out on a machine running Ubuntu 22.04.2 and ran into something that looks to be the same as this error. I'm wondering what version of python you used since it sounds like versions before 3.10 did not have this issue.

https://bugs.launchpad.net/rapid/+bug/1946407

JacksonBurns commented 1 year ago

I'm actually using 3.11.4 - here's the complete output of my conda virtual environment:

Environment ``` (rmgdftgui) jackson@jackson-Precision-7540:~/Desktop$ conda list # packages in environment at /home/jackson/mambaforge/envs/rmgdftgui: # # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 2_gnu conda-forge alsa-lib 1.2.8 h166bdaf_0 conda-forge attr 2.5.1 h166bdaf_1 conda-forge blosc 1.21.4 h0f2a231_0 conda-forge bzip2 1.0.8 h7f98852_4 conda-forge c-ares 1.19.1 hd590300_0 conda-forge ca-certificates 2023.5.7 hbcca054_0 conda-forge cairo 1.16.0 hbbf8b49_1016 conda-forge certifi 2023.5.7 pyhd8ed1ab_0 conda-forge curl 8.1.2 h409715c_0 conda-forge dbus 1.13.6 h5008d03_3 conda-forge expat 2.5.0 hcb278e6_1 conda-forge font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge font-ttf-inconsolata 3.000 h77eed37_0 conda-forge font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge font-ttf-ubuntu 0.83 hab24e00_0 conda-forge fontconfig 2.14.2 h14ed4e7_0 conda-forge fonts-conda-ecosystem 1 0 conda-forge fonts-conda-forge 1 0 conda-forge freetype 2.12.1 hca18f0e_1 conda-forge gettext 0.21.1 h27087fc_0 conda-forge glew 2.1.0 h9c3ff4c_2 conda-forge glib 2.76.3 hfc55251_0 conda-forge glib-tools 2.76.3 hfc55251_0 conda-forge glm 0.9.9.8 h00ab1b0_0 conda-forge graphite2 1.3.13 h58526e2_1001 conda-forge gst-plugins-base 1.22.3 h938bd60_1 conda-forge gstreamer 1.22.3 h977cf35_1 conda-forge harfbuzz 7.3.0 hdb3a94d_0 conda-forge hdf4 4.2.15 h501b40f_6 conda-forge hdf5 1.14.0 nompi_hb72d44e_103 conda-forge icu 72.1 hcb278e6_0 conda-forge isort 5.12.0 pypi_0 pypi keyutils 1.6.1 h166bdaf_0 conda-forge krb5 1.20.1 h81ceb04_0 conda-forge lame 3.100 h166bdaf_1003 conda-forge ld_impl_linux-64 2.40 h41732ed_0 conda-forge libaec 1.0.6 hcb278e6_1 conda-forge libblas 3.9.0 17_linux64_openblas conda-forge libcap 2.67 he9d0100_0 conda-forge libcblas 3.9.0 17_linux64_openblas conda-forge libclang 15.0.7 default_h7634d5b_2 conda-forge libclang13 15.0.7 default_h9986a30_2 conda-forge libcups 2.3.3 h36d4200_3 conda-forge libcurl 8.1.2 h409715c_0 conda-forge libedit 3.1.20191231 he28a2e2_2 conda-forge libev 4.33 h516909a_1 conda-forge libevent 2.1.12 hf998b51_1 conda-forge libexpat 2.5.0 hcb278e6_1 conda-forge libffi 3.4.2 h7f98852_5 conda-forge libflac 1.4.2 h27087fc_0 conda-forge libgcc-ng 13.1.0 he5830b7_0 conda-forge libgcrypt 1.10.1 h166bdaf_0 conda-forge libgfortran-ng 13.1.0 h69a702a_0 conda-forge libgfortran5 13.1.0 h15d22d2_0 conda-forge libglib 2.76.3 hebfc3b9_0 conda-forge libglu 9.0.0 hac7e632_1002 conda-forge libgomp 13.1.0 he5830b7_0 conda-forge libgpg-error 1.47 h71f35ed_0 conda-forge libiconv 1.17 h166bdaf_0 conda-forge libjpeg-turbo 2.1.5.1 h0b41bf4_0 conda-forge liblapack 3.9.0 17_linux64_openblas conda-forge libllvm15 15.0.7 h5cf9203_2 conda-forge libnetcdf 4.9.2 nompi_h0f3d0bb_105 conda-forge libnghttp2 1.52.0 h61bc06f_0 conda-forge libnsl 2.0.0 h7f98852_0 conda-forge libogg 1.3.4 h7f98852_1 conda-forge libopenblas 0.3.23 pthreads_h80387f5_0 conda-forge libopus 1.3.1 h7f98852_1 conda-forge libpng 1.6.39 h753d276_0 conda-forge libpq 15.3 hbcd7760_1 conda-forge libsndfile 1.2.0 hb75c966_0 conda-forge libsqlite 3.42.0 h2797004_0 conda-forge libssh2 1.11.0 h0841786_0 conda-forge libstdcxx-ng 13.1.0 hfd8a6a1_0 conda-forge libsystemd0 253 h8c4010b_1 conda-forge libuuid 2.38.1 h0b41bf4_0 conda-forge libvorbis 1.3.7 h9c3ff4c_0 conda-forge libxcb 1.15 h0b41bf4_0 conda-forge libxkbcommon 1.5.0 h5d7e998_3 conda-forge libxml2 2.11.4 h0d562d8_0 conda-forge libzip 1.9.2 hc929e4a_1 conda-forge libzlib 1.2.13 hd590300_5 conda-forge lz4-c 1.9.4 hcb278e6_0 conda-forge mpg123 1.31.3 hcb278e6_0 conda-forge mysql-common 8.0.33 hf1915f5_0 conda-forge mysql-libs 8.0.33 hca2cd23_0 conda-forge ncurses 6.4 hcb278e6_0 conda-forge nspr 4.35 h27087fc_0 conda-forge nss 3.89 he45b914_0 conda-forge numpy 1.25.0 py311h64a7726_0 conda-forge opencv-python-headless 4.7.0.72 pypi_0 pypi openssl 3.1.1 hd590300_1 conda-forge packaging 23.1 pyhd8ed1ab_0 conda-forge pcre2 10.40 hc3806b6_0 conda-forge pip 23.1.2 pyhd8ed1ab_0 conda-forge pixman 0.40.0 h36c2ea0_0 conda-forge ply 3.11 py_1 conda-forge pmw 2.0.1 py311h38be061_1007 conda-forge pthread-stubs 0.4 h36c2ea0_1001 conda-forge pulseaudio-client 16.1 hb77b528_4 conda-forge pymol-open-source 2.5.0 py311hf3bc80d_6 conda-forge pyqt5 5.15.9 pypi_0 pypi pyqt5-qt5 5.15.2 pypi_0 pypi pyqt5-sip 12.12.1 pypi_0 pypi pyqt6-qt6 6.5.1 pypi_0 pypi pyqt6-sip 13.5.1 pypi_0 pypi python 3.11.4 hab00c5b_0_cpython conda-forge python_abi 3.11 3_cp311 conda-forge qt-main 5.15.8 h01ceb2d_13 conda-forge readline 8.2 h8228510_1 conda-forge setuptools 68.0.0 pyhd8ed1ab_0 conda-forge sip 6.7.9 py311hb755f60_0 conda-forge snappy 1.1.10 h9fff704_0 conda-forge sqlite 3.42.0 h2c6b66d_0 conda-forge tk 8.6.12 h27826a3_0 conda-forge toml 0.10.2 pyhd8ed1ab_0 conda-forge tomli 2.0.1 pyhd8ed1ab_0 conda-forge tzdata 2023c h71feb2d_0 conda-forge wheel 0.40.0 pyhd8ed1ab_0 conda-forge xcb-util 0.4.0 hd590300_1 conda-forge xcb-util-image 0.4.0 h8ee46fc_1 conda-forge xcb-util-keysyms 0.4.0 h8ee46fc_1 conda-forge xcb-util-renderutil 0.3.9 hd590300_1 conda-forge xcb-util-wm 0.4.1 h8ee46fc_1 conda-forge xkeyboard-config 2.39 hd590300_0 conda-forge xorg-kbproto 1.0.7 h7f98852_1002 conda-forge xorg-libice 1.1.1 hd590300_0 conda-forge xorg-libsm 1.2.4 h7391055_0 conda-forge xorg-libx11 1.8.6 h8ee46fc_0 conda-forge xorg-libxau 1.0.11 hd590300_0 conda-forge xorg-libxdmcp 1.1.3 h7f98852_0 conda-forge xorg-libxext 1.3.4 h0b41bf4_2 conda-forge xorg-libxrender 0.9.10 h7f98852_1003 conda-forge xorg-renderproto 0.11.1 h7f98852_1002 conda-forge xorg-xextproto 7.3.0 h0b41bf4_1003 conda-forge xorg-xf86vidmodeproto 2.3.1 h7f98852_1002 conda-forge xorg-xproto 7.0.31 h7f98852_1007 conda-forge xz 5.2.6 h166bdaf_0 conda-forge zlib 1.2.13 hd590300_5 conda-forge zstd 1.5.2 h3eb15da_6 conda-forge ```

:crossed_fingers: just a Python 3.10 thing?

elbriggs commented 1 year ago

Yes it looks like it's an issue with 3.10 that was addressed in 3.11. I upgraded and that fixed the issue.

elbriggs commented 10 months ago

I've held off merging this because RMG is sometimes used on machines with policies that limit what can be installed and python packages can be an issue. For that reason I'm going to move this to a separate repo so it can be installed separately if needed.

JacksonBurns commented 10 months ago

@elbriggs sounds like a good plan, let me know if there is anything I can do to help!

elbriggs commented 10 months ago

Thanks for your work on this Jackson. I've imported the PR into a new repository RMGDFT/RMG_GUI where all further work will take place and will remove the RMG_GUI code from rmgdft develop.