Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix docs after models refactor #23

Merged
merged 6 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions docs/qcschema.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,29 @@
<!-- ==== Inputs ================================================================= -->

::: qcmanybody.models.BsseEnum
options:
show_root_heading: true


::: qcmanybody.models.ManyBodyKeywords
options:
show_root_heading: true

$pydantic: qcmanybody.models.manybody_pydv1.ManyBodyKeywords
$pydantic: qcmanybody.models.manybody_input_pydv1.ManyBodyKeywords


::: qcmanybody.models.manybody_pydv1.ManyBodySpecification
::: qcmanybody.models.ManyBodySpecification
options:
show_root_heading: true

$pydantic: qcmanybody.models.manybody_pydv1.ManyBodySpecification
$pydantic: qcmanybody.models.manybody_input_pydv1.ManyBodySpecification


::: qcmanybody.models.ManyBodyInput
options:
show_root_heading: true

$pydantic: qcmanybody.models.manybody_pydv1.ManyBodyInput
$pydantic: qcmanybody.models.manybody_input_pydv1.ManyBodyInput


<!-- ==== Protocols ============================================================== -->
Expand All @@ -31,16 +33,27 @@ $pydantic: qcmanybody.models.manybody_pydv1.ManyBodyInput
::: qcmanybody.models.manybody_pydv1.ManyBodyProtocolEnum


::: qcmanybody.models.manybody_pydv1.ManyBodyProtocols
::: qcmanybody.models.manybody_input_pydv1.ManyBodyProtocols
options:
show_root_heading: true

$pydantic: qcmanybody.models.manybody_pydv1.ManyBodyProtocols
$pydantic: qcmanybody.models.manybody_input_pydv1.ManyBodyProtocols
-->


<!-- ==== Properties/Outputs ===================================================== -->

!!! note

The properties model is generated dynamically based on a constant
``MAX_NBODY``. To not overload the docs table, this is set to 5, which
covers full calculations on tetramers. To use a larger
``ManyBodyKeywords.max_nbody``, reset this value.

import qcmanybody as qcmb
qcmb.models.MAX_NBODY = 8


::: qcmanybody.models.ManyBodyResultProperties
options:
show_root_heading: true
Expand Down Expand Up @@ -90,7 +103,3 @@ SuccessfulResultBase
- copy
-->

::: qcmanybody.resize_gradient
options:
show_root_heading: true

3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ plugins:

markdown_extensions:
- mdantic_v1
- admonition
- pymdownx.details
- pymdownx.superfences

nav:
- Home: index.md
Expand Down
1 change: 1 addition & 0 deletions qcmanybody/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
FragBasIndex,
ManyBodyInput,
ManyBodyKeywords,
ManyBodySpecification,
)
from .manybody_output_pydv1 import (
ManyBodyResult,
Expand Down
46 changes: 1 addition & 45 deletions qcmanybody/qcng_computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,34 +534,7 @@ def get_results(self, external_results: Dict, client: Optional["qcportal.Fractal
pp.pprint(qcvars)

for qcv, val in qcvars.items():
if isinstance(val, dict):
if qcv in [
# #"energies", # retired
# #"ptype", # retired
# "intermediates",
# "intermediates_energy", #"intermediates2",
# "intermediates_gradient", #"intermediates_ptype",
# "intermediates_hessian", #"intermediates_ptype",
# "energy_body_dict",
# "gradient_body_dict", # ptype_body_dict
# "hessian_body_dict", # ptype_body_dict
# "nbody",
# "cp_energy_body_dict",
# "nocp_energy_body_dict",
# "vmfc_energy_body_dict",
# "cp_gradient_body_dict",
# "nocp_gradient_body_dict",
# "vmfc_gradient_body_dict",
# "cp_hessian_body_dict",
# "nocp_hessian_body_dict",
# "vmfc_hessian_body_dict",
]:
for qcv2, val2 in val.items():
# try:
qcvars[str(qcv2)] = val2
# except ValidationError:
# obj.set_variable(f"{self.driver.name} {qcv2}", val2)
else:
if not isinstance(val, dict):
qcvars[qcv] = val

# v2: component_results = self.model_dump()['task_list'] # TODO when/where include the indiv outputs
Expand Down Expand Up @@ -593,23 +566,6 @@ def get_results(self, external_results: Dict, client: Optional["qcportal.Fractal
return nbody_model





def lab_delabeler(item: str, return_obj: bool = False) -> Union[Tuple[str, str, str], Tuple[int, Tuple[int], Tuple[int]]]:
"""Transform labels like string "1_((2,), (1, 2))" into string tuple ("1", "2", "1, 2") or
object tuple (1, (2,), (1, 2)).

"""
mc, _, fragbas = item.partition("_")
frag, bas = literal_eval(fragbas)

if return_obj:
return int(mc), frag, bas
else:
return mc, ", ".join(map(str, frag)), ", ".join(map(str, bas))


qcvars_to_manybodyproperties = {}
# v2: for skprop in ManyBodyResultProperties.model_fields.keys():
for skprop in ManyBodyResultProperties.__fields__.keys():
Expand Down
Loading