From b4ebecfbc22e70eb76e1de8d963db6c9c371a4dc Mon Sep 17 00:00:00 2001 From: Rabii Chaarani <50892556+rabii-chaarani@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:03:59 +0930 Subject: [PATCH] Fix intersection lineation normalization --- FoldOptLib/FoldModellingPlugin/__init__.py | 20 +++++++++++++++++++ FoldOptLib/fold_modelling_plugin/__init__.py | 20 +++++++++++++++++++ FoldOptLib/from_loopstructural/_fold_frame.py | 2 +- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 FoldOptLib/FoldModellingPlugin/__init__.py create mode 100644 FoldOptLib/fold_modelling_plugin/__init__.py 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]