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

Extend Base.isapprox instead of defining cr_isapprox #26

Merged
merged 1 commit into from
Apr 29, 2019
Merged

Conversation

ararslan
Copy link
Member

Currently in the testing utilities we define an internal cr_isapprox function that mimics isapprox except we only accept a subset of the keyword arguments accepted by isapprox. Instead, we can just define methods for isapprox on ChainRules-defined types for the purposes of testing. That way we can more easily take arbitrary keyword arguments and get Test's special-cased pretty printing for @test a ≈ b.

Currently in the testing utilities we define an internal `cr_isapprox`
function that mimics `isapprox` except we only accept a subset of the
keyword arguments accepted by `isapprox`. Instead, we can just define
methods for `isapprox` on ChainRules-defined types for the purposes of
testing. That way we can more easily take arbitrary keyword arguments
and get Test's special-cased pretty printing for `@test a ≈ b`.
@ararslan
Copy link
Member Author

Coverage change is bogus; I didn't touch anything in src/.

Copy link
Member

@willtebbutt willtebbutt left a comment

Choose a reason for hiding this comment

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

LGTM. I can't honestly remember why I didn't just extend Base.isapprox in the first place. Hopefully just an oversight on my part.

@ararslan
Copy link
Member Author

Well we can always revert if we find that this wrecks things horribly 😄

@ararslan ararslan merged commit c5fd246 into master Apr 29, 2019
@ararslan ararslan deleted the aa/isapprox branch April 29, 2019 19:32
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.

None yet

2 participants