Skip to content

Conversation

@L-in-da
Copy link
Contributor

@L-in-da L-in-da commented Apr 11, 2025

Solves the following issue:

from datamate import Namespace
import numpy as np

config1 = Namespace(
    a=np.float64(1.0),
)
config2 = Namespace(
    a=1.0,
)
print(config1 == config2)  

The comparison raises the error: TypeError: all True of type <class 'numpy.bool'>: vars() argument must have __dict__ attribute.

For more details, see discussion in #20
Closes #20

@L-in-da L-in-da requested a review from lappalainenj April 11, 2025 10:02
Copy link
Collaborator

@lappalainenj lappalainenj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@lappalainenj lappalainenj merged commit d69005b into flyvis:main Apr 11, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Comparing Namespace objects containing numpy types fails unexpectedly

2 participants