Git Product home page Git Product logo

plams's People

Contributors

af0liveira avatar bas-rustenburg avatar bvb93 avatar chjacob-tubs avatar felipez avatar h4nsu avatar jhidding avatar mirkofranchini avatar miron-scm avatar muhrin avatar patrickmelix avatar ridderl avatar rlkoekie avatar robertrueger avatar scmtestadf avatar sergio-lopez avatar tgakay avatar tootea avatar vivianlink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plams's Issues

Unorderable type error

I have run into the following bug when using the latest version of master:

scm/plams/core/common.py", line 126, in log
  if level <= config.log.file or level <= config.log.stdout:
TypeError: unorderable types: int() <= Settings()

Any ideas about the cause of this error?

Reading molfile fails

I'm trying to read the following molfile:

C-N-C
     RDKit          3D

 14 14  0  0  0  0  0  0  0  0999 V2000
   -2.5643    0.9533    3.7345 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.6268   -0.0105    3.7867 N   0  0  0  0  0  0  0  0  0  0  0  0
   -0.4054    0.0088    3.2202 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.3552    0.3486    0.9210 C   0  0  0  0  0  0  0  0  0  0  0  0
   -2.5775    0.8918    1.1848 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.2363   -0.7165    0.7254 H   0  0  0  0  0  0  0  0  0  0  0  0
   -0.4990    0.9749    0.6713 H   0  0  0  0  0  0  0  0  0  0  0  0
   -3.4779    0.2795    1.2186 H   0  0  0  0  0  0  0  0  0  0  0  0
   -2.7358    1.9699    1.1655 H   0  0  0  0  0  0  0  0  0  0  0  0
   -3.5236    0.7392    4.1952 H   0  0  0  0  0  0  0  0  0  0  0  0
   -2.2306    1.9815    3.6419 H   0  0  0  0  0  0  0  0  0  0  0  0
   -1.9770   -0.9380    4.0199 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.1985   -0.8881    3.3179 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.0821    0.9710    3.1028 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0
  2  3  1  0
  3  4  1  0
  4  5  1  0
  5  1  1  0
  4  6  1  0
  4  7  1  0
  5  8  1  0
  5  9  1  0
  1 10  1  0
  1 11  1  0
  2 12  1  0
  3 13  1  0
  3 14  1  0
M  END

Which fails as follows:

>>> from scm.plams import Molecule
>>> m = Molecule('molfile.mol')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/lars/workspace/plams/src/scm/plams/core/basemol.py", line 410, in __init__
    self.read(filename, inputformat, geometry)
  File "/home/lars/workspace/plams/src/scm/plams/core/basemol.py", line 1430, in read
    ret = self._readformat[inputformat](self, f, frame)
  File "/home/lars/workspace/plams/src/scm/plams/core/basemol.py", line 1215, in readmol
    self.add_atom(Atom(atnum=num, coords=crd))
UnboundLocalError: local variable 'crd' referenced before assignment

If I change crdx to crd in line 1205 of basemol.py, it still fails, because the atom symbols are not written to the input file.

No plams module after installation...

Dear all,

I installed plams as user, but plams module did not appear to be present. Any help, please ?

[email protected]:~/.pip install --user plams
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6                                                                                                                                                    
Collecting plams
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading PLAMS-1.1.1-py2.py3-none-any.whl (76kB)
    100% |################################| 81kB 936kB/s 
Collecting dill>=0.2.4 (from plams)
  Downloading dill-0.2.7.1.tar.gz (64kB)
    100% |################################| 71kB 1.4MB/s 
Requirement already satisfied: six in /usr/lib/python2.6/site-packages (from plams)
Requirement already satisfied: numpy in /usr/lib64/python2.6/site-packages (from plams)
Installing collected packages: dill, plams
  Running setup.py install for dill ... done
