Skip to content

Commit

Permalink
overzealous autodocs removal (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
loriab committed Jun 9, 2022
1 parent 3766e37 commit 60934f3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Enhancements
++++++++++++
- (:pr:`285`) Standardized default on ``AtomicResult.native_files`` to ``{}``
from ``None``.
- (:pr:`289`) Transition from some early documentation tools (class
- (:pr:`289`, :pr:`290`) Transition from some early documentation tools (class
``AutodocBaseSettings`` and ``qcarchive_sphinx_theme``) to externally
maintained ones (project https://github.com/mansenfranzen/autodoc_pydantic
and ``sphinx_rtd_theme``). Expand API docs.
Expand Down
1 change: 1 addition & 0 deletions qcelemental/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from . import types
from .align import AlignmentMill
from .basemodels import AutodocBaseSettings # remove when QCFractal merges `next`
from .basemodels import ProtoModel
from .basis import BasisSet
from .common_models import ComputeError, DriverEnum, FailedOperation, Provenance
Expand Down
11 changes: 10 additions & 1 deletion qcelemental/models/basemodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
from typing import Any, Dict, Optional, Set, Union

import numpy as np
from pydantic import BaseModel, BaseSettings
from pydantic import BaseSettings # remove when QCFractal merges `next`
from pydantic import BaseModel

from qcelemental.util import deserialize, serialize
from qcelemental.util.autodocs import AutoPydanticDocGenerator # remove when QCFractal merges `next`


def _repr(self) -> str:
Expand All @@ -23,6 +25,7 @@ class Config:

def __init_subclass__(cls, **kwargs) -> None:
super().__init_subclass__(**kwargs)
cls.__base_doc__ = "" # remove when QCFractal merges `next`

if "pydantic" in cls.__repr__.__module__:
cls.__repr__ = _repr
Expand Down Expand Up @@ -188,4 +191,10 @@ def compare(self, other: Union["ProtoModel", BaseModel], **kwargs) -> bool:
return compare_recursive(self, other, **kwargs)


# remove when QCFractal merges `next`
class AutodocBaseSettings(BaseSettings):
def __init_subclass__(cls) -> None:
cls.__doc__ = AutoPydanticDocGenerator(cls, always_apply=True)


qcschema_draft = "http://json-schema.org/draft-04/schema#"

0 comments on commit 60934f3

Please sign in to comment.