Skip to content

Commit

Permalink
Update docs location (#311)
Browse files Browse the repository at this point in the history
* Update README.md

* pydantic pin, changelog update

* clear up numpy deprecation

* actually commit

* clear skips and warnings

* need lower bound?

* reorganize extras

* modern scipy?

* syntax

* sep scipy

* tidy
  • Loading branch information
loriab authored Jul 31, 2023
1 parent f7e404c commit 965a764
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 23 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.7", "3.11"]
python-version: ["3.7", "3.9", "3.11"]
pydantic-version: ["1", "2"]

steps:
Expand All @@ -31,9 +32,13 @@ jobs:
- name: Sed replace pydantic on repo
run: |
sed -i 's/^pydantic *= *">*= *\([0-9.]*\)"/pydantic = "^\1"/' pyproject.toml
if: ${{ matrix.pydantic-version == 1 }}
- name: Install repo with poetry
run: poetry install --no-interaction --no-ansi
if: matrix.pydantic-version == '1'
- name: Install repo with poetry (full deps)
if: matrix.python-version != '3.9'
run: poetry install --no-interaction --no-ansi --all-extras
- name: Install repo with poetry (min deps)
if: matrix.python-version == '3.9'
run: poetry install --no-interaction --no-ansi --extras test
- name: Run tests
run: poetry run pytest -rws -v --cov=qcelemental --color=yes --cov-report=xml
- name: Upload coverage to Codecov
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

[![Build Status](https://github.com/MolSSI/QCElemental/workflows/CI/badge.svg?branch=master)](https://github.com/MolSSI/QCElemental/actions?query=workflow%3ACI)
[![codecov](https://img.shields.io/codecov/c/github/MolSSI/QCElemental.svg?logo=Codecov&logoColor=white)](https://codecov.io/gh/MolSSI/QCElemental)
[![Documentation Status](https://img.shields.io/github/workflow/status/MolSSI/QCElemental/CI/master?label=docs&logo=readthedocs&logoColor=white)](http://docs.qcarchive.molssi.org/projects/qcelemental/en/latest/)
[![Documentation Status](https://img.shields.io/github/actions/workflow/status/MolSSI/QCElemental/CI.yaml?label=docs&logo=readthedocs&logoColor=white)](https://molssi.github.io/QCElemental/)
[![Chat on Slack](https://img.shields.io/badge/chat-on_slack-green.svg?longCache=true&style=flat&logo=slack)](https://join.slack.com/t/qcarchive/shared_invite/enQtNDIzNTQ2OTExODk0LTE3MWI0YzBjNzVhNzczNDM0ZTA5MmQ1ODcxYTc0YTA1ZDQ2MTk1NDhlMjhjMmQ0YWYwOGMzYzJkZTM2NDlmOGM)
![python](https://img.shields.io/badge/python-3.7+-blue.svg)

**Documentation:** [Read The Docs](http://docs.qcarchive.molssi.org/projects/qcelemental/en/latest/index.html)
**Documentation:** [GitHub Pages](https://molssi.github.io/QCElemental/)

Core data structures for Quantum Chemistry. QCElemental also contains physical constants and periodic table data from NIST and molecule handlers.

Expand Down
30 changes: 28 additions & 2 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Changelog
=========

.. X.Y.0 / 2022-MM-DD
.. X.Y.0 / 2023-MM-DD
.. -------------------
..
.. Breaking Changes
Expand All @@ -22,6 +22,22 @@ Unreleased
Breaking Changes
++++++++++++++++

New Features
++++++++++++

Enhancements
++++++++++++

Bug Fixes
+++++++++


0.26.0 / 2023-07-31
-------------------

Breaking Changes
++++++++++++++++

- (:pr:`308`) Fix CI Pipelines. Dropped Python3.6. Bring CI pipelines into harmony with local dev experience. Lint and format entire code base. Accelerate CI pipelines. Update setup.py to correctly define extras packages. Breaking change due to dropped support for Python3.6. No code functionality was altered.
- Dropped support for dead Python 3.6. Minimum supported Python is now 3.7.
- Updated CONTRIBUTING.md to contain detailed instructions for developers on how to contribute.
Expand All @@ -36,12 +52,22 @@ Enhancements
- (:pr:`310`) Modernize DevOps Tooling
- Added `/scripts` directory to root of project that contains scripts for testing, formatting code, and building docs.
- Updated build system from `setuptools` to modern `pyproject.toml` specification using `poetry` for the build backend.
- Removed complicated versioning code in favor of single source of truth in `pyproject.toml`. Using standard library `importlib` for looking up package version in `__init__.py` file.
- Removed complicated versioning code in favor of single source of truth in `pyproject.toml`. Using standard library `importlib` for looking up package version in `__init__.py` file.
- Added `build_docs.sh` script to `/scrips` and removed `Makefile` from `/docs`. Flattened `/docs` file structure.
- Removed `travis-ci` code from `devtools`
- Removed LGTM code (they no longer exist as a project).
- Bring all package directories under `black`, `isort`, and `autoflake` control.

Bug Fixes
+++++++++
- (:pr:`305`) Initialize `Molecule.extras` as empty dictionary.
- (:pr:`311`) Update docs location from RTD to GH pages. Resolve escape char warnings. Update changelog.
- (:pr:`311`) Clear up NumPy "Conversion of an array with ndim > 0 to a scalar is deprecated" in
`util.measure_coordinates` called by `Molecule.measure`.
- (:pr:`314`) Import `pydantic.v1` from pydantic v2 so that QCElemental can work with any >=1.8.2 pydantic
until QCElemental is updated for v2.


0.25.1 / 2022-10-31
-------------------

Expand Down
21 changes: 14 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "qcelemental"
version = "0.25.1"
version = "0.26.0"
description = "Core data structures for Quantum Chemistry."
authors = ["The QCArchive Development Team <qcarchive@molsii.org>"]
authors = ["The QCArchive Development Team <qcarchive@molssi.org>"]
license = "BSD-3-Clause"
readme = "README.md"
homepage = "https://github.com/MolSSI/QCElemental"
Expand All @@ -32,12 +32,20 @@ numpy = [
python = "^3.7"
pint = ">=0.10.0"
pydantic = ">=1.8.2"
nglview = { extras = ["viz"], version = "^3.0.3" }
ipykernel = { version = "<6.0.0", extras = ["viz"] }
nglview = { version = "^3.0.3", optional = true }
ipykernel = { version = "<6.0.0", optional = true }
importlib-metadata = { version = ">=4.8", python = "<3.8" }
networkx = { version = "<3.0", extras = ["align"] }
pytest = { extras = ["test"], version = "^7.2.2" }
networkx = { version = "<3.0", optional = true }
scipy = [
{ version = ">=1.6.0", python = "<3.9", optional = true },
{ version = ">=1.9.0", python = ">=3.9", optional = true },
]
pytest = { version = "^7.2.2", optional = true }

[tool.poetry.extras]
viz = ["nglview", "ipykernel"]
align = ["networkx", "scipy"]
test = ["pytest"]

[tool.poetry.group.dev.dependencies]
black = ">=23.1.0"
Expand All @@ -62,7 +70,6 @@ sphinx-autodoc-typehints = "^1.22"
line-length = 120
target-version = ['py37']


[tool.isort]
force_grid_wrap = 0
include_trailing_comma = true
Expand Down
6 changes: 3 additions & 3 deletions qcelemental/models/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ class AtomicResultProperties(ProtoModel):
nuclear_repulsion_energy: Optional[float] = Field(None, description="The nuclear repulsion energy.")
return_energy: Optional[float] = Field(
None,
description="The energy of the requested method, identical to :attr:`~qcelemental.models.AtomicResult.return_result` for :attr:`~qcelemental.models.AtomicInput.driver`\ =\ :attr:`~qcelemental.models.DriverEnum.energy` computations.",
description=f"The energy of the requested method, identical to :attr:`~qcelemental.models.AtomicResult.return_result` for :attr:`~qcelemental.models.AtomicInput.driver`\\ =\\ :attr:`~qcelemental.models.DriverEnum.energy` computations.",
)
return_gradient: Optional[Array[float]] = Field(
None,
description="The gradient of the requested method, identical to :attr:`~qcelemental.models.AtomicResult.return_result` for :attr:`~qcelemental.models.AtomicInput.driver`\ =\ :attr:`~qcelemental.models.DriverEnum.gradient` computations.",
description=f"The gradient of the requested method, identical to :attr:`~qcelemental.models.AtomicResult.return_result` for :attr:`~qcelemental.models.AtomicInput.driver`\\ =\\ :attr:`~qcelemental.models.DriverEnum.gradient` computations.",
units="E_h/a0",
)
return_hessian: Optional[Array[float]] = Field(
None,
description="The Hessian of the requested method, identical to :attr:`~qcelemental.models.AtomicResult.return_result` for :attr:`~qcelemental.models.AtomicInput.driver`\ =\ :attr:`~qcelemental.models.DriverEnum.hessian` computations.",
description=f"The Hessian of the requested method, identical to :attr:`~qcelemental.models.AtomicResult.return_result` for :attr:`~qcelemental.models.AtomicInput.driver`\\ =\\ :attr:`~qcelemental.models.DriverEnum.hessian` computations.",
units="E_h/a0^2",
)

Expand Down
1 change: 1 addition & 0 deletions qcelemental/tests/test_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ def test_molecule_repeated_hashing():
([0, 1, 2, 3], 180.0),
([[0, 1, 2, 3]], [180.0]),
([[1, 3], [3, 1], [1, 2, 3]], [6.3282716, 6.3282716, 149.51606694803903]),
([[0, 1, 2, 3], [3, 2, 1, 0]], [180.0, 180.0]),
],
)
def test_measurements(measure, result):
Expand Down
8 changes: 4 additions & 4 deletions qcelemental/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def test_unnp(inp, expected):
def test_distance():
def _test_distance(p1, p2, value):
tmp = qcel.util.compute_distance(p1, p2)
assert compare_values(value, float(tmp))
assert compare_values(value, tmp[0])

_test_distance([0, 0, 0], [0, 0, 1], 1.0)
_test_distance([0, 0, 0], [0, 0, 0], 0.0)
Expand All @@ -160,7 +160,7 @@ def _test_distance(p1, p2, value):
def test_angle():
def _test_angle(p1, p2, p3, value, degrees=True):
tmp = qcel.util.compute_angle(p1, p2, p3, degrees=degrees)
assert compare_values(value, float(tmp))
assert compare_values(value, tmp[0])

# Check all 90 degree domains
p1 = [5, 0, 0]
Expand Down Expand Up @@ -194,7 +194,7 @@ def _test_angle(p1, p2, p3, value, degrees=True):
def test_dihedral1():
def _test_dihedral(p1, p2, p3, p4, value, degrees=True):
tmp = qcel.util.compute_dihedral(p1, p2, p3, p4, degrees=degrees)
assert compare_values(value, float(tmp), label="test_dihedral1")
assert compare_values(value, tmp[0], label="test_dihedral1")

p1 = [0, 0, 0]
p2 = [0, 2, 0]
Expand Down Expand Up @@ -231,7 +231,7 @@ def test_dihedral2():

def _test_dihedral(p1, p2, p3, p4, value, degrees=True):
tmp = qcel.util.compute_dihedral(p1, p2, p3, p4, degrees=degrees)
assert compare_values(value, float(tmp), label="test_dihedral1")
assert compare_values(value, tmp[0], label="test_dihedral1")

p0 = [24.969, 13.428, 30.692]
p1 = [24.044, 12.661, 29.808]
Expand Down
2 changes: 1 addition & 1 deletion qcelemental/util/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def measure_coordinates(coordinates, measurements, degrees=False):
raise KeyError(f"Unrecognized number of arguments for measurement {num}, found {len(m)}, expected 2-4.")

val = func(*[coordinates[x] for x in m], **kwargs)
ret.append(float(val))
ret.append(val[0])

if single:
return ret[0]
Expand Down

0 comments on commit 965a764

Please sign in to comment.