Skip to content

Commit

Permalink
enhance typing for deconvolute function
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonkoehn committed Oct 14, 2024
1 parent 3c5a732 commit 5a41b23
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions lollipop/cli/deconvolute.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""Implements the deconvolute command for the lollipop CLI."""

import sys
from typing import List, Tuple, Union
from typing import List, Tuple, Union, TypedDict
import logging
import time
import multiprocessing
Expand Down Expand Up @@ -65,13 +65,13 @@ def _deconvolute_bootstrap_wrapper(args):
handling the random number generator seeding.
"""

# Unpack the arguments
*other_args, child_seed = args
# Get the seed
child_seed = args.pop("child_seed")

# Initialize the default random number generator with the child seed
np.random.default_rng(child_seed)

return _deconvolute_bootstrap(*other_args)
return _deconvolute_bootstrap(**args)


def _deconvolute_bootstrap(
Expand Down Expand Up @@ -663,28 +663,28 @@ def deconvolute(
# iterate over locations
# Create delayed objects for each location
args_list = [
(
n_cores,
location,
loc_df,
bootstrap,
locations_list,
no_loc,
no_date,
date_intervals,
var_dates,
kernel,
kernel_params,
regressor,
regressor_params,
confint,
confint_params,
deconv_params,
have_confint,
confint_name,
namefield,
child_seed,
)
{
"n_cores" : n_cores,
"location" : location,
"loc_df" : loc_df,
"bootstrap" : bootstrap,
"locations_list" : locations_list,
"no_loc" : no_loc,
"no_date" : no_date,
"date_intervals" : date_intervals,
"var_dates" : var_dates,
"kernel" : kernel,
"kernel_params" : kernel_params,
"regressor" : regressor,
"regressor_params" : regressor_params,
"confint" : confint,
"confint_params" : confint_params,
"deconv_params" : deconv_params,
"have_confint" : have_confint,
"confint_name" : confint_name,
"namefield" : namefield,
"child_seed" : child_seed,
}
for location, loc_df, child_seed in zip(locations_list, loc_dfs, seeds)
]

Expand Down

0 comments on commit 5a41b23

Please sign in to comment.