Skip to content

Sklearn agents need to sort when independents are 1 dimensional. #56

@maffettone

Description

@maffettone

This issue pops up in a number of places in the sklearn library and anywhere sort is used. For ndim>0, you will get a The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

https://github.com/bluesky/bluesky-adaptive/blob/184c15645f5ecf660e3a21bb54d06758a98b9148/bluesky_adaptive/agents/sklearn.py#L163C5-L171C10

arr = np.array([
    obs for ind, obs in sorted(
        zip(self.independent_cache, self.observable_cache),
        key=lambda pair: tuple(pair[0])
    )
])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions