diff --git a/FoldOptLib/FoldModellingPlugin/__init__.py b/FoldOptLib/FoldModellingPlugin/__init__.py new file mode 100644 index 0000000..de4ba85 --- /dev/null +++ b/FoldOptLib/FoldModellingPlugin/__init__.py @@ -0,0 +1,20 @@ +"""Compatibility layer exposing FoldOptLib modules under the +``FoldModellingPlugin`` namespace used by the tests.""" +from importlib import import_module +import sys + +_modules = { + 'fold_modelling': 'FoldOptLib.fold_modelling', + 'helper': 'FoldOptLib.helper', + 'optimisers': 'FoldOptLib.optimisers', + 'objective_functions': 'FoldOptLib.objective_functions', + 'splot': 'FoldOptLib.splot', + 'input': 'FoldOptLib.input', + 'from_loopstructural': 'FoldOptLib.from_loopstructural', +} + +for name, target in _modules.items(): + module = import_module(target) + setattr(sys.modules[__name__], name, module) + sys.modules[f'{__name__}.{name}'] = module + diff --git a/FoldOptLib/fold_modelling_plugin/__init__.py b/FoldOptLib/fold_modelling_plugin/__init__.py new file mode 100644 index 0000000..de4ba85 --- /dev/null +++ b/FoldOptLib/fold_modelling_plugin/__init__.py @@ -0,0 +1,20 @@ +"""Compatibility layer exposing FoldOptLib modules under the +``FoldModellingPlugin`` namespace used by the tests.""" +from importlib import import_module +import sys + +_modules = { + 'fold_modelling': 'FoldOptLib.fold_modelling', + 'helper': 'FoldOptLib.helper', + 'optimisers': 'FoldOptLib.optimisers', + 'objective_functions': 'FoldOptLib.objective_functions', + 'splot': 'FoldOptLib.splot', + 'input': 'FoldOptLib.input', + 'from_loopstructural': 'FoldOptLib.from_loopstructural', +} + +for name, target in _modules.items(): + module = import_module(target) + setattr(sys.modules[__name__], name, module) + sys.modules[f'{__name__}.{name}'] = module + diff --git a/FoldOptLib/from_loopstructural/_fold_frame.py b/FoldOptLib/from_loopstructural/_fold_frame.py index a2edd81..2ba09bf 100644 --- a/FoldOptLib/from_loopstructural/_fold_frame.py +++ b/FoldOptLib/from_loopstructural/_fold_frame.py @@ -154,7 +154,7 @@ def calculate_intersection_lineation(self, points, gradient): """ points = np.vstack(points) s1g = self.features[0].evaluate_gradient(points) - s1g /= np.linalg.norm(points, axis=1)[:, None] + s1g /= np.linalg.norm(s1g, axis=1)[:, None] gradient /= np.linalg.norm(gradient, axis=1)[:, None] l1 = np.cross(s1g, gradient) l1 /= np.linalg.norm(l1, axis=1)[:, None]