Skip to content

Commit

Permalink
Added 'ignore_prior' kernel argument, NB false by default
Browse files Browse the repository at this point in the history
  • Loading branch information
EBHolm authored and ebh-incom committed Jan 30, 2025
1 parent dd6f433 commit 3f8770f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
11 changes: 10 additions & 1 deletion prospect/kernels/base_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ def __init__(self, config_kernel, task_id, output_folder=None):
self.set_default_errors()
self.id = task_id
self.initialise(config_kernel, output_folder)

if config_kernel.ignore_prior:
self.logprior = lambda x: 0.0

self.param = {
'varying': {},
Expand Down Expand Up @@ -109,7 +112,7 @@ def logprior(self, position):
pass

def logpost(self, position):
return self.loglkl(position)*self.logprior(position)
return self.loglkl(position) + self.logprior(position)

@abstractmethod
def get_default_initial_position(self):
Expand Down Expand Up @@ -178,9 +181,15 @@ class debug(InputArgument):
val_type = bool
def get_default(self, config_yaml: dict[str, Any]):
return False

class ignore_prior(InputArgument):
val_type = bool
def get_default(self, config_yaml: dict[str, Any]):
return False

type: type
param: param
conf: conf
path: path
debug: debug
ignore_prior: ignore_prior
3 changes: 0 additions & 3 deletions prospect/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,3 @@ def validate(self, config: dict[str, Any]) -> None:
start_from_covmat: start_from_covmat
start_from_position: start_from_position
start_from_profile: start_from_profile



1 change: 0 additions & 1 deletion prospect/tasks/initialise_profile_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from prospect.input import Configuration
from prospect.tasks.base_task import BaseTask
from prospect.tasks.initialise_optimiser_task import InitialiseOptimiserTask
from prospect.tasks.initialise_optimiser_task import InitialiseOptimiserTask

class InitialiseProfileTask(BaseTask):
"""
Expand Down

0 comments on commit 3f8770f

Please sign in to comment.