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

Fix dependencies (#7) and 'ignore_prior' argument #8

Merged
merged 3 commits into from
Jan 30, 2025
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
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
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ build-backend = "setuptools.build_meta"

[project]
name = "prospect-public"
version = "24.0.2"
version = "25.0.0"
requires-python = ">3.10.0"
authors = [
{ name="Emil Brinch Holm", email="[email protected]"},
{ name="Thomas Tram", email="[email protected]"},
]
dependencies = [
"numpy>=2.0",
"matplotlib>=3.4",
"scipy>=1.5",
"getdist>=1.3",
"PyYAML>=5.1"
]
description = "A profile likelihood code for frequentist cosmological parameter inference"
readme = "README.md"
classifiers = [
Expand Down