From 38c6dc97114167658bb09bcdb6d9a2fda43adc5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gordon=20J=2E=20K=C3=B6hn?= Date: Mon, 14 Oct 2024 14:04:25 +0200 Subject: [PATCH] black formating --- lollipop/cli/deconvolute.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lollipop/cli/deconvolute.py b/lollipop/cli/deconvolute.py index b0cd960..8eacf86 100755 --- a/lollipop/cli/deconvolute.py +++ b/lollipop/cli/deconvolute.py @@ -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) @@ -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 @@ -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. @@ -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. @@ -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,