Skip to content

Commit a18461d

Browse files
authored
Suppress warning and fix docs warnings for 0.50.0rc2 (#390)
* Add nglview import with ModuleNotFoundError handling Add optional import for nglview with error handling. * Add version check for warning on import * extras * replace magic number * rm autodoc-typehints * capitalize docs * lc again
1 parent 8255bfa commit a18461d

File tree

13 files changed

+51
-45
lines changed

13 files changed

+51
-45
lines changed

docs/changelog.rst

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,37 @@ Changelog
1919
.. Misc.
2020
.. +++++
2121
22-
0.50.0rc2 / 2026-XX-XX (Unreleased)
23-
----------------------------------------------------------------------------
22+
.. _`sec:cl0500rc2`:
2423

25-
`Docs <https://MolSSI.github.io/QCElemental/next/>`_
26-
`Docs for QCSchema v1<https://MolSSI.github.io/QCElemental/v0.30.2/>`_
24+
0.50.0rc2 / 2026-02-17
25+
----------------------
2726

28-
Breaking Changes
29-
++++++++++++++++
27+
:docs:`v0.50.0rc2` for current. :docs:`v0.30.2` for QCSchema v1.
3028

3129
Breaking Changes (low impact)
3230
+++++++++++++++++++++++++++++
33-
- (:pr:`382`) Remove CPU (`ProcessorInfo` and `ProcessorContext`) and DFT info (`DFTFunctionalInfo` and `DFTFunctionalContext`) classes and functionality
34-
- (:pr:`388`) Molecule: Fix imports, typing, `@property` logic, printing of float multiplicity, and returning `type(self)` to handle derived classes
35-
- (:pr:`389`) Remove the QCElemental pydantic autodoc module (`util.autodocs` module, classes `AutoPydanticDocGenerator` and `AutodocBaseSettings`)
36-
37-
New Features
38-
++++++++++++
39-
31+
- (:pr:`382`, :pr:`383`) Remove CPU (`ProcessorInfo` and `ProcessorContext`) and DFT info
32+
(`DFTFunctionalInfo` and `DFTFunctionalContext`) classes and functionality
33+
- (:pr:`389`) Remove the QCElemental pydantic autodoc module (`util.autodocs` module, classes
34+
`AutoPydanticDocGenerator` and `AutodocBaseSettings`)
4035

4136
Enhancements
4237
++++++++++++
38+
- (:pr:`390`) Removed the "Imports will provide non-functional placeholders" FutureWarning for <py314
39+
- (:pr:`390`) Added `qcelemental.models.QCEL_V1V2_SHIM_CODE` as magic var to signal returning `_v1v2` model.
40+
- (:pr:`390`)) Removed sphinx-autodoc-typehints
41+
- (:pr:`388`) Molecule: Fix imports, typing, `@property` logic (exp. `connectivity`, printing of
42+
float multiplicity, and returning `type(self)` to handle derived classes
4343
- (:pr:`385`) Start building docs for QCSchema v2 models.
44+
If downstream docs builds are complaining about `dtype` here, add `os.environ["SPHINX_BUILD"] = "1"`
45+
to Sphinx conf.py
46+
Note that this changes intersphinx links. Below is current (for next2026).
47+
48+
.. code:: python
49+
50+
"qcelemental": ("https://molssi.github.io/QCElemental/next/", None),
51+
"qcengine": ("https://molssi.github.io/QCEngine/next/", None),
52+
"qcfractal": ("https://docs.qcarchive.molssi.org/", None),
4453
4554
4655
.. _`sec:cl0500rc1`:

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
"sphinx_automodapi.automodapi",
5959
"sphinx_automodapi.automodsumm",
6060
"sphinx_automodapi.smart_resolver",
61-
"sphinx_autodoc_typehints",
6261
"sphinxcontrib.autodoc_pydantic",
6362
]
6463

@@ -200,6 +199,7 @@ def setup(app):
200199
extlinks = {
201200
"issue": ("https://github.com/MolSSI/QCElemental/issues/%s", "GH#%s"),
202201
"pr": ("https://github.com/MolSSI/QCElemental/pull/%s", "GH#%s"),
202+
"docs": ("https://MolSSI.github.io/QCElemental/%s", "Docs %s"),
203203
}
204204

205205

@@ -211,8 +211,8 @@ def setup(app):
211211
"numpy": ("https://numpy.org/doc/stable/", None),
212212
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
213213
"matplotlib": ("https://matplotlib.org/stable/", None),
214-
"qcengine": ("https://molssi.github.io/QCEngine/", None),
215-
"qcfractal": ("https://molssi.github.io/QCFractal/", None),
214+
"qcengine": ("https://molssi.github.io/QCEngine/next", None),
215+
"qcfractal": ("https://docs.qcarchive.molssi.org/", None),
216216
"nglview": ("https://nglviewer.org/nglview/release/v2.7.7", None),
217217
}
218218

docs/model_td.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ TorsionDriveSpecification
3434
.. autopydantic_model:: qcelemental.models.v2.TorsionDriveSpecification
3535
:noindex:
3636

37-
.. autofunction:: qcelemental.models.v2.TorsionDriveSpecification.convert_v
38-
:noindex:
39-
4037
TorsionDriveKeywords
4138
~~~~~~~~~~~~~~~~~~~~
4239

@@ -49,9 +46,6 @@ TorsionDriveProtocols
4946
.. autopydantic_model:: qcelemental.models.v2.TorsionDriveProtocols
5047
:noindex:
5148

