Skip to content

Using numpy 2.4.1 conversion of likelihood value from 1D array with 1 entry to scalar fails, causes examples to fail #137

@lisa-gm

Description

@lisa-gm

Update in numpy going from version 2.3.3 to 2.4.1 in how to turn a 1D array with 1 entry into a scalar. This causes an error in evaluating the likelihood in line 719 in dalia.py where

likelihood: float = float(self.model.evaluate_likelihood(eta=eta))

saying

TypeError: only 0-dimensional arrays can be converted to Python scalars

This can be resolved using

likelihood.item()

either in model.py line 711 directly or in dalia.py where this is relevant. It seems backward compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Unexpected BehaviorThe issue describe a bug encountered at runtime. The issue should describe how to reproduce the bug.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions