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

[feature] make Curve callable with parameter value #18250

Merged
merged 2 commits into from
Jan 7, 2020

Conversation

namannimmo10
Copy link
Member

@namannimmo10 namannimmo10 commented Jan 6, 2020

References to other Issues or PRs

Closes #17997

Brief description of what is fixed or changed

Other comments

Release Notes

  • geometry
    • Add __call__ method in Class Curve.

@sympy-bot
Copy link

sympy-bot commented Jan 6, 2020

Hi, I am the SymPy bot (v149). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.6.

Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it.

Click here to see the pull request description that was parsed.

<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234". See
https://github.com/blog/1506-closing-issues-via-pull-requests . Please also
write a comment on that issue linking back to this pull request once it is
open. -->
Closes #17997

#### Brief description of what is fixed or changed


#### Other comments


#### Release Notes

<!-- Write the release notes for this release below. See
https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more information
on how to write release notes. The bot will check your release notes
automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
*  geometry
    *  Add `__call__ `method in `Class Curve`.
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@namannimmo10
Copy link
Member Author

Hi @smichr, Please review this PR!

@smichr
Copy link
Member

smichr commented Jan 6, 2020

It looks ok to me. Let's see if others have any feedback.

@codecov
Copy link

codecov bot commented Jan 6, 2020

Codecov Report

Merging #18250 into master will increase coverage by 0.035%.
The diff coverage is 100%.

@@              Coverage Diff              @@
##            master    #18250       +/-   ##
=============================================
+ Coverage   74.931%   74.966%   +0.035%     
=============================================
  Files          642       642               
  Lines       166973    167296      +323     
  Branches     39283     39370       +87     
=============================================
+ Hits        125115    125416      +301     
- Misses       36329     36344       +15     
- Partials      5529      5536        +7

@namannimmo10
Copy link
Member Author

Does that look okay to you? @oscarbenjamin @asmeurer

@oscarbenjamin
Copy link
Contributor

Does it matter that you can substitute points outside of the range?

In [6]: Curve((t, t**2), (t, 0, 10))                                                                                                           
Out[6]: Curve((t, t**2), (t, 0, 10))

In [7]: c.subs(t, 20)                                                                                                                          
Out[7]: Point2D(20, 400)

In [8]: c(20)                                                                                                                                  
Out[8]: Point2D(20, 400)

Maybe that's an unrelated point though. Adding __call__ seems fine to me.

@namannimmo10
Copy link
Member Author

Does it matter that you can substitute points outside of the range?

I don't think that matters. Those are the limits and we can substitute points outside that range.

>>> a
Curve((t, t**2), (t, 0, 10))
>>> a(20)
Point2D(20, 400)
>>> a.limits
(t, 0, 10)

@smichr It's ready now. Please merge this.

@smichr
Copy link
Member

smichr commented Jan 7, 2020

Does it matter that you can substitute points outside of the range?

That was part of the rational for issue #18254 - with such a change then using parameter from 0 to 1 on the arbitrary point would recreate the curve.

@smichr smichr merged commit f8582d7 into sympy:master Jan 7, 2020
@namannimmo10 namannimmo10 deleted the new_feature branch January 7, 2020 15:23
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.

[feature] make Curve callable with parameter value
4 participants