52-
.. autofunction:: qcelemental.models.v2.TorsionDriveProtocols.convert_v
53-
:noindex:
54-
5549
TorsionDriveProperties
5650
~~~~~~~~~~~~~~~~~~~~~~
5751

docs/models.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Note that the QCElemental reference implementation here is more up-to-date than
77
These models use `Pydantic <https://pydantic-docs.helpmanual.io>`_
88
as their base to provide serialization, validation, and manipulation.
99

10-
.. note:: QCSchema v2 is documented here. `Docs for QCSchema v1<https://MolSSI.github.io/QCElemental/v0.30.2/>`_
10+
.. note:: QCSchema v2 is documented here. Docs for QCSchema v1 at :docs:`v0.30.2` .
1111

1212
Basics
1313
------

pyproject.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ dependencies = [
3737
"numpy; python_version <'3.14'",
3838
"numpy >=2.3.3; python_version >='3.14'",
3939
"pint >=0.24",
40-
"pydantic >=2.0; python_version <'3.14'",
41-
"pydantic >=2.12; python_version >='3.14'",
40+
"pydantic >=2.12",
4241
]
4342

4443
[project.optional-dependencies]
@@ -75,11 +74,8 @@ docs = [
7574
"sphinx >=7.0.0",
7675
"sphinxcontrib-napoleon",
7776
"sphinx-rtd-theme",
78-
"autodoc-pydantic",
77+
"autodoc-pydantic >2.0",
7978
"sphinx-automodapi",
80-
"sphinx-autodoc-typehints",
81-
"pydantic",
82-
"pydantic-settings",
8379
]
8480

8581
#[tool.poetry.dependencies]

qcelemental/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
import sys
1010

11+
QCEL_V1V2_SHIM_CODE = -12
12+
1113
from . import v1, v2
1214
from .v1 import *
1315

qcelemental/models/_v1v2/basemodels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ def check_convertible_version(ver: int, error: str):
33

44
if ver in [1, 2]:
55
return True
6-
elif ver == -12:
6+
elif ver == QCEL_V1V2_SHIM_CODE:
77
return "self"
88
else:
99
raise ValueError(f"QCSchema {error} version={ver} does not exist for conversion.")

qcelemental/models/v1/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828

2929
# Warn on import so users see the incompatibility when they explicitly import v1
3030
# Use FutureWarning (visible by default) so users notice the issue during import
31-
warnings.warn(_MSG, FutureWarning, stacklevel=2)
31+
if sys.version_info >= (3, 14):
32+
warnings.warn(_MSG, FutureWarning, stacklevel=2)
3233

3334

3435
def _make_placeholder(name: str):

qcelemental/models/v2/atomic.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import numpy as np
66
from pydantic import Field, field_validator
77

8+
from ...models import QCEL_V1V2_SHIM_CODE
89
from ...util import provenance_stamp
910
from .basemodels import ExtendedConfigDict, ProtoModel, check_convertible_version, qcschema_draft
1011
from .basis_set import BasisSet
@@ -595,12 +596,12 @@ def convert_v(
595596
return self
596597

597598
dself = self.model_dump()
598-
if target_version in [1, -12]:
599+
if target_version in [1, QCEL_V1V2_SHIM_CODE]:
599600
dself["basis"] = self.basis.convert_v(target_version).dict()
600601

601602
if target_version == 1:
602603
self_vN = qcel.models.v1.WavefunctionProperties(**dself)
603-
elif target_version == -12:
604+
elif target_version == QCEL_V1V2_SHIM_CODE:
604605
self_vN = qcel.models._v1v2.WavefunctionProperties(**dself)
605606
else:
606607
assert False, target_version
@@ -769,7 +770,7 @@ def convert_v(
769770
return self
770771

771772
dself = self.model_dump()
772-
if target_version in [1, -12]:
773+
if target_version in [1, QCEL_V1V2_SHIM_CODE]:
773774
dself.pop("schema_name")
774775
dself.pop("schema_version")
775776

@@ -791,7 +792,7 @@ def convert_v(
791792

792793
if target_version == 1:
793794
self_vN = qcel.models.v1.AtomicInput(**dself)
794-
elif target_version == -12:
795+
elif target_version == QCEL_V1V2_SHIM_CODE:
795796
self_vN = qcel.models._v1v2.AtomicInput(**dself)
796797
else:
797798
assert False, target_version
@@ -980,7 +981,7 @@ def convert_v(
980981
return self
981982

982983
dself = self.model_dump()
983-
if target_version in [1, -12]:
984+
if target_version in [1, QCEL_V1V2_SHIM_CODE]:
984985

985986
# for input_data, work from model, not dict, to use convert_v
986987
dself.pop("input_data")
@@ -998,7 +999,7 @@ def convert_v(
998999

9991000
if target_version == 1:
10001001
self_vN = qcel.models.v1.AtomicResult(**dself)
1001-
elif target_version == -12:
1002+
elif target_version == QCEL_V1V2_SHIM_CODE:
10021003
self_vN = qcel.models._v1v2.AtomicResult(**dself)
10031004
else:
10041005
assert False, target_version

qcelemental/models/v2/basemodels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def check_convertible_version(ver: int, error: str):
289289
return True
290290
elif ver == 2:
291291
return "self"
292-
elif ver == -12:
292+
elif ver == QCEL_V1V2_SHIM_CODE:
293293
# signal to create the emergency _v1v2 objects defined for some models
294294
return True
295295
else:

0 commit comments

Comments
 (0)