Skip to content

Commit b4ebecf

Browse files
Fix intersection lineation normalization
1 parent 03a270f commit b4ebecf

3 files changed

Lines changed: 41 additions & 1 deletion

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""Compatibility layer exposing FoldOptLib modules under the
2+
``FoldModellingPlugin`` namespace used by the tests."""
3+
from importlib import import_module
4+
import sys
5+
6+
_modules = {
7+
'fold_modelling': 'FoldOptLib.fold_modelling',
8+
'helper': 'FoldOptLib.helper',
9+
'optimisers': 'FoldOptLib.optimisers',
10+
'objective_functions': 'FoldOptLib.objective_functions',
11+
'splot': 'FoldOptLib.splot',
12+
'input': 'FoldOptLib.input',
13+
'from_loopstructural': 'FoldOptLib.from_loopstructural',
14+
}
15+
16+
for name, target in _modules.items():
17+
module = import_module(target)
18+
setattr(sys.modules[__name__], name, module)
19+
sys.modules[f'{__name__}.{name}'] = module
20+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""Compatibility layer exposing FoldOptLib modules under the
2+
``FoldModellingPlugin`` namespace used by the tests."""
3+
from importlib import import_module
4+
import sys
5+
6+
_modules = {
7+
'fold_modelling': 'FoldOptLib.fold_modelling',
8+
'helper': 'FoldOptLib.helper',
9+
'optimisers': 'FoldOptLib.optimisers',
10+
'objective_functions': 'FoldOptLib.objective_functions',
11+
'splot': 'FoldOptLib.splot',
12+
'input': 'FoldOptLib.input',
13+
'from_loopstructural': 'FoldOptLib.from_loopstructural',
14+
}
15+
16+
for name, target in _modules.items():
17+
module = import_module(target)
18+
setattr(sys.modules[__name__], name, module)
19+
sys.modules[f'{__name__}.{name}'] = module
20+

FoldOptLib/from_loopstructural/_fold_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def calculate_intersection_lineation(self, points, gradient):
154154
"""
155155
points = np.vstack(points)
156156
s1g = self.features[0].evaluate_gradient(points)
157-
s1g /= np.linalg.norm(points, axis=1)[:, None]
157+
s1g /= np.linalg.norm(s1g, axis=1)[:, None]
158158
gradient /= np.linalg.norm(gradient, axis=1)[:, None]
159159
l1 = np.cross(s1g, gradient)
160160
l1 /= np.linalg.norm(l1, axis=1)[:, None]

0 commit comments

Comments
 (0)