Skip to content

Commit

Permalink
black formating
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonkoehn committed Oct 14, 2024
1 parent 5437e0e commit 38c6dc9
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lollipop/cli/deconvolute.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _get_location_data(
class DeconvBootstrapsArgsNoSeed(TypedDict):
"""Arguments for the deconvolute bootstrap function.
_deconvolute_bootstrap_
n_cores : int
The number of cores to use for parallel processing,
(Only used for all locastion progress bar parr/sequc)
Expand Down Expand Up @@ -105,6 +105,7 @@ class DeconvBootstrapsArgsNoSeed(TypedDict):
namefield: str
The column to use as 'names' for the entries in the tally table.
"""

n_cores: int
location: str
loc_df: pd.DataFrame
Expand All @@ -125,18 +126,22 @@ class DeconvBootstrapsArgsNoSeed(TypedDict):
confint_name: str
namefield: str


class DeconvBootstrapsArgs(DeconvBootstrapsArgsNoSeed):
"""
Arguments for the deconvolute bootstrap function.
_deconvolute_bootstrap_wrapper_
child_seed: np.random.SeedSequence
seed for the given location
"""

child_seed: np.random.SeedSequence


def _deconvolute_bootstrap_wrapper(args : DeconvBootstrapsArgs) -> Callable[[DeconvBootstrapsArgsNoSeed], List[pd.DataFrame]]:
def _deconvolute_bootstrap_wrapper(
args: DeconvBootstrapsArgs,
) -> Callable[[DeconvBootstrapsArgsNoSeed], List[pd.DataFrame]]:
"""
Wrapper for the deconvolute bootstrap function to allow for parallel processing,
handling the random number generator seeding.
Expand All @@ -151,9 +156,7 @@ def _deconvolute_bootstrap_wrapper(args : DeconvBootstrapsArgs) -> Callable[[Dec
return _deconvolute_bootstrap(args)


def _deconvolute_bootstrap(
args : DeconvBootstrapsArgsNoSeed
) -> List[pd.DataFrame]:
def _deconvolute_bootstrap(args: DeconvBootstrapsArgsNoSeed) -> List[pd.DataFrame]:
"""
Deconvolute the data for a given location and bootstrap iteration.
Expand Down Expand Up @@ -704,14 +707,14 @@ def deconvolute(
# CORE DECONVOLUTION
# iterate over locations
# Create delayed objects for each location
args_list : List[DeconvBootstrapsArgs] = [
args_list: List[DeconvBootstrapsArgs] = [
{
"n_cores": n_cores,
"location": location,
"loc_df": loc_df,
"bootstrap": bootstrap,
"locations_list": locations_list,
"no_loc": no_loc,
"no_loc": no_loc,
"no_date": no_date,
"date_intervals": date_intervals,
"var_dates": var_dates,
Expand Down

0 comments on commit 38c6dc9

Please sign in to comment.