Skip to content

Commit

Permalink
patch-ups after review
Browse files Browse the repository at this point in the history
  • Loading branch information
loriab committed Sep 9, 2020
1 parent aadfdf0 commit b8957f1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion devtools/conda-envs/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- nomkl
- python
- pint>=0.10.0
- pydantic>=1.0.0
- pydantic>=1.5.0,!=1.6.0

# Optional depends
- msgpack-python
Expand Down
3 changes: 0 additions & 3 deletions qcelemental/models/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ class AtomicResultProperties(ProtoModel):
description="The doubles portion of the MP2 correlation energy including same-spin and opposite-spin correlations.",
units="E_h",
)
mp2_total_correlation_energy: Optional[float] = Field(
None, description="The MP2 correlation energy."
) # Old name, to be deprecated
mp2_correlation_energy: Optional[float] = Field(
None,
description="The MP2 correlation energy.",
Expand Down
2 changes: 1 addition & 1 deletion qcelemental/physical_constants/ureg.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def build_units_registry(context):
ureg.define("debye = 1e-18 * statcoulomb * cm = D")

# Distance
ureg.define("bohr = {} * meter = bohr_radius = Bohr = a0 = au_length".format(phys_const["bohr radius"]["value"]))
ureg.define("bohr = {} * meter = bohr_radius = Bohr = au_length".format(phys_const["bohr radius"]["value"]))
ureg.define("wavenumber = 1 / centimeter")
ureg.define("Angstrom = angstrom")

Expand Down
11 changes: 11 additions & 0 deletions qcelemental/tests/test_datum.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,14 @@ def test_complex_array():

dicary = datum1.dict()
assert compare_recursive(ans, dicary, 9)


def test_qc_units():
au2D = 2.541746451895025916414946904
au2Q = au2D * 0.52917721067

onedebye = qcel.Datum("CC dipole", "e a0", np.array([0, 0, 1 / au2D]))
onebuckingham = qcel.Datum("CC quadrupole", "e a0^2", np.array([0, 0, 1 / au2Q, 0, 0, 0, 0, 0, 0]).reshape((3, 3)))

assert compare_values(np.array([0, 0, 1.0]), onedebye.to_units("D"))
assert compare_values(np.array([[0, 0, 1.0], [0, 0, 0], [0, 0, 0]]), onebuckingham.to_units("D Å"))
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
package_data={'': [os.path.join('qcelemental', 'data', '*.json')]},
setup_requires=[] + pytest_runner,
python_requires='>=3.6',
install_requires=["numpy >= 1.12.0", "pint >= 0.10.0", "pydantic >= 1.5.0"],
install_requires=["numpy >= 1.12.0", "pint >= 0.10.0", "pydantic >=1.5.0,!=1.6.0"],
extras_require={
'docs': [
'numpydoc',
Expand Down

0 comments on commit b8957f1

Please sign in to comment.