Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allclose_raise gives ambiguous error message for keys in different order #594

Open
sirmarcel opened this issue Apr 29, 2024 · 0 comments
Open
Labels
Operations Related to metatensor-operations in Python

Comments

@sirmarcel
Copy link
Contributor

When using allclose_raise to compare two identical TensorMaps where the keys are in different order, an error like the following is raised:

metatensor.torch.operations._utils.NotEqualError: the tensor maps have different keys: inputs to 'allclose' should have the same keys names, got '[o3_lambda, o3_sigma, center_type, neighbor_type]' and '[o3_lambda, center_type, neighbor_type, o3_sigma]'

This is confusing, since the keys are the same -- they're just not in the same order. The easiest fix would be to change the message to "should have the same keys names and the same order". The more convenient fix would be to normalise the order of the keys before comparison.

@Luthaf Luthaf added the Operations Related to metatensor-operations in Python label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Operations Related to metatensor-operations in Python
Projects
None yet
Development

No branches or pull requests

2 participants