Skip to content

Commit

Permalink
Fixes for doc building; minor docstring updates (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebachmeier committed Aug 20, 2024
1 parent 7dba19b commit 7fb20a4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/vivarium/framework/results/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

from collections import defaultdict
from typing import Any, Callable, Generator, List, Optional, Tuple, Type, Union
from typing import Callable, Generator, List, Optional, Tuple, Type, Union

import pandas as pd
from pandas.core.groupby.generic import DataFrameGroupBy
Expand Down
2 changes: 1 addition & 1 deletion src/vivarium/framework/results/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
to a simulation.
"""

from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union
from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Union

import pandas as pd

Expand Down
2 changes: 1 addition & 1 deletion src/vivarium/framework/results/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from collections import defaultdict
from enum import Enum
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union
from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Tuple, Union

import pandas as pd

Expand Down
2 changes: 1 addition & 1 deletion src/vivarium/framework/results/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def observe(
df: Union[pd.DataFrame, DataFrameGroupBy],
stratifications: Optional[tuple[str, ...]],
) -> Optional[pd.DataFrame]:
"""Determine whether to observe the given event and, if so, gather the results."""
# """Determine whether to observe the given event and, if so, gather the results."""
if not self.to_observe(event):
return None
else:
Expand Down
23 changes: 1 addition & 22 deletions src/vivarium/framework/results/stratification.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

from dataclasses import dataclass
from typing import Any, Callable, List, Optional, Union
from typing import Callable, List, Optional, Union

import pandas as pd
from pandas.api.types import CategoricalDtype
Expand All @@ -24,27 +24,6 @@ class Stratification:
This class includes a :meth:`stratify <stratify>` method that produces an
output column by calling the mapper on the source columns.
Attributes
----------
name
Name of the stratification.
sources
A list of the columns and values needed as input for the `mapper`.
categories
Exhaustive list of all possible stratification values.
excluded_categories
List of possible stratification values to exclude from results processing.
If None (the default), will use exclusions as defined in the configuration.
mapper
A callable that maps the columns and value pipelines specified by the
`requires_columns` and `requires_values` arguments to the stratification
categories. It can either map the entire population or an individual
simulant. A simulation will fail if the `mapper` ever produces an invalid
value.
is_vectorized
True if the `mapper` function will map the entire population, and False
if it will only map a single simulant.
"""

name: str
Expand Down

0 comments on commit 7fb20a4

Please # to comment.