Skip to content

Commit 1962deb

Browse files
authored
Merge pull request #321 from raysect/feature/function
Feature/function
2 parents 0ff46d6 + 054228b commit 1962deb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3573
-200
lines changed

docs/source/api_reference/core/functions.rst

Lines changed: 97 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,121 @@
22
Functions and Interpolators
33
===========================
44

5-
.. autoclass:: raysect.core.math.function.function1d.Function1D
5+
.. autoclass:: raysect.core.math.function.function1d.base.Function1D
66
:members:
77
:special-members: __call__
88

9-
.. autoclass:: raysect.core.math.function.function1d.PythonFunction1D
9+
.. autoclass:: raysect.core.math.function.function1d.autowrap.PythonFunction1D
1010
:show-inheritance:
1111

12-
.. autoclass:: raysect.core.math.function.function2d.Function2D
12+
.. autoclass:: raysect.core.math.function.function1d.constant.Constant1D
13+
:show-inheritance:
14+
15+
.. autoclass:: raysect.core.math.function.function1d.arg.Arg1D
16+
:show-inheritance:
17+
18+
.. autoclass:: raysect.core.math.function.function1d.cmath.Exp1D
19+
:show-inheritance:
20+
21+
.. autoclass:: raysect.core.math.function.function1d.cmath.Sin1D
22+
:show-inheritance:
23+
24+
.. autoclass:: raysect.core.math.function.function1d.cmath.Cos1D
25+
:show-inheritance:
26+
27+
.. autoclass:: raysect.core.math.function.function1d.cmath.Tan1D
28+
:show-inheritance:
29+
30+
.. autoclass:: raysect.core.math.function.function1d.cmath.Asin1D
31+
:show-inheritance:
32+
33+
.. autoclass:: raysect.core.math.function.function1d.cmath.Acos1D
34+
:show-inheritance:
35+
36+
.. autoclass:: raysect.core.math.function.function1d.cmath.Atan1D
37+
:show-inheritance:
38+
39+
.. autoclass:: raysect.core.math.function.function1d.cmath.Atan4Q1D
40+
:show-inheritance:
41+
42+
.. autoclass:: raysect.core.math.function.function2d.base.Function2D
1343
:members:
1444
:special-members: __call__
1545

16-
.. autoclass:: raysect.core.math.function.function2d.PythonFunction2D
46+
.. autoclass:: raysect.core.math.function.function2d.autowrap.PythonFunction2D
47+
:show-inheritance:
48+
49+
.. autoclass:: raysect.core.math.function.function2d.constant.Constant2D
50+
:show-inheritance:
51+
52+
.. autoclass:: raysect.core.math.function.function2d.arg.Arg2D
53+
:show-inheritance:
54+
55+
.. autoclass:: raysect.core.math.function.function2d.cmath.Exp2D
56+
:show-inheritance:
57+
58+
.. autoclass:: raysect.core.math.function.function2d.cmath.Sin2D
59+
:show-inheritance:
60+
61+
.. autoclass:: raysect.core.math.function.function2d.cmath.Cos2D
1762
:show-inheritance:
1863

19-
.. autoclass:: raysect.core.math.function.function3d.Function3D
64+
.. autoclass:: raysect.core.math.function.function2d.cmath.Tan2D
65+
:show-inheritance:
66+
67+
.. autoclass:: raysect.core.math.function.function2d.cmath.Asin2D
68+
:show-inheritance:
69+
70+
.. autoclass:: raysect.core.math.function.function2d.cmath.Acos2D
71+
:show-inheritance:
72+
73+
.. autoclass:: raysect.core.math.function.function2d.cmath.Atan2D
74+
:show-inheritance:
75+
76+
.. autoclass:: raysect.core.math.function.function2d.cmath.Atan4Q2D
77+
:show-inheritance:
78+
79+
.. autoclass:: raysect.core.math.function.function3d.base.Function3D
2080
:members:
2181
:special-members: __call__
2282

23-
.. autoclass:: raysect.core.math.function.function3d.PythonFunction3D
83+
.. autoclass:: raysect.core.math.function.function3d.autowrap.PythonFunction3D
84+
:show-inheritance:
85+
86+
.. autoclass:: raysect.core.math.function.function3d.constant.Constant3D
2487
:show-inheritance:
2588

89+
.. autoclass:: raysect.core.math.function.function3d.arg.Arg3D
90+
:show-inheritance:
91+
92+
.. autoclass:: raysect.core.math.function.function3d.cmath.Exp3D
93+
:show-inheritance:
94+
95+
.. autoclass:: raysect.core.math.function.function3d.cmath.Sin3D
96+
:show-inheritance:
97+
98+
.. autoclass:: raysect.core.math.function.function3d.cmath.Cos3D
99+
:show-inheritance:
100+
101+
.. autoclass:: raysect.core.math.function.function3d.cmath.Tan3D
102+
:show-inheritance:
103+
104+
.. autoclass:: raysect.core.math.function.function3d.cmath.Asin3D
105+
:show-inheritance:
106+
107+
.. autoclass:: raysect.core.math.function.function3d.cmath.Acos3D
108+
:show-inheritance:
109+
110+
.. autoclass:: raysect.core.math.function.function3d.cmath.Atan3D
111+
:show-inheritance:
112+
113+
.. autoclass:: raysect.core.math.function.function3d.cmath.Atan4Q3D
114+
:show-inheritance:
26115

27-
.. automodule:: raysect.core.math.interpolators.discrete2dmesh
116+
.. automodule:: raysect.core.math.function.function2d.interpolate.discrete2dmesh
28117
:show-inheritance:
29118
:members:
30119

