From ef00d75498bccf3702be48861d199f79ed233c93 Mon Sep 17 00:00:00 2001 From: fsalmoir Date: Tue, 22 Mar 2016 14:55:04 +0100 Subject: [PATCH 1/3] first changes to documentation and modification of class names --- docs/source/code.rst | 1 + docs/source/free_form.rst | 7 +++++++ pygem/ffd_parameters.py | 7 ++++--- pygem/{ffd.py => free_form.py} | 12 ++++++++++-- 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 docs/source/free_form.rst rename pygem/{ffd.py => free_form.py} (87%) diff --git a/docs/source/code.rst b/docs/source/code.rst index 198197d..e59a760 100644 --- a/docs/source/code.rst +++ b/docs/source/code.rst @@ -5,6 +5,7 @@ Code Documentation .. toctree:: :maxdepth: 2 + affine_trans ffd ffd_parameters diff --git a/docs/source/free_form.rst b/docs/source/free_form.rst new file mode 100644 index 0000000..61e7c3a --- /dev/null +++ b/docs/source/free_form.rst @@ -0,0 +1,7 @@ +Free Form Deformation +================= + +.. automodule:: pygem.free_form + +.. autoclass:: FFD + :members: diff --git a/pygem/ffd_parameters.py b/pygem/ffd_parameters.py index 7b902d4..f8d8bec 100644 --- a/pygem/ffd_parameters.py +++ b/pygem/ffd_parameters.py @@ -8,7 +8,7 @@ class FFDParameters(object): """ - Class that handle the Free Form Deformation parameters in terms of FFD bounding box and + Class that handles the Free Form Deformation parameters in terms of FFD bounding box and weight of the FFD control points. :param list n_control_points: number of control points in the x, y, and z direction. @@ -102,9 +102,10 @@ def __init__(self, n_control_points=None): def read_parameters_file(self, filename=None): """ + Reads in the parameters file and fill the self structure. + + :param string filename: parameters file to be read in. - .. todo:: - DOCS """ if not isinstance(filename, basestring): raise TypeError("filename must be a string") diff --git a/pygem/ffd.py b/pygem/free_form.py similarity index 87% rename from pygem/ffd.py rename to pygem/free_form.py index 81574e8..1780673 100644 --- a/pygem/ffd.py +++ b/pygem/free_form.py @@ -8,7 +8,13 @@ class FFD(object): """ - DOCS + Class that handles the Free Form Deformation on the mesh points. + + :param class ffd_parameters: parameters of the Free Form Deformation. + :param numpy.ndarray original_mesh_points: coordinates of the original points of the mesh. + + :return: modified_mesh_points: coordinates of the modified points of the mesh. + :rtype: numpy.ndarray """ def __init__(self, ffd_parameters, original_mesh_points): @@ -77,9 +83,11 @@ def perform(self): or (reference_frame_mesh_points[i, 1] > 1) or (reference_frame_mesh_points[i, 2] > 1): shift_mesh_points[i, :] = 0 - return self._transform_points(shift_mesh_points + reference_frame_mesh_points, \ + modified_mesh_points = self._transform_points(shift_mesh_points + reference_frame_mesh_points, \ inverse_transformation) + translation + return modified_mesh_points + def _transform_points(self, original_points, transformation): """ From 48433e31435595200155b8ec619e147636dd6212 Mon Sep 17 00:00:00 2001 From: fsalmoir Date: Tue, 22 Mar 2016 14:59:44 +0100 Subject: [PATCH 2/3] first changes to documentation and modification of class names --- tests/test_ffd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_ffd.py b/tests/test_ffd.py index 29075c1..408494c 100644 --- a/tests/test_ffd.py +++ b/tests/test_ffd.py @@ -1,7 +1,7 @@ from unittest import TestCase import unittest -import pygem.ffd as ffd +import pygem.free_form as ffd import pygem.ffd_parameters as ffdp import pygem.file_handler as fh import numpy as np From 47bdc2b9ede637203517e545583ffb928ada7a20 Mon Sep 17 00:00:00 2001 From: fsalmoir Date: Tue, 22 Mar 2016 16:16:02 +0100 Subject: [PATCH 3/3] first changes to documentation and modification of class names --- docs/source/ffd.rst | 8 -------- docs/source/free_form.rst | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 docs/source/ffd.rst diff --git a/docs/source/ffd.rst b/docs/source/ffd.rst deleted file mode 100644 index 0dba69b..0000000 --- a/docs/source/ffd.rst +++ /dev/null @@ -1,8 +0,0 @@ -FFD -================= - -.. automodule:: pygem.ffd - -.. autoclass:: FFD - :members: - :private-members: diff --git a/docs/source/free_form.rst b/docs/source/free_form.rst index 61e7c3a..22e8e01 100644 --- a/docs/source/free_form.rst +++ b/docs/source/free_form.rst @@ -1,5 +1,5 @@ Free Form Deformation -================= +===================== .. automodule:: pygem.free_form