Skip to content

Commit

Permalink
Unpack using '**'
Browse files Browse the repository at this point in the history
  • Loading branch information
DrYak committed Nov 22, 2024
1 parent f12934c commit 9f0127f
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 @@ -157,10 +157,32 @@ def _deconvolute_bootstrap_wrapper(
# Initialize the default random number generator with the child seed
np.random.default_rng(child_seed)

return _deconvolute_bootstrap(args)


def _deconvolute_bootstrap(args: DeconvBootstrapsArgsNoSeed) -> List[pd.DataFrame]:
# Unpack the arguments
return _deconvolute_bootstrap(**args)


def _deconvolute_bootstrap(
n_cores: int,
par_bar: int,
location: str,
loc_df: pd.DataFrame,
bootstrap: int,
locations_list: List,
no_loc: bool,
no_date: bool,
date_intervals: List[Tuple],
var_dates: dict,
kernel: Union[ll.GaussianKernel, ll.BoxKernel],
kernel_params: dict,
regressor: Union[ll.NnlsReg, ll.RobustReg],
regressor_params: dict,
confint: Union[ll.confints.NullConfint, ll.confints.WaldConfint],
confint_params: dict,
deconv_params: dict,
have_confint: bool,
confint_name: str,
namefield: str,
) -> List[pd.DataFrame]:
"""
Deconvolute the data for a given location and bootstrap iteration.
Expand All @@ -175,28 +197,6 @@ def _deconvolute_bootstrap(args: DeconvBootstrapsArgsNoSeed) -> List[pd.DataFram
The deconvolution results for the location and bootstrap iterations.
"""

# Unpack the arguments
n_cores = args["n_cores"]
par_bar = args["par_bar"]
location = args["location"]
loc_df = args["loc_df"]
bootstrap = args["bootstrap"]
locations_list = args["locations_list"]
no_loc = args["no_loc"]
no_date = args["no_date"]
date_intervals = args["date_intervals"]
var_dates = args["var_dates"]
kernel = args["kernel"]
kernel_params = args["kernel_params"]
regressor = args["regressor"]
regressor_params = args["regressor_params"]
confint = args["confint"]
confint_params = args["confint_params"]
deconv_params = args["deconv_params"]
have_confint = args["have_confint"]
confint_name = args["confint_name"]
namefield = args["namefield"]

# monitor the number of threads, to prevent oversubscription on blas / cluster systmes
controller = ThreadpoolController()
logging.info(f"Threading configuration:\n {controller.info()}")
Expand Down

1 comment on commit 9f0127f

@gordonkoehn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Way more elegant. Definitely more readable and concise.

Please sign in to comment.