Skip to content

Commit

Permalink
Some typing and docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtarzia committed Mar 7, 2024
1 parent f5dcc73 commit a23f210
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 34 deletions.
68 changes: 35 additions & 33 deletions tests/molecular/molecules/building_block/case_data.py
Original file line number Diff line number Diff line change
@@ -1,54 +1,56 @@
import stk


class CaseData:
"""
A test case.
Attributes:
building_block:
The building block, which will be written to a file, so
that it can be initialized from it.
Attributes
----------
building_block : :class:`.BuildingBlock`
The building block to test.
functional_groups : :class:`tuple` of :class:`.FunctionalGroup`
The functional groups :attr:`.building_block` should be
holding.
functional_groups:
The functional groups :attr:`.building_block` should be
holding.
known_repr : str
The representation of the building block.
core_atom_ids : :class:`tuple` of :class:`int`
The correct core atom ids for :attr:`.building_block`.
known_repr:
The representation of the building block.
placer_ids : :class:`tuple` of :class:`int`
The correct *placer* ids for :attr:`.building_block`.
core_atom_ids:
The correct core atom ids for :attr:`.building_block`.
placer_ids:
The correct *placer* ids for :attr:`.building_block`.
"""

def __init__(
self,
building_block,
functional_groups,
known_repr,
core_atom_ids,
placer_ids,
):
building_block: stk.BuildingBlock,
functional_groups: tuple,
known_repr: str,
core_atom_ids: tuple[int, ...],
placer_ids: tuple[int, ...],
) -> None:
"""
Initialize a :class:`.CaseData` instance.
Parameters
----------
building_block : :class:`.BuildingBlock`
The building block to test.
Parameters:
building_block:
The building block, which will be written to a file, so
that it can be initialized from it.
functional_groups : :class:`tuple` of :class:`.FunctionalGroup`
The functional groups `building_block` should be holding.
functional_groups:
The functional groups :attr:`.building_block` should be
holding.
known_repr : str
The representation of the building block.
known_repr:
The representation of the building block.
core_atom_ids : :class:`tuple` of :class:`int`
The correct core atom ids for `building_block`.
core_atom_ids:
The correct core atom ids for :attr:`.building_block`.
placer_ids : :class:`tuple` of :class:`int`
The correct *placer* ids for `building_block`.
placer_ids:
The correct *placer* ids for :attr:`.building_block`.
"""

Expand Down
4 changes: 3 additions & 1 deletion tests/molecular/molecules/building_block/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# Fixtures need be visible for lazy_fixture() calls.
from .fixtures import * # noqa

from .case_data import CaseData


@pytest.fixture(
params=(
Expand All @@ -17,7 +19,7 @@
lazy_fixture("init_from_rdkit_mol"),
),
)
def case_data(request):
def case_data(request) -> CaseData:
"""
A :class:`.CaseData` instance.
Expand Down

0 comments on commit a23f210

Please sign in to comment.