Successfully installed dill-0.2.7.1 plams-1.1.1
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
[email protected]:~/.plams
-bash: plams: command not found
[email protected]:~/.s
Source of the /home/milias/.bashrc file on login done.
Welcome to login.grid.umb.sk (172.20.102.32) HPC server at Matej Bel University !
Intel Fortran/C/C++ commercial compilers with MKL library activated, PROD_DIR=/mnt/apps/intel/composer_xe_2013_sp1.
The $PYTHONPATH already contains "/home/milias/bin/PyADF/PyADF-0.9/src".
The $LIBDIR already contains "/home/milias/bin/binutils-gold/lib".
The $LD_RUN_PATH already contains "/home/milias/bin/binutils-gold/lib".
Directory "/shared/home/ilias/bin/binutils-gold/bin" does not exist! No extension of $PATH.
Personal file /home/milias/miro_ilias_bashrc/bashrc_generic does exist !
It comes from "git clone [email protected]:miroslaviliasumbsk/projects/miro_ilias_working_repos/repositories/git/miro_ilias_bashrc" 
Personal bashrc linked :lrwxrwxrwx 1 milias milias 45 Feb 16  2015 /home/milias/.bashrc -> /home/milias/miro_ilias_bashrc/bashrc_generic
$PATH already contains "."
[email protected]:~/.python
Python 2.7.12 (default, Dec 14 2016, 21:53:57) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import plams
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named plams
>>> quit
Use quit() or Ctrl-D (i.e. EOF) to exit
>>> 

ASE has been (improperly) made a hard dependency

Commit a2ab84f introduced some new ASE-related features, including a new module. The problem is that the ASE imports are not guarded behind a try/except block and __all__ is unconditionally populated with the module's content, thus turning ASE into a hard depdency of PLAMS without it being properly specified in setup.py (breaking any pip-based installation of PLAMS).

See the example below for an example within PLAMS where such an optional-import guard is successfully implemented:

try:
from rdkit import Chem, Geometry
from rdkit.Chem import AllChem
except ImportError:
__all__ = []

Again Not Running with Python <3.6

Hey,

you included multiple strings with the new PEP 498 of Python 3.6 (f"some string with {var}"). If you want to enforce the latest python, please update the documentation. Older versions obviously fail.

Same discussion as in #52 ...

Cheers,
Patrick

PLAMS unconditionally imports from `scm.utils`

As of a3570c2 PLAMS uncondontially imports from the scm.utils module, which is neither part of PLAMS itself nor one of it's (properly specified) dependenies. The result is that direct PLAMS installations from the master branch are currently broken.

Examples

In [1]: from scm.plams import Molecule
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 from scm.plams import Molecule

File ~/opt/anaconda3/envs/test/lib/python3.10/site-packages/scm/plams/__init__.py:21, in <module>
     17                         globals()[name] = vars(tmp)[name]
     18     return ret
---> 21 __all__ = __autoimport(__path__[0], ['core', 'mol', 'interfaces', 'tools', 'recipes','trajectories'])
     23 __version__ = '1.5.1'

File ~/opt/anaconda3/envs/test/lib/python3.10/site-packages/scm/plams/__init__.py:13, in __autoimport(path, folders)
     11 for module in modules:
     12     imp = '.'.join(relpath + [module])
---> 13     tmp = __import__(imp, globals=globals(), fromlist=['*'], level=1)
     14     if hasattr(tmp, '__all__'):
     15         ret += tmp.__all__

File ~/opt/anaconda3/envs/test/lib/python3.10/site-packages/scm/plams/interfaces/adfsuite/propertyprediction.py:8, in <module>
      5 except ImportError:
      6     has_rdkit = False
----> 8 from scm.utils.runsubprocess import RunSubprocess
      9 from ...mol.molecule import Molecule
     10 from ...tools.kftools import KFFile

ModuleNotFoundError: No module named 'scm.utils'

Tag new version

Hi SCM,

Would you guys be willing to tag a new PLAMS version? The current one on here and PyPi is about to be two years old now.

Release version

