PCMSolver / pcmsolver

An API for the Polarizable Continuum Model
http://pcmsolver.readthedocs.io/
GNU Lesser General Public License v3.0
32 stars 21 forks source link

help internal pyparsing import #160

Closed loriab closed 6 years ago

loriab commented 6 years ago

Motivation and Context

Even if PYTHONPATH includes pcmsolver, when getkw tries to import pyparsing, it doesn't find it alongside b/c the interior of pcmsolver module isn't in PYTHONPATH. Thus all psi tests fail. Now getkw knows where to find pyparsing.

Here's what the pre-fix error looks like:

(p4dev36) psilocaluser@bash:psinet:/home/psilocaluser/gits/hrw-qcdb/objdir36: ((detached from matt/SYMM_JK)) stage/usr/local/psi4/bin/psi4 ../tests/pcmsolver/scf/input.dat 
Traceback (most recent call last):
  File "stage/usr/local/psi4/bin/psi4", line 238, in <module>
    content = psi4.process_input(content)
  File "/home/psilocaluser/gits/hrw-qcdb/objdir36/stage/usr/local/psi4/lib/psi4/driver/inputparser.py", line 734, in process_input
    temp = re.sub(pcm, process_pcm_command, temp)
  File "/home/psilocaluser/toolchainconda/envs/p4dev36/lib/python3.6/re.py", line 191, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "/home/psilocaluser/gits/hrw-qcdb/objdir36/stage/usr/local/psi4/lib/psi4/driver/inputparser.py", line 398, in process_pcm_command
    import pcmsolver
  File "/home/psilocaluser/toolchainconda/envs/p4dev36/lib//python3.6/site-packages/pcmsolver/__init__.py", line 24, in <module>
    from .pcmparser import parse_pcm_input
  File "/home/psilocaluser/toolchainconda/envs/p4dev36/lib//python3.6/site-packages/pcmsolver/pcmparser.py", line 47, in <module>
    from .getkw import Section, GetkwParser
  File "/home/psilocaluser/toolchainconda/envs/p4dev36/lib//python3.6/site-packages/pcmsolver/getkw.py", line 22, in <module>
    from pyparsing import \
ModuleNotFoundError: No module named 'pyparsing'

How Has This Been Tested?

All the pcm tests in psi4 work when pcmsolver module itself is in PYTHONPATH after these changes.

Types of changes

Questions

Status

MinazoBot commented 6 years ago
1 Error
:no_entry_sign: Code style violations detected.
2 Warnings
:warning: There are code changes, but no corresponding tests. Please include tests if this PR introduces any modifications in behavior.
:warning: Please update CHANGELOG.md with a description of your changes. If this PR is not a user-facing change (e.g. just refactoring), you can disregard this.

Code Style Check


Code style violations detected in the following files:

Execute one of the following actions and commit again:

  1. Run yapf on the offending files
  2. Apply the suggested patches with git apply patch.

tools/py3.x-getkw.py

--- tools/py3.x-getkw.py
+++ tools/py3.x-getkw.py
@@ -649,7 +649,7 @@
                     pass
                 elif len(arg) != k.nargs:
                     print("Invalid number of elements for key '%s',\
-line: %d" % (name, lineno(self.loc, self.strg)))
+line: %d"          % (name, lineno(self.loc, self.strg)))
                     print("  -> %d required, %d given." % (k.nargs, len(arg)))
                     if strict:
                         sys.exit(1)

Here's an example of a CHANGELOG.md entry:

* [#160](https://github.com/PCMSolver/pcmsolver/pull/160): help internal pyparsing import - [@loriab](https://github.com/loriab)

Generated by :no_entry_sign: Danger

codecov[bot] commented 6 years ago

Codecov Report

Merging #160 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #160   +/-   ##
=======================================
  Coverage   70.01%   70.01%           
=======================================
  Files          92       92           
  Lines        5592     5592           
=======================================
  Hits         3915     3915           
  Misses       1677     1677

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0664b57...b7bbb5c. Read the comment docs.