Skip to content
Merged
23 changes: 23 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@ Release Notes
0.12 Series
...........

0.12.19 (2026-07-24)
--------------------

General:
Comment thread
arrjon marked this conversation as resolved.

* Add support for python 3.14
Comment thread
arrjon marked this conversation as resolved.
Outdated
* Add execution time profiling to the ABC-SMC run, reporting pure simulation time, parallel-pipeline setup, in-between-iterations
time, and within it the population size calculation and distance function
Comment thread
arrjon marked this conversation as resolved.
Outdated
adaptation. The timings are also returned by ``run_generation``.

Visualization:

* ``plot_walltime`` and ``plot_total_walltime`` now report the actual
per-generation walltimes and no longer include the idle time that passed
between a stored analysis and a later resumed run.

Storage:

* Store the per-generation walltime in the database (new ``wall_time`` column,
database version 2). Databases created with older pyABC versions must be
migrated via ``abc-migrate`` before they can be resumed; for such databases
the walltime plots fall back to the previous, end-time-based behavior.

0.12.18 (2026-04-14)
--------------------

Expand Down
20 changes: 10 additions & 10 deletions pyabc/distance/base.py
Comment thread
arrjon marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def __call__(
self,
x: dict,
x_0: dict,
t: int = None,
par: dict = None,
t: int | None = None,
par: dict | None = None,
) -> float:
"""
Evaluate at time point t the distance of the summary statistics of
Expand Down Expand Up @@ -183,8 +183,8 @@ def __call__(
self,
x: dict, # noqa: ARG002
x_0: dict, # noqa: ARG002
t: int = None, # noqa: ARG002
par: dict = None, # noqa: ARG002
t: int | None = None, # noqa: ARG002
par: dict | None = None, # noqa: ARG002
) -> float:
raise AssertionError(
f'Distance {self.__class__.__name__} should not be called.'
Expand All @@ -203,8 +203,8 @@ def __call__(
self,
x: dict, # noqa: ARG002
x_0: dict, # noqa: ARG002
t: int = None, # noqa: ARG002
par: dict = None, # noqa: ARG002
t: int | None = None, # noqa: ARG002
par: dict | None = None, # noqa: ARG002
) -> float:
return -1

Expand All @@ -224,16 +224,16 @@ class FunctionDistance(Distance):
statistics x and x_0. Returns the distance between both.
"""

def __init__(self, fun):
def __init__(self, fun: Callable):
super().__init__()
self.fun = fun

def __call__(
self,
x: dict,
x_0: dict,
t: int = None, # noqa: ARG002
par: dict = None, # noqa: ARG002
t: int | None = None, # noqa: ARG002
par: dict | None = None, # noqa: ARG002
) -> float:
return self.fun(x, x_0)

Expand All @@ -250,7 +250,7 @@ def get_config(self):
return conf

@staticmethod
def to_distance(maybe_distance: Callable | Distance) -> Distance:
def to_distance(maybe_distance: Callable | Distance | None) -> Distance:
"""
Parameters
----------
Expand Down
50 changes: 26 additions & 24 deletions pyabc/distance/pnorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(
self,
p: float = 1,
fixed_weights: dict[str, float] | dict[int, dict[str, float]] = None,
sumstat: Sumstat = None,
sumstat: Sumstat | None = None,
):
super().__init__()

Expand Down Expand Up @@ -201,8 +201,8 @@ def __call__(
self,
x: dict,
x_0: dict,
t: int = None,
par: dict = None, # noqa: ARG002
t: int | None = None,
par: dict | None = None, # noqa: ARG002
) -> float:
# extract weights for given time point
weights = self.get_weights(t=t)
Expand Down Expand Up @@ -308,14 +308,14 @@ class AdaptivePNormDistance(PNormDistance):
def __init__(
self,
p: float = 1,
initial_scale_weights: dict[str, float] = None,
fixed_weights: dict[str, float] = None,
initial_scale_weights: dict[str, float] | None = None,
fixed_weights: dict[str, float] | None = None,
fit_scale_ixs: EventIxs | Collection[int] | int = np.inf,
scale_function: Callable = None,
max_scale_weight_ratio: float = None,
scale_log_file: str = None,
scale_function: Callable | None = None,
max_scale_weight_ratio: float | None = None,
scale_log_file: str | None = None,
all_particles_for_scale: bool = True,
sumstat: Sumstat = None,
sumstat: Sumstat | None = None,
):
# call p-norm constructor
super().__init__(p=p, fixed_weights=fixed_weights, sumstat=sumstat)
Expand Down Expand Up @@ -505,25 +505,25 @@ def __init__(
self,
predictor: Predictor,
p: float = 1,
initial_scale_weights: dict[str, float] = None,
initial_info_weights: dict[str, float] = None,
fixed_weights: dict[str, float] = None,
initial_scale_weights: dict[str, float] | None = None,
initial_info_weights: dict[str, float] | None = None,
fixed_weights: dict[str, float] | None = None,
fit_scale_ixs: EventIxs | Collection | int = np.inf,
fit_info_ixs: EventIxs | Collection | int = None,
fit_info_ixs: EventIxs | Collection | int | None = None,
normalize_by_par: bool = True,
scale_function: Callable = None,
max_scale_weight_ratio: float = None,
max_info_weight_ratio: float = None,
scale_log_file: str = None,
info_log_file: str = None,
info_sample_log_file: str = None,
sumstat: Sumstat = None,
fd_deltas: list[float] | float = None,
subsetter: Subsetter = None,
scale_function: Callable | None = None,
max_scale_weight_ratio: float | None = None,
max_info_weight_ratio: float | None = None,
scale_log_file: str | None = None,
info_log_file: str | None = None,
info_sample_log_file: str | None = None,
sumstat: Sumstat | None = None,
fd_deltas: list[float] | float | None = None,
subsetter: Subsetter | None = None,
all_particles_for_scale: bool = True,
all_particles_for_prediction: bool = True,
feature_normalization: str = WEIGHTS,
par_trafo: ParTrafoBase = None,
par_trafo: ParTrafoBase | None = None,
):
"""
Parameters
Expand Down Expand Up @@ -595,7 +595,9 @@ def __init__(

self.predictor = predictor

self.initial_info_weights: dict[str, float] = initial_info_weights
self.initial_info_weights: dict[str, float] | None = (
initial_info_weights
)
self.info_weights: dict[int, np.ndarray] = {}

if fit_info_ixs is None:
Expand Down
Loading