Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide the ability for KBMOD to run from a WorkUnit #375

Merged
merged 5 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions notebooks/KBMOD_Demo.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -185,8 +184,8 @@
" \"average_angle\": 0.0,\n",
"}\n",
"\n",
"rs = run_search(input_parameters)\n",
"rs.run_search()"
"rs = SearchRunner()\n",
"rs.run_search(input_parameters)"
]
},
{
Expand Down
18 changes: 18 additions & 0 deletions src/kbmod/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,24 @@ def set(self, param, value, strict=True):
else:
self._params[param] = value

def set_multiple(self, overrides, strict=True):
"""Sets multiple parameters from a dictionary.

Parameters
----------
overrides : `dict`
A dictionary of parameter->value to overwrite.
strict : `bool`
Raise an exception on unknown parameters.

Raises
------
Raises a ``KeyError`` if any parameter is not part on the list of known parameters
and ``strict`` is False.
"""
for key, value in overrides.items():
self.set(key, value)

def validate(self):
"""Check that the configuration has the necessary parameters.

Expand Down
Loading