@@ -375,25 +375,25 @@ def readstr(self, datastring):
375
375
baselinefunctions = header [res .end () :].strip ()
376
376
header = header [: res .start ()]
377
377
378
- ### Instantiating baseline functions
378
+ # Instantiating baseline functions
379
379
res = re .split (r"(?m)^#+ BaselineFunction \d+\s*(?:#.*\s+)*" , baselinefunctions )
380
380
for s in res [1 :]:
381
381
safebf .append (BaseFunction .factory (s , safebf ))
382
382
383
- ### Instantiating peak functions
383
+ # Instantiating peak functions
384
384
res = re .split (r"(?m)^#+ PeakFunction \d+\s*(?:#.*\s+)*" , peakfunctions )
385
385
for s in res [1 :]:
386
386
safepf .append (BaseFunction .factory (s , safepf ))
387
387
388
- ### Instantiating Baseline object
388
+ # Instantiating Baseline object
389
389
if re .match (r"^None$" , baselineobject ):
390
390
self .baseline = None
391
391
elif re .match (r"^\d+$" , baselineobject ):
392
392
self .baseline = safebf [int (baselineobject )]
393
393
else :
394
394
self .baseline = Baseline .factory (baselineobject , safebf )
395
395
396
- ### Instantiating initial peaks
396
+ # Instantiating initial peaks
397
397
if re .match (r"^None$" , initial_peaks ):
398
398
self .initial_peaks = None
399
399
else :
@@ -402,7 +402,7 @@ def readstr(self, datastring):
402
402
for s in res [1 :]:
403
403
self .initial_peaks .append (Peak .factory (s , safepf ))
404
404
405
- ### Instantiating srmise metatdata
405
+ # Instantiating srmise metatdata
406
406
407
407
# pf
408
408
res = re .search (r"^pf=(.*)$" , srmisemetadata , re .M )
@@ -426,10 +426,10 @@ def readstr(self, datastring):
426
426
res = re .search (r"^Range=(.*)$" , srmisemetadata , re .M )
427
427
self .rng = eval (res .groups ()[0 ].strip ())
428
428
429
- ### Instantiating other metadata
429
+ # Instantiating other metadata
430
430
self .readmetadata (metadata )
431
431
432
- ### Instantiating start data
432
+ # Instantiating start data
433
433
# read actual data - x, y, dx, dy, plus effective_dy
434
434
arrays = []
435
435
if hasx :
@@ -478,7 +478,7 @@ def readstr(self, datastring):
478
478
if hasedy :
479
479
self .effective_dy = np .array (self .effective_dy )
480
480
481
- ### Instantiating results
481
+ # Instantiating results
482
482
res = re .search (r"^#+ ModelCluster\s*(?:#.*\s+)*" , results , re .M )
483
483
if res :
484
484
mc = results [res .end () :].strip ()
@@ -638,7 +638,7 @@ def writestr(self):
638
638
line .append ("%g" % self .effective_dy [i ])
639
639
lines .append (" " .join (line ))
640
640
641
- ### Calculated members
641
+ # Calculated members
642
642
lines .append ("##### Results" )
643
643
lines .append ("extraction_type=%s" % repr (self .extraction_type ))
644
644
@@ -792,8 +792,8 @@ def extract_single(self, recursion_depth=1):
792
792
793
793
stepcounter = 0
794
794
795
- ### #########################
796
- ### Main extraction loop ###
795
+ # #########################
796
+ # Main extraction loop ###
797
797
for step in dclusters :
798
798
799
799
stepcounter += 1
@@ -839,7 +839,7 @@ def extract_single(self, recursion_depth=1):
839
839
# three clusters can become adjacent at any given step.
840
840
assert len (adjacent ) <= 3
841
841
842
- ### Update cluster fits ###
842
+ # Update cluster fits ###
843
843
# 1. Refit clusters adjacent to at least one other cluster.
844
844
for a in adjacent :
845
845
mclusters [a ].fit (justify = True )
@@ -922,7 +922,7 @@ def extract_single(self, recursion_depth=1):
922
922
near_peaks = Peaks ([full_cluster .model [i ] for i in near_peaks ])
923
923
other_peaks = Peaks ([full_cluster .model [i ] for i in other_peaks ])
924
924
925
- ### Remove contribution of peaks outside neighborhood
925
+ # Remove contribution of peaks outside neighborhood
926
926
# Define range of fitting/recursion to the interpeak range
927
927
# The adjusted error is passed unchanged. This may introduce
928
928
# a few more peaks than is justified, but they can be pruned
@@ -985,7 +985,7 @@ def extract_single(self, recursion_depth=1):
985
985
# Incorporate best peaks from recursive search.
986
986
adj_cluster .augment (rec )
987
987
988
- ### Select which model to use
988
+ # Select which model to use
989
989
full_cluster .model = other_peaks
990
990
full_cluster .replacepeaks (adj_cluster .model )
991
991
full_cluster .fit (True )
@@ -1001,9 +1001,9 @@ def extract_single(self, recursion_depth=1):
1001
1001
logger .debug ("\n " .join (msg ), mclusters [step .lastcluster_idx ], full_cluster )
1002
1002
1003
1003
mclusters [step .lastcluster_idx ] = full_cluster
1004
- ### End update cluster fits ###
1004
+ # End update cluster fits ###
1005
1005
1006
- ### Combine adjacent clusters ###
1006
+ # Combine adjacent clusters ###
1007
1007
1008
1008
# Iterate in reverse order to preserve earlier indices
1009
1009
for idx in adjacent [- 1 :0 :- 1 ]:
@@ -1065,7 +1065,7 @@ def extract_single(self, recursion_depth=1):
1065
1065
near_peaks = Peaks ([new_cluster .model [i ] for i in near_peaks ])
1066
1066
other_peaks = Peaks ([new_cluster .model [i ] for i in other_peaks ])
1067
1067
1068
- ### Remove contribution of peaks outside neighborhood
1068
+ # Remove contribution of peaks outside neighborhood
1069
1069
# Define range of fitting/recursion to the interpeak range
1070
1070
# The adjusted error is passed unchanged. This may introduce
1071
1071
# a few more peaks than is justified, but they can be pruned
@@ -1075,7 +1075,7 @@ def extract_single(self, recursion_depth=1):
1075
1075
adj_y = y [adj_slice ] - other_peaks .value (adj_x )
1076
1076
adj_error = dy [adj_slice ]
1077
1077
1078
- ### # Perform recursion on a version that is scaled at the
1078
+ # # Perform recursion on a version that is scaled at the
1079
1079
# border, as well as on that is simply fit beforehand. In
1080
1080
# many cases these lead to nearly identical results, but
1081
1081
# occasionally one works much better than the other.
@@ -1194,7 +1194,7 @@ def extract_single(self, recursion_depth=1):
1194
1194
# Incorporate best peaks from recursive search.
1195
1195
adj_cluster2 .augment (rec2 )
1196
1196
1197
- ### Select which model to use
1197
+ # Select which model to use
1198
1198
new_cluster .model = other_peaks
1199
1199
rej_cluster = ModelCluster (new_cluster )
1200
1200
q1 = adj_cluster1 .quality (self .error_method )
@@ -1224,16 +1224,16 @@ def extract_single(self, recursion_depth=1):
1224
1224
mclusters [idx - 1 ] = new_cluster
1225
1225
del mclusters [idx ]
1226
1226
1227
- ### End combine adjacent clusters loop ###
1227
+ # End combine adjacent clusters loop ###
1228
1228
1229
1229
# Finally, combine clusters in dclusters
1230
1230
if len (adjacent ) > 0 :
1231
1231
step .combine_clusters ([adjacent ])
1232
1232
1233
1233
tracer .emit (* mclusters )
1234
1234
1235
- ### End main extraction loop ###
1236
- ### #############################
1235
+ # End main extraction loop ###
1236
+ # #############################
1237
1237
1238
1238
# Put initial peaks back in
1239
1239
mclusters [0 ].addexternalpeaks (ip )
0 commit comments