The latest version is more than two years old and is missing interfaces that are included in the documentation on your website. Would it, perhaps, be time to tag a new version? I guess that should also allow users to access all the documented interfaces when installing with pip.

job.run does not pickle

Hi SCM,

I found that two PLAMS, one installed by pip install plams (through PyPI) and the other one installed by pip install git+https://github.com/SCM-NV/PLAMS.git@master (through source code from Github), behave quite differently.

The latter one does not appropriately save the finished job (pickling .dill file) after job.run(), and this should be addressed.

Allow case sensitive Settings

In CP2K is quite common to have exactly the same keyword with different values, for example:

    &KIND  C
      BASIS_SET  DZVP-MOLOPT-SR-GTH-q4
      BASIS_SET  AUXFIT CFIT3
      POTENTIAL  GTH-PBE-q4
    &END

Previous versions of the settings class allow to bypass this problem by using the following notation:

s = Settings()
s.kind.C.BASIS_SET = "DZVP-MOLOPT-SR-GTH-q4"
s.kind.C.basis_set = "AUXFIT CFIT3"

Case sensitive basis_set used to produced the desired results. Would it be possible to reintroduced this behavior?

Syntax errors in `crystal.py`

The crystal plugin code has a bunch of syntax erros with incorrect use of comparison operators. In python 3.8+ you will get warnings such as this:

...python3.8/site-packages/scm/plams/interfaces/adfsuite/scmjob.py:310: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif value is '' or value is True:
...python3.8/site-packages/scm/plams/interfaces/thirdparty/cp2k.py:479: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif value is '' or value is True:
...python3.8/site-packages/scm/plams/interfaces/thirdparty/crystal.py:112: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if not key is '':
...python3.8/site-packages/scm/plams/interfaces/thirdparty/crystal.py:117: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif key is '':
...site-packages/scm/plams/interfaces/thirdparty/crystal.py:120: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif value is '' or value is True:

This should be changed following the advice in the warninig i.e. when doing value comparison (as opposed to reference comparison) one should use the boolean operators. This may or may not lead to actual faults in the code.

Use srun for cp2k with MPI

Problem

For some hardware srun is a better choice than mpirun therefore, I would be great if we first to use srun if available, otherwise use mpirun

Error in guess_bonds()

I'm trying to guess_bonds() for this xyz:

10

H -0.00126 1.83437 -1.35474
N -0.02562 -0.34660 1.17301
H -0.92656 -0.59522 1.58997
N 0.18942 -1.17915 0.00000
H 1.19591 -1.34432 0.00000
N -0.02562 -0.34660 -1.17301
H -0.92656 -0.59522 -1.58997
C -0.02562 0.99771 0.66854
C -0.02562 0.99771 -0.66854
H -0.00126 1.83437 1.35474

It crashes with the following error:

>>> import plams
>>> mol = plams.Molecule("ref_structures/ac10_product.xyz")
>>> mol.guess_bonds()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/lars/workspace/plams/src/scm/plams/core/basemol.py", line 731, in guess_bonds
    val, o, r, at1, at2 = heapq.heappop(heap)
TypeError: unorderable types: Atom() < Atom()

Error importing NetworkX

In the last commit, I suppose that you guys forgot to include networkx in the list of requirements defined in the setup.py file. Could you please fix it?

I'm getting the following error in the unit tests of pyZacros (https://github.com/SCM-NV/pyZacros/runs/4254074416?check_suite_focus=true):

/usr/share/miniconda/lib/python3.6/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
__init__.py:24: in <module>
    __all__ = __autoimport(__path__[0], ['core','utils'])
__init__.py:16: in __autoimport
    tmp = __import__(imp, globals=globals(), fromlist=['*'], level=1)
core/ZacrosJob.py:7: in <module>
    import scm.plams
/usr/share/miniconda/lib/python3.6/site-packages/scm/plams/__init__.py:21: in <module>
    __all__ = __autoimport(__path__[0], ['core', 'mol', 'interfaces', 'tools', 'recipes','trajectories'])
