|
20 | 20 | import matplotlib.pyplot as plt
|
21 | 21 | import numpy as np
|
22 | 22 |
|
| 23 | +from diffpy.srmise import srmiselog |
23 | 24 | from diffpy.srmise.baselines import Baseline
|
24 | 25 | from diffpy.srmise.dataclusters import DataClusters
|
25 | 26 | from diffpy.srmise.modelcluster import ModelCluster, ModelCovariance
|
26 |
| -from diffpy.srmise.modelparts import ModelPart, ModelParts |
27 | 27 | from diffpy.srmise.peaks import Peak, Peaks
|
28 |
| -from diffpy.srmise.srmiseerrors import * |
| 28 | +from diffpy.srmise.srmiseerrors import SrMiseDataFormatError, SrMiseEstimationError, SrMiseFileError |
29 | 29 |
|
30 | 30 | logger = logging.getLogger("diffpy.srmise")
|
31 | 31 |
|
32 |
| -from diffpy.srmise import srmiselog |
33 |
| - |
34 | 32 |
|
35 | 33 | class PeakExtraction(object):
|
36 | 34 | """Class for peak extraction.
|
@@ -461,8 +459,8 @@ def readstr(self, datastring):
|
461 | 459 | # raise SrMiseDataFormatError if something goes wrong
|
462 | 460 | try:
|
463 | 461 | for line in start_data.split("\n"):
|
464 |
| - l = line.split() |
465 |
| - if len(arrays) != len(l): |
| 462 | + split_line = line.split() |
| 463 | + if len(arrays) != len(split_line): |
466 | 464 | emsg = "Number of value fields does not match that given by '%s'" % start_data_info
|
467 | 465 | for a, v in zip(arrays, line.split()):
|
468 | 466 | a.append(float(v))
|
@@ -892,7 +890,8 @@ def extract_single(self, recursion_depth=1):
|
892 | 890 | # left_data, right_data: indices defining the extent of the "interpeak range" for x, etc.
|
893 | 891 | near_peaks = np.array([], dtype=np.int)
|
894 | 892 |
|
895 |
| - # interpeak range goes from peak to peak of next nearest peaks, although their contributions to the data are still removed. |
| 893 | + # interpeak range goes from peak to peak of next nearest peaks, although their contributions |
| 894 | + # to the data are still removed. |
896 | 895 | if pivot == 0:
|
897 | 896 | # No peaks left of border_x!
|
898 | 897 | left_data = full_cluster.slice.indices(len(x))[0]
|
@@ -1035,7 +1034,8 @@ def extract_single(self, recursion_depth=1):
|
1035 | 1034 | # left_data, right_data: indices defining the extent of the "interpeak range" for x, etc.
|
1036 | 1035 | near_peaks = np.array([], dtype=np.int)
|
1037 | 1036 |
|
1038 |
| - # interpeak range goes from peak to peak of next nearest peaks, although their contributions to the data are still removed. |
| 1037 | + # interpeak range goes from peak to peak of next nearest peaks, although their contributions |
| 1038 | + # to the data are still removed. |
1039 | 1039 | if pivot == 0:
|
1040 | 1040 | # No peaks left of border_x!
|
1041 | 1041 | left_data = new_cluster.slice.indices(len(x))[0]
|
@@ -1307,7 +1307,6 @@ def fit_single(self):
|
1307 | 1307 |
|
1308 | 1308 | from numpy.random import randn
|
1309 | 1309 |
|
1310 |
| - from diffpy.srmise import srmiselog |
1311 | 1310 | from diffpy.srmise.modelevaluators import AICc
|
1312 | 1311 | from diffpy.srmise.peaks import GaussianOverR
|
1313 | 1312 |
|
|
0 commit comments