Skip to content

Commit

Permalink
Merge pull request #375 from dirac-institute/workunit3
Browse files Browse the repository at this point in the history
Provide the ability for KBMOD to run from a WorkUnit
  • Loading branch information
jeremykubica authored Oct 17, 2023
2 parents 4dceefb + b5caac3 commit 3c5916d
Show file tree
Hide file tree
Showing 8 changed files with 288 additions and 182 deletions.
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

0 comments on commit 3c5916d

Please sign in to comment.