Skip to content

Commit 1622cb5

Browse files
Add lambda_max to init
1 parent 9a8c74a commit 1622cb5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scripts/Engineering/pawley_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ def undo_fit(self):
290290

291291

292292
class PawleyPattern2D(PawleyPattern1D):
293-
def __init__(self, *args, global_scale: bool = True, **kwargs):
293+
def __init__(self, *args, global_scale: bool = True, lambda_max: float = 5.0, **kwargs):
294294
super().__init__(*args, **kwargs)
295-
self.lambda_max = 5.0 # same default as PoldiAutoCorrelation
295+
self.lambda_max = lambda_max
296296
self.scales = None
297297
self.bgs = None
298298
self.set_global_scale(global_scale)

scripts/test/Engineering/test_pawley_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def test_eval_resids_global_scale_true(self):
203203
self.assertAlmostEqual(sum(resids), -5e7, delta=1e7)
204204

205205
def test_eval2D_respects_lambda_max(self):
206-
pawley = PawleyPattern2D(self.ws, [self.phase], global_scale=True, profile=GaussianProfile())
206+
pawley = PawleyPattern2D(self.ws, [self.phase], global_scale=True, lambda_max=5.0, profile=GaussianProfile())
207207
ysum = pawley.eval_2d(pawley.get_free_params()).extractY().sum()
208208
pawley.lambda_max = 2.0
209209
ysum_cropped = pawley.eval_2d(pawley.get_free_params()).extractY().sum()

0 commit comments

Comments
 (0)