Add rich comparison operators to FunctionxD#324
Add rich comparison operators to FunctionxD#324CnlPepper merged 4 commits intoraysect:developmentfrom
Conversation
|
Thanks Jack, I only just noticed the email about this merge request. I'll have look through asap. |
|
No worries. I won't be doing any more work on this until #326 is merged, then I'll rebase off of that. I really only want to know whether you agree with the approach taken here. |
6b7b298 to
8ac9175
Compare
|
@CnlPepper I've updated this PR with the new wrapping behaviour, and also addressed all the other comments I remember from our discussion on Wednesday. This is now ready for a preliminary review, and if you're happy with it then I'll add the 1D and 3D cases. |
|
Hi Jack, sorry for the delay. I'll have a look through later this afternoon/evening if I can. |
8ac9175 to
2a2f7e7
Compare
|
No worries. I've just rebased this onto the latest development (with sqrt and erf), hence the force push. No other changes yet. |
CnlPepper
left a comment
There was a problem hiding this comment.
Few more tweaks, happy to commit once they are done.
Enable arithmetic comparison operations between FunctionxD objects and python callables, which return 1.0 if the comparison returns True, or 0.0 if the comparison returns false.
2a2f7e7 to
12f101e
Compare
This enables taking the absolute value of a Function2D object. The Function2D/Function2D rich comparison unit test has been modified to take advantage of this.
|
Are you planning to add the 1D and 3D implementations in this merge request or will these follow in a separate request? |
|
I was planning to add the 1D and 3D implementations in this merge request on Monday morning. But if you want to merge this and add them yourself before then don't let me stop you! |
|
He he, oh I'm happy to wait for Monday. :) |
|
@CnlPepper I've added the 1D and 3D cases. This is now ready for review and merge. |
|
Thanks @jacklovell |
Add rich comparison operators to FunctionxD
Enable arithmetic comparison operations between FunctionxD objects,
which return 1.0 if the comparison returns True, or 0.0 if the
comparison returns false.
At the moment I've only implemented the 2D operators, so we can discuss the implementation before I go ahead and add the 1D and 3D ones. The pull request would end up being too large to properly review otherwise.
Also, should these features still be based off the feature/function branch? Or is the function framework sufficiently stable that we can add new functions straight to the development branch?