/usr/share/miniconda/lib/python3.6/site-packages/scm/plams/__init__.py:13: in __autoimport
    tmp = __import__(imp, globals=globals(), fromlist=['*'], level=1)
/usr/share/miniconda/lib/python3.6/site-packages/scm/plams/mol/identify.py:4: in <module>
    import networkx
E   ModuleNotFoundError: No module named 'networkx'

Add an interface to cclib

The cclib package (cclib.github.io) interfaces with over a dozen quantum chemical formats (including ADF), supplying a variety of properties.

I'd suggest adding support for extracting data from cclib-parsed files, since this would greatly increase the range of output files.

Restart fails when pickling failed

I ran into a case where pickling of one job failed (due to maximum recursion depth exceeded while calling a Python object), but for all other jobs it succeeded. Restarting fails in that case as depickling the dill file is not possible. I propose to catch this error, such that the restart continues. This one job needs to be recalculated, but other results can be reused.

typos in https://www.scm.com/doc/plams/interfaces/cp2k.html

As for the example of Setting written in the documents of PLAMS: https://www.scm.com/doc/plams/interfaces/cp2k.html, there are some typoes. This example isn't compatible with the latest version (e.g., 9.1) of cp2k.


penta.input.force_eval.subsys.kind.C.basis_set = "GTH-PBE-Q4"
penta.input.force_eval.subsys.kind.H.basis_set = "GTH-PBE-q1"
--------------->
penta.input.force_eval.subsys.kind.C.potential = "GTH-PBE-Q4"
penta.input.force_eval.subsys.kind.H.potential = "GTH-PBE-q1"


penta.input.['global'].print_level = "low"
penta.input.['global'].project = "example"
penta.input.['global'].run_type = "energy_force"
--------------->
penta.input['global'].print_level = "low"
penta.input['global'].project = "example"
penta.input['global'].run_type = "energy_force"

3.------------
penta.input.force_eval.subsys.cell.A = [16.11886919, 0.07814137, -0.697284243]
penta.input.force_eval.subsys.cell.B = [-0.215317662, 4.389405268, 1.408951791]
penta.input.force_eval.subsys.cell.C = [-0.216126961, 1.732808365, 9.74896108]
------------->
penta.input.force_eval.subsys.cell.A = '16.11886919 0.07814137 -0.697284243'
penta.input.force_eval.subsys.cell.B = '-0.215317662 4.389405268 1.408951791'
penta.input.force_eval.subsys.cell.C = '-0.216126961 1.732808365 9.74896108'

4------------
penta.input.force_eval.qs.method = "GPW"
penta.input.force_eval.scf.eps_scf = 1e-6
penta.input.force_eval.scf.max_scf = 200
penta.input.force_eval.xc.xc_functional = "PBE"
-------------->
penta.input.force_eval.dft.qs.method = "GPW"
penta.input.force_eval.dft.scf.eps_scf = 1e-6
penta.input.force_eval.dft.scf.max_scf = 200
penta.input.force_eval.dft.xc['&xc_functional'] = "PBE \n &END"

"C-Mat" Not recognized...

Hi all,

Version: ADF 2018.103
Issue: "C-Mat", "C-MATRIX", "C-MAT" not recognized by PLAMS engine
Instance: When I have the line
job.settings.input.SOLVATION.CMat = 'POT' (line 25)

I get as failure reason in the .out file for any given simulation from ADF:

 *******************************************************************************

 ADF EXIT called
 Input error: Unrecognized keyword 'cmat' in block 'solvation'
Similar valid keywords:
-  'c-mat' in block 'solvation'

When I switch to using something like "C-MAT" or "c-mat", my PLAMS script fails in the Python compiler, returning the following traceback:
Execution interrupted by the following exception: SyntaxError: can't assign to operator (input, line 25)
Please describe, or document at least, how you are supposed to call the C-MATRIX computation method under COSMO solvation settings. Thank you.