31-
.. automodule:: raysect.core.math.interpolators.interpolator2dmesh
120+
.. automodule:: raysect.core.math.function.function2d.interpolate.interpolator2dmesh
32121
:show-inheritance:
33122
:members:

docs/source/api_reference/optical/optical_surfaces.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ Dielectrics
5353
Modifiers
5454
---------
5555

56-
.. autoclass:: raysect.optical.material.Blend
56+
.. autoclass:: raysect.optical.material.modifiers.Blend
5757
:show-inheritance:
5858

59-
.. autoclass:: raysect.optical.material.Add
59+
.. autoclass:: raysect.optical.material.modifiers.Add
6060
:show-inheritance:
6161

62-
.. autoclass:: raysect.optical.material.Transform
62+
.. autoclass:: raysect.optical.material.modifiers.VolumeTransform
6363
:show-inheritance:
6464

6565
.. autoclass:: raysect.optical.material.modifiers.Roughen

docs/source/demonstrations/materials/surface_roughness.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Demonstration of the roughen material modifier. The back row is aluminium and
88
the front row is glass. The surface roughness is increased from left to right
99
from 0 to 50%.
1010

11-
.. literalinclude:: ../../../../demos/materials/material_roughness_scan.py
11+
.. literalinclude:: ../../../../demos/materials/modifiers/roughen.py
1212

1313
.. image:: surface_roughness.jpg
1414
:align: center

docs/source/demonstrations/optics/prism.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ generate adequate samples for this demonstration.
99

1010
.. literalinclude:: ../../../../demos/prism.py
1111

12-
.. image:: prism_720x405.jpg
12+
.. image:: prism_720x405.png
1313
:align: center

raysect/core/math/__init__.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ from raysect.core.math.units cimport *
3939
from raysect.core.math.statsarray cimport StatsBin, StatsArray1D, StatsArray2D, StatsArray3D
4040
from raysect.core.math.sampler cimport *
4141
from raysect.core.math.polygon cimport triangulate2d
42+

raysect/core/math/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from .quaternion import Quaternion
3737
from .transform import translate, rotate_x, rotate_y, rotate_z, rotate_vector, rotate, rotate_basis, to_cylindrical, from_cylindrical
3838
from .units import *
39-
from .interpolators import Interpolator2DMesh, Discrete2DMesh
4039
from .statsarray import StatsBin, StatsArray1D, StatsArray2D, StatsArray3D
4140
from .sampler import *
4241
from .polygon import triangulate2d
42+
from .function import *

raysect/core/math/function/__init__.pxd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3030
# POSSIBILITY OF SUCH DAMAGE.
3131

32-
from raysect.core.math.function.function1d cimport Function1D, autowrap_function1d
33-
from raysect.core.math.function.function2d cimport Function2D, autowrap_function2d
34-
from raysect.core.math.function.function3d cimport Function3D, autowrap_function3d
32+
from raysect.core.math.function.function1d cimport *
33+
from raysect.core.math.function.function2d cimport *
34+
from raysect.core.math.function.function3d cimport *
3535

3636

raysect/core/math/function/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3030
# POSSIBILITY OF SUCH DAMAGE.
3131

32-
from .function1d import Function1D
33-
from .function2d import Function2D
34-
from .function3d import Function3D
32+
from .function1d import *
33+
from .function2d import *
34+
from .function3d import *
3535

3636

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# cython: language_level=3
2+
3+
# Copyright (c) 2014-2019, Dr Alex Meakins, Raysect Project
4+
# All rights reserved.
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions are met:
8+
#
9+
# 1. Redistributions of source code must retain the above copyright notice,
10+
# this list of conditions and the following disclaimer.
11+
#
12+
# 2. Redistributions in binary form must reproduce the above copyright
13+
# notice, this list of conditions and the following disclaimer in the
14+
# documentation and/or other materials provided with the distribution.
15+
#
16+
# 3. Neither the name of the Raysect Project nor the names of its
17+
# contributors may be used to endorse or promote products derived from
18+
# this software without specific prior written permission.
19+
#
20+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30+
# POSSIBILITY OF SUCH DAMAGE.
31+
32+
from raysect.core.math.function.function1d.base cimport Function1D
33+
from raysect.core.math.function.function1d.constant cimport Constant1D
34+
from raysect.core.math.function.function1d.autowrap cimport autowrap_function1d
35+
from raysect.core.math.function.function1d.arg cimport Arg1D
36+
from raysect.core.math.function.function1d.cmath cimport *
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# cython: language_level=3
2+
3+
# Copyright (c) 2014-2019, Dr Alex Meakins, Raysect Project
4+
# All rights reserved.
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions are met:
8+
#
9+
# 1. Redistributions of source code must retain the above copyright notice,
10+
# this list of conditions and the following disclaimer.
11+
#
12+
# 2. Redistributions in binary form must reproduce the above copyright
13+
# notice, this list of conditions and the following disclaimer in the
14+
# documentation and/or other materials provided with the distribution.
15+
#
16+
# 3. Neither the name of the Raysect Project nor the names of its
17+
# contributors may be used to endorse or promote products derived from
18+
# this software without specific prior written permission.
19+
#
20+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30+
# POSSIBILITY OF SUCH DAMAGE.
31+
32+
from .base import Function1D
33+
from .constant import Constant1D
34+
from .arg import Arg1D
35+
from .cmath import *

0 commit comments

Comments
 (0)