Skip to content

Commit 4db8ed6

Browse files
fix: remove unnecessary shallow copy
1 parent e6c5b1a commit 4db8ed6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pymc/sampling/mcmc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ def _sample_external_nuts(
309309
nuts_sampler_kwargs: dict | None,
310310
**kwargs,
311311
):
312-
nuts_sampler_kwargs = nuts_sampler_kwargs.copy()
313312
if nuts_sampler_kwargs is None:
314313
nuts_sampler_kwargs = {}
315314

@@ -339,6 +338,7 @@ def _sample_external_nuts(
339338
UserWarning,
340339
)
341340
compile_kwargs = {}
341+
nuts_sampler_kwargs = nuts_sampler_kwargs.copy()
342342
for kwarg in ("backend", "gradient_backend"):
343343
if kwarg in nuts_sampler_kwargs:
344344
compile_kwargs[kwarg] = nuts_sampler_kwargs.pop(kwarg)
@@ -687,7 +687,6 @@ def sample(
687687
mean sd hdi_3% hdi_97%
688688
p 0.609 0.047 0.528 0.699
689689
"""
690-
nuts_sampler_kwargs = nuts_sampler_kwargs.copy()
691690
if "start" in kwargs:
692691
if initvals is not None:
693692
raise ValueError("Passing both `start` and `initvals` is not supported.")

0 commit comments

Comments
 (0)