molpro / imolpro Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
As a first stage, make a guided mode panel that implements only textual input of the `basis` element of the input.
Originally posted by @pjknowles in #11 (comment)
Clean python environment installed as per INSTALL
.
python Molpro.py project1.molpro
Traceback (most recent call last):
File "/host/Molpro.py", line 28, in <module>
window_manager.register(ProjectWindow(arg))
^^^^^^^^^^^^^^^^^^
TypeError: ProjectWindow.__init__() missing 1 required positional argument: 'window_manager'
Perhaps this is no longer supported? If not it would be good to trap that in a nicer way.
python Molpro.py
Traceback (most recent call last):
File "/host/Chooser.py", line 152, in newProjectDialog
self.window_manager.register(ProjectWindow(filename, self.window_manager))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/host/ProjectWindow.py", line 71, in __init__
os.environ['PATH'] = os.popen(os.environ['SHELL'] + " -l -c 'echo $PATH'").read() + ':' + os.environ[
~~~~~~~~~~^^^^^^^^^
File "<frozen os>", line 679, in __getitem__
KeyError: 'SHELL'
Aborted (core dumped)
This should probably be laid out as a tab set with the input window. Start by making a place-holder for it.
Convert input to structured specification for job, and inverse
Make buttons and selectors to allow editing of the specification
... for example transparency level. We can certainly do this on the python side (and save in settings); more tricky would be to capture any changes made in the Jmol panel.
This is tricky to do if the project is open, because if you remove the files, the open object continues to poll, and gets upset when the files are gone. Maybe it can be done from the Chooser
version 759d9d9
start with a new project, freehand input looks like this:
geometry=bla.xyz
basis=cc-pVTZ-PP
rhf
remove the line with basis=cc-pVTZ-PP
starting from the end, until finally:
geometry=bla.xyz
b
rhf
remove the "b", crash:
Traceback (most recent call last):
File "/home/linux24_i1/doll/imolpro/iMolpro/ProjectWindow.py", line 287, in refresh_input_tabs
self.refresh_guided_pane()
File "/home/linux24_i1/doll/imolpro/iMolpro/ProjectWindow.py", line 309, in refresh_guided_pane
self.guided_basis_input.setText(self.input_specification['basis'])
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'basis'
Aborted (core dumped)
(I noticed this when I tried to code setting the pulldown for the method, and ran into the same problem.)
'The orbital plots and the text above may overlap. Can the text be moved outside (above or below) the plot box?'
I have the impression that this might be difficult, as we are just taking what Jmol gives us. Related to #8 , or we might even want to offer the option to offload to external {Jmol,Avogadro} program for high resolution work, or preparing figures for presentation.
This seems to be a problem in Jmol and should be fixed there.
Create documentation and link to it from the Chooser and menu bar
When a blank is added, this makes it in some cases impossible to switch to guided mode.
E.g.:
single blank in a line:
blank attached to command:
optg;
blank at beginning, in this case:
optg;
freq;
strangely, this works:
optg; frequencies;
but not:
optg; freq;
If the backend is misconfigured, then job submission either fails but the code assumes it succeeded, or the program crashes.
On tag, a GitHub action should build the binaries for linux, windows, macOS (x86_64 and arm64)
python iMolpro.py
open a new project
type an "a" before geometry:
ageometry=dummy.xyz
iMolpro/molpro_input.py:75: FutureWarning: Possible nested set at position 4
while (newline := re.sub('(\[[[0-9!]*),', r'\1!', line)) != line: line = newline # protect eg occ=[3,1,1]
also seen, non-reproducible, immediately after startup:
iMolpro/molpro_input.py:75: SyntaxWarning: invalid escape sequence '\['
while (newline := re.sub('(\[[[0-9!]*),', r'\1!', line)) != line: line = newline # protect eg occ=[3,1,1]
show files in a project (ls)
remove files in a project (rm)
Several possible strategies:
Note that there challenges associated with reverse-engineering the basis set. Easy to get hamiltonian from 'PP' in the basis. More tricky to get the basis quality level, maybe.
It should get updated continuously
'Display the orbital energies in reverse order so that the occupied ones come on top. Otherwise one has to scroll down a very long list if the basis set is large. Alternatively, do not show virtuals (or only the lowest) by default.'
This might be tricky because we are just using what Jmol gives us. But let's consider what can be done.
When making a link of an xyz file to a different name (just for clarity, e.g. monomer.xyz -> c6h6.xyz) and selecting the link, the original name (monomer.xyz) is used in the input. It's of course not wrong. This happens for example if one has "monomer.xyz" in many different directories for different systems. Certainly not important to fix, unless simple.
Attempting to start a new project from command line, was recently fixed (see #32) so must be some recent regression:
host> python iMolpro.py project1.molpro
Traceback (most recent call last):
File "/host/ProjectWindow.py", line 266, in refresh_input_tabs
if len(self.input_tabs) < 1:
^^^^^^^^^^^^^^^
AttributeError: 'ProjectWindow' object has no attribute 'input_tabs'. Did you mean: 'input_pane'?
Aborted (core dumped)
... but if you switch to another application, then switch back, it appears.
QtMolpro
is perhaps not the best - nobody really cares that it's implemented with Qt. gmolpro
is already taken. imolpro
to emphasis interactive? xmolpro
as a pointer towards X Window as used on linux?
Was previously broken and fixed, see #61, now broken again:
host> python iMolpro.py project1.molpro
Traceback (most recent call last):
File "/host/iMolpro.py", line 28, in <module>
window_manager.register(ProjectWindow(arg, window_manager))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/host/ProjectWindow.py", line 105, in __init__
self.whole_of_procedures_registry = self.project.procedures_registry()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Project' object has no attribute 'procedures_registry'
At least on my machine the structure window is too small when displaying an input structure (see first screen shot). One has to extend it to the right to see also the link to the jmol options (second screen shot). This is a bit inconvenient. Also, the jmol option menu appears statistically in different places (submenus as well).
@hjwerner says 'It would be helpful if the program remembers (via some rc file) the last directories where (i) the project is stored, (ii) the geometry is read from, (iii) files are imported from; (iv) Files are exported to.'
Yes, I agree, and they can be stored in the settings.
Version be50a75
When I add a blank in this input
geometry={
o
h,o,1
}
basis={default=cc-pvdz}
rhf
in the line
basis={default=cc-pvdz }
before the closing bracket,
then switch to guided mode is not possible. Doing this change in guided mode gives the error message
"Guided mode cannot be used because the input is too complex..."
version 13c993e upon startup:
warning appears (sometimes, non reproducible):
python iMolpro.py
/klaus/path/miniconda3/envs/iMolpro/lib/python3.12/site-packages/pymolpro/project.py:492: SyntaxWarning: invalid escape sequence '\*'
re.sub('([\*a-zA-Z0-9_-]+)=', '"\\1": ', li)).replace("'", '"') + '}'
It seems to happen always, when I do this:
touch /klaus/path/miniconda3/envs/iMolpro/lib/python3.12/site-packages/pymolpro/project.py
python iMolpro.py
/klaus/path/miniconda3/envs/iMolpro/lib/python3.12/site-packages/pymolpro/project.py:492: SyntaxWarning: invalid escape sequence '\*'
re.sub('([\*a-zA-Z0-9_-]+)=', '"\\1": ', li)).replace("'", '"') + '}'
version 759d9d9
start a new project:
geometry=bla2.xyz
basis=cc-pVTZ-PP
rhf
now edit:
rhf22
instead of rhf
still allows to switch to guided mode, though rhf22 is not a molpro method. I can submit a calculation which crashes with:
Unknown command or directive RHF22
Add to files Menu:
delete/rename(move)/copy projects
Select previous run directory under a project
in freehand mode, starting from this input:
geometry=dummy.xyz
basis={default=cc-pVTZ-PP}
rhf
I want to append a line with
ccsd
While typing, the cursor often jumps to the upper left part of the window, which is inconvenient; e.g. usually after having typed the first "c" of ccsd, the cursor jumps to the upper left
At some point before this worked:
conda create -c conda-forge -n QtMolpro 'pymolpro>=1.3.32' pyqt=5 -y
conda activate QtMolpro
then I needed to add:
conda install -y -c conda-forge pyqtwebengine
and now it seems more is needed:
> python Molpro.py
Traceback (most recent call last):
File "/host/Molpro.py", line 4, in <module>
from Chooser import Chooser
File "/host/Chooser.py", line 17, in <module>
from ProjectWindow import ProjectWindow
File "/host/ProjectWindow.py", line 16, in <module>
from database import database_choose_structure
File "/host/database.py", line 4, in <module>
import pubchempy
ModuleNotFoundError: No module named 'pubchempy'
It would be great if somewhere in the README
or an INSTALL
file there would be a concise list of what is needed from a fresh conda install to run and develop with the app.
At the moment, it's easy to forget to save an edited structure.
'Replace „Structure display“ simply by „Display“ and have more items like „Structure, Orbitals, Density, Frequencies, ...“ in that pull-down menu?'
However the program does not know what is in the various output files, and in some cases the output file could have several instances of orbitals, geometries, frequencies etc. But let's consider what can be done to make it as friendly as possible.
> Perhaps better to move the JMol menu stuff below the input window (right of freehand and guided, or below those). Currently the input window scales with the whole window size, which may not be needed.
Maybe, and it was once that way, but the way it is presently is dictated by the size needed for seeing the text output. Let's discuss in next meeting.
Originally posted by @pjknowles in #53 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.