Not Running with Python <3.6

Line 22 in plams/interfaces/molecule/rdkit.py uses ModuleNotFoundError which is only added in Python 3.6. Therefore PLAMS cannot run with any version lower than that.
Edit: Seems like it pops up in more than one place....

This is bad since many users are restricted to the Python Version from the OS.

No Backwards Compatibility in ADF Interface for KFFiles

Hey,

in interfaces/adfsuite/adf.py in line 140, the code uses the 'General', 'user input' section to be read for recreation of settings from a t21-File. This section seems to have changed name from the 2017 to 2018 Version of ADF. So no files from previous releases can be read using this method.

I tried fixing it with an option to read the 'General', 'Input' (thats the name in 2017) if the above fails, but then there are following errors that I cannot solve ('End missing' even though its there).

Would be helpful to have that changed.
Thanks!
Patrick

_full_runscript bug

The following script does not work as it should,

from scm.plams import *
import os

init()

myMol = Molecule('NBO.xyz')

settings = Settings()
settings.input.XC.GGA = 'BLYP'
settings.input.BASIS.type = 'DZP'

myJob = ADFJob(molecule=myMol, settings=settings)

@add_to_class(ADFJob)
def postrun(self):
        ret = os.system(""" "$ADFBIN/adfnbo" << eor
        write
        spherical
        nbo-analysis
        eor

        "$ADFBIN/gennbo6" FILE47

        "$ADFBIN/adfnbo" <<eor
        spherical
        fock
        read
        end input
        eor
        """)
        return

print(myJob.get_runscript())
print(myJob.get_input())
print(myJob._full_runscript())

myJob.run()

finish()

The last print statement returns:

[17:44:49] PLAMS working folder: /home/enicolas/test/plams.12752
Traceback (most recent call last):
  File "test.py", line 33, in <module>
    print(myJob._full_runscript())
  File "/sara/sw/adf2017.103/scripting/plams/src/scm/plams/core/basejob.py", line 347, in _full_runscript
    ret = self.settings.runscript.shebang +'\n\n'
  File "/sara/sw/adf2017.103/scripting/plams/src/scm/plams/core/settings.py", line 262, in merge
    ret.soft_update(other)
  File "/sara/sw/adf2017.103/scripting/plams/src/scm/plams/core/settings.py", line 205, in soft_update
    if isinstance(other[name], Settings):
TypeError: string indices must be integers

Any idea?

How to include dependencies...

Hello all,

I do not see this documented, but how would I go about including a dependency file in a PLAMS script? For example, I have posted the run script below from an ADF 2018 simulation.

#! /bin/sh

# dependency: ".minus" ".minus.t21"
# dependency: ".plus" ".plus.t21"
"$ADFBIN/adf" <<eor
:: # dependency: ".minus" ".minus.t21"
:: # dependency: ".plus" ".plus.t21"
GUIBONDS
END

SYMMETRY NOSYM

BASIS
type DZ
core Large
createoutput None
END

NOPRINT LOGFILE
BADER ENERGY Reactivity 

AROMATICITY
END
TOTALENERGY
EXTENDEDPOPAN

eor

"$ADFBIN/adfreport" ".t21" fukui-minus-plus-bader

How would I include the above "#" dependencies? As environment variables in the batch script that calls the PLAMS Pythonic script? Or in the PLAMS Pythonic script itself?

Thank you.

No selftests for PLAMS ?

Guys,

don't you plan to add some self-tests of the library ?

Something what would test preparing inputs and extracting data from ADF, DIRAC outputs.

TypeError: 'encoding' is an invalid keyword argument for this function

Greetings,

I just installed release version of plams. I am trying to run it with Dirac, but got stopped with this error:

[email protected]:~/Work/qch/software/My_scripts/local_runs/gsi_de/lxir_nodes/dirac/dirac4grid_runs/plams/.plams plams_run.py
Traceback (most recent call last):
  File "/u/milias/Work/qch/software/plams_python_lib/PLAMS/bin/plams", line 38, in <module>
    with open(input_file, 'r', encoding='utf-8') as f:
TypeError: 'encoding' is an invalid keyword argument for this function
[email protected]:~/Work/qch/software/My_scripts/local_runs/gsi_de/lxir_nodes/dirac/dirac4grid_runs/plams/.python -V
Python 2.7.9
[email protected]:~/Work/qch/software/My_scripts/local_runs/gsi_de/lxir_nodes/dirac/dirac4grid_runs/plams/.plams --version
PLAMS 1.2
[email protected]:~/Work/qch/software/My_scripts/local_runs/gsi_de/lxir_nodes/dirac/dirac4grid_runs/plams/.

No module named 'scm.csh'

Importing the Atom and/or Bond modules seems to yield a ModuleNotFoundError originating from scm.plams.recipes.cshadf.py.

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-6ca67d656312> in <module>
----> 1 from FOX.classes.multi_mol import MultiMolecule
/nfs/home1/frazac/escience/FOX/auto-FOX/FOX/__init__.py in <module>
    11 )
    12
---> 13 from .classes import (
    14     MultiMolecule,
    15     MonteCarlo,
/nfs/home1/frazac/escience/FOX/auto-FOX/FOX/classes/__init__.py in <module>
----> 1 from .multi_mol import MultiMolecule
     2 from .monte_carlo import MonteCarlo
     3 from .molecule_utils import Molecule
     4
     5 __all__ = [

/nfs/home1/frazac/escience/FOX/auto-FOX/FOX/classes/multi_mol.py in <module>
     9 from scipy.spatial.distance import cdist
    10
---> 11 from scm.plams import (Atom, Bond)
    12
    13 from .molecule_utils import Molecule
~/miniconda3/envs/FOX/lib/python3.7/site-packages/scm/plams/__init__.py in <module>
    19
    20
---> 21 __all__ = __autoimport(__path__[0], ['core', 'mol', 'interfaces', 'tools', 'recipes'])
~/miniconda3/envs/FOX/lib/python3.7/site-packages/scm/plams/__init__.py in __autoimport(path, folders)
    11             for module in modules:
    12                 imp = '.'.join(relpath + [module])
---> 13                 tmp = __import__(imp, globals=globals(), fromlist=['*'], level=1)
    14                 if hasattr(tmp, '__all__'):
    15                     ret += tmp.__all__
~/miniconda3/envs/FOX/lib/python3.7/site-packages/scm/plams/recipes/cshadf.py in <module>
     1 import numpy as np
----> 2 from scm.csh import CSHessian
     3
     4 from ..core.basejob import MultiJob
     5 from ..core.errors import JobError

Settings.ignore_missing() and multi-threading

Settings.ignore_missing() being called by multiple threads can lead to some rather problematic behaviour.

The example below will work just fine:

>>> s = Settings(...)
>>> with s.ignore_missing():
...     results = job.run(settings=s, ...)

But if Settings.ignore_missing() is called somewhere down the stack of Job.run() then exiting the context manager in thread #i will do the same in all other threads (as Settings.ignore_missing() modifies the Settings class, not the instance).

plams_defaults

The user that are not using all the SCM scripting environment can install Plams from github like:
pip install https://github.com/SCM-NV/plams/tarball/master#egg=plams --upgrade
For instance, this is the way that is installed in qmworks.

Problem is that the user must defined the PLAMSDEFAULTS environmental variable pointing to the
plams_defaults module. This module is not in include in the installation.

Therefore I proposed to include this module inside the folder containing the source code.

Note: Of course the user can clone the repo, but remember that most of our user are non-programmers.

Job names starting with '-' will result in grep_output() failing

Steps to reproduce:
Name a job '-something', run, try to do job.results.grep_output('some string').
Resulting error:

grep: invalid option -- '.'

Proposed fix:

diff --git a/src/scm/plams/core/results.py b/src/scm/plams/core/results.py
index 485b9d3..f3c782a 100644
--- a/src/scm/plams/core/results.py
+++ b/src/scm/plams/core/results.py
@@ -358,7 +358,7 @@ class Results(object):
         filename = filename.replace('$JN', self.job.name)
         if filename in self.files:
             try:
-                output = subprocess.check_output(command + [filename], cwd=self.job.path)
+                output = subprocess.check_output(command + ['./'+filename], cwd=self.job.path)
             except subprocess.CalledProcessError:
                 return []
             output = string(output)

Plams can't read PDB files

There are several problems with the PDB reader of Plams:

  • It does not follow the PDB conventions about the cartesian coordinates, see the Atom field record. Plams is reading the wrong columns.
  • The element type may not exist.

Query MultiJob results

Dear PLAMS developers,

I was wondering if I am constructing an AMS MultiJob and results in the right direction:

job1 = AMSJob(molecule=mol, settings=sett)
job2 = AMSJob(molecule=mol, settings=sett2)
job_list=[job1, job2]
multijob=MultiJob()
multijob.children=job_list

# Run job:
results_multijob = multijob.run()

If so, how can I query e.g. the results for job1 (with get_energy and the sort)?
Thanks!

Path to orca job

Dear All,

Lately I am having issues with running orca job and find out that it is a problem with defining of path to ORCA.

Before, .run file for orca has a full path " /hpc/sw/orca-3.0.3/bin/orca a.in" and it worked fine. But now .run file reads like " orca a.in" and I am getting a following error.
"8 total processes failed to start
ORCA finished by error termination in ORCA_GTOInt".

We need to provide full path to orca job to make it work (earlier version is better). Other option is "orca a.in" in .run file can be replaced by "$ORCA_BINDIR/orca".

Kind regards,
Satesh

Circular import error while using PLAMS

Hi SCM,

I have updated my local branch to catch up with new developments. After the 'git pull' and a successful install 'python setup.py install', I have the following error in one recipe trying to import the library:

> from scm.plams import *

> ---------------------------------------------------------------------------
> ImportError                               Traceback (most recent call last)
> <ipython-input-2-e8bc99e0fde1> in <module>
> ----> 1 from scm.plams import *
> 
> ~/Programs/miniconda3/envs/osp/lib/python3.9/site-packages/plams-1.5.1-py3.9.egg/scm/plams/__init__.py in <module>
>      19 
>      20 
> ---> 21 __all__ = __autoimport(__path__[0], ['core', 'mol', 'interfaces', 'tools', 'recipes','trajectories'])
>      22 
>      23 __version__ = '1.5.1'
> 
> ~/Programs/miniconda3/envs/osp/lib/python3.9/site-packages/plams-1.5.1-py3.9.egg/scm/plams/__init__.py in __autoimport(path, folders)
>      11             for module in modules:
>      12                 imp = '.'.join(relpath + [module])
> ---> 13                 tmp = __import__(imp, globals=globals(), fromlist=['*'], level=1)
>      14                 if hasattr(tmp, '__all__'):
>      15                     ret += tmp.__all__
> 
> ~/Programs/miniconda3/envs/osp/lib/python3.9/site-packages/plams-1.5.1-py3.9.egg/scm/plams/recipes/pestools/optimizer.py in <module>
>      13 from scm.plams import FileError
>      14 from scm.plams import PlamsError
> ---> 15 from scm.plams import AMSWorkerPool
>      16 from scm.plams import AMSWorker
>      17 from scm.plams import JobRunner
> 
> ImportError: cannot import name 'AMSWorkerPool' from partially initialized module 'scm.plams' (most likely due to a circular import) (/Users/plopez/Programs/miniconda3/envs/osp/lib/python3.9/site-packages/plams-1.5.1-py3.9.egg/scm/plams/__init__.py)

Do you know how I can solve the issue?

Thanks,
Pablo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.