Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Better testing #384

Open
valentinsulzer opened this issue Apr 29, 2021 · 3 comments
Open

Better testing #384

valentinsulzer opened this issue Apr 29, 2021 · 3 comments

Comments

@valentinsulzer
Copy link
Contributor

Currently most tests are of the form

@test a  b atol=0.01

which uses the L2-norm and so can give errors even if the vectors are equal within tol elementwise (L-inf norm). (Linf(x) <= L2(x) <= sqrt(n)Linf(x))
Should we be testing instead

@test all(isapprox.(a, b, rtol = 0.01))

? Or do we really want to test the L2 norm?

See https://discourse.julialang.org/t/unit-test-equality-for-arrays/8138/13

@ChrisRackauckas
Copy link
Member

Element-wise testing is probably better.

@valentinsulzer
Copy link
Contributor Author

So using that isapprox? Or is there a cleaner way?

@ChrisRackauckas
Copy link
Member

Broadcasted isapprox is the right idea.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants