raysect / source

The main source repository for the Raysect project.
http://www.raysect.org
BSD 3-Clause "New" or "Revised" License
88 stars 23 forks source link

Add vector functions to function framework. #356

Closed jacklovell closed 4 years ago

jacklovell commented 4 years ago

Initial support is for VectorFunction2D. It's based on Function2D, but when evaluated these functions return a Vector3D instead of a double. Constant and auto wrapping are also provided. Arithmetic methods are provided, but only for operands which are supported by Vector3D cython methods (add, sub, mul, div).

I'm just uploading the 2D case to begin with, to keep the PR manageable. Once this is approved, I'll add the 1D and 3D functions too.

This PR was motivated by https://github.com/cherab/core/pull/214/

jacklovell commented 4 years ago

@CnlPepper would you mind giving this a review?

CnlPepper commented 4 years ago

Sorry been distracted lately, I'll have a look asap.

CnlPepper commented 4 years ago

I'm going to merge this into the feature/function branch and make the base class changes we need to prevent invalid functions being converted to python wrapped functions.

jacklovell commented 4 years ago

OK. I think there were only a few other changes to make, including adding comments to some of the dunder methods. I can pick it up again after you've made any changes you want (if you feel there are any changes still needed).