Skip to content

Commit

Permalink
fix: correct some signatures and fix PyObserver implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
denehoffman committed Oct 23, 2024
1 parent f196146 commit 64e4b37
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/laddu/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from . import amplitudes, data, utils

class Observer(metaclass=ABCMeta):
@abstractmethod
def callback(self, step: int, status: Status, expression: Expression) -> tuple[Status, Expression, bool]: ...
def callback(self, step: int, status: Status) -> tuple[Status, bool]: ...

__version__: str

Expand Down
4 changes: 2 additions & 2 deletions python/laddu/likelihoods/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ from typing import Literal
import numpy as np
import numpy.typing as npt

from laddu.amplitudes import Manager
from laddu.amplitudes import Expression, Manager
from laddu.data import Dataset

class LikelihoodID:
Expand Down Expand Up @@ -37,7 +37,7 @@ class LikelihoodEvaluator:

class NLL:
parameters: list[str]
def __init__(self, manager: Manager, ds_data: Dataset, ds_mc: Dataset) -> None: ...
def __init__(self, manager: Manager, ds_data: Dataset, ds_mc: Dataset, expression: Expression) -> None: ...
def activate(self, name: str | list[str]) -> None: ...
def activate_all(self) -> None: ...
def deactivate(self, name: str | list[str]) -> None: ...
Expand Down
2 changes: 1 addition & 1 deletion src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ impl Observer<Float, ()> for crate::python::laddu::PyObserver {
.extract::<crate::python::laddu::Status>()
.unwrap()
.0;
let result = res_tuple.get_item(2).unwrap().extract::<bool>().unwrap();
let result = res_tuple.get_item(1).unwrap().extract::<bool>().unwrap();
(new_status, result)
});
*status = new_status;
Expand Down

0 comments on commit 64e4b37

Please sign in to comment.