Skip to content

Commit

Permalink
remove unused kwargs warning for samplers; update tests_samplers
Browse files Browse the repository at this point in the history
  • Loading branch information
bd-j committed Oct 1, 2024
1 parent e3182c0 commit 9334fc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions prospect/fitting/nested.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ def run_nested_sampler(model,
**{key: kwargs[key] for key in sig.kwargs.keys() & kwargs.keys()},
**run_kwargs}
run_return = sampler_run(*run_args, **run_kwargs)
for key in kwargs.keys() - (init_kwargs.keys() | run_kwargs.keys()):
warnings.warn(f"Key '{key}' not recognized by the sampler.")
#for key in kwargs.keys() - (init_kwargs.keys() | run_kwargs.keys()):
# warnings.warn(f"Key '{key}' not recognized by the sampler.")

if nested_sampler == 'nautilus':
obj = sampler
Expand Down
10 changes: 2 additions & 8 deletions tests/tests_samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from prospect.models import SpecModel, templates
from prospect.observation import Photometry
from prospect.fitting import fit_model
from prospect.fitting.nested import parse_nested_kwargs
from prospect.io.write_results import write_hdf5
from prospect.io.read_results import results_from

Expand Down Expand Up @@ -69,12 +68,6 @@ def build_obs(**kwargs):
run_params = vars(args)
run_params["param_file"] = __file__

# test the parsing
run_params["nested_sampler"] = "dynesty"
nr, ns = parse_nested_kwargs(**run_params)
print(nr)
print(ns)

# build stuff
model = build_model()
obs = build_obs()
Expand Down Expand Up @@ -120,4 +113,5 @@ def build_obs(**kwargs):
axes,
color=color,
weights= np.exp(out["log_weight"]),
show_titles=True)
show_titles=True)
cfig.savefig("sampler_test_corner.png")

0 comments on commit 9334fc9

Please sign in to comment.