Skip to content

last few #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions diffpy/srmise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@


from diffpy.srmise.version import __version__

# silence the pyflakes syntax checker
assert __version__ or True
17 changes: 8 additions & 9 deletions diffpy/srmise/peakextraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@
import matplotlib.pyplot as plt
import numpy as np

from diffpy.srmise import srmiselog
from diffpy.srmise.baselines import Baseline
from diffpy.srmise.dataclusters import DataClusters
from diffpy.srmise.modelcluster import ModelCluster, ModelCovariance
from diffpy.srmise.modelparts import ModelPart, ModelParts
from diffpy.srmise.peaks import Peak, Peaks
from diffpy.srmise.srmiseerrors import *
from diffpy.srmise.srmiseerrors import SrMiseDataFormatError, SrMiseEstimationError, SrMiseFileError

logger = logging.getLogger("diffpy.srmise")

from diffpy.srmise import srmiselog


class PeakExtraction(object):
"""Class for peak extraction.
Expand Down Expand Up @@ -461,8 +459,8 @@ def readstr(self, datastring):
# raise SrMiseDataFormatError if something goes wrong
try:
for line in start_data.split("\n"):
l = line.split()
if len(arrays) != len(l):
split_line = line.split()
if len(arrays) != len(split_line):
emsg = "Number of value fields does not match that given by '%s'" % start_data_info
for a, v in zip(arrays, line.split()):
a.append(float(v))
Expand Down Expand Up @@ -892,7 +890,8 @@ def extract_single(self, recursion_depth=1):
# left_data, right_data: indices defining the extent of the "interpeak range" for x, etc.
near_peaks = np.array([], dtype=np.int)

# interpeak range goes from peak to peak of next nearest peaks, although their contributions to the data are still removed.
# interpeak range goes from peak to peak of next nearest peaks, although their contributions
# to the data are still removed.
if pivot == 0:
# No peaks left of border_x!
left_data = full_cluster.slice.indices(len(x))[0]
Expand Down Expand Up @@ -1035,7 +1034,8 @@ def extract_single(self, recursion_depth=1):
# left_data, right_data: indices defining the extent of the "interpeak range" for x, etc.
near_peaks = np.array([], dtype=np.int)

# interpeak range goes from peak to peak of next nearest peaks, although their contributions to the data are still removed.
# interpeak range goes from peak to peak of next nearest peaks, although their contributions
# to the data are still removed.
if pivot == 0:
# No peaks left of border_x!
left_data = new_cluster.slice.indices(len(x))[0]
Expand Down Expand Up @@ -1307,7 +1307,6 @@ def fit_single(self):

from numpy.random import randn

from diffpy.srmise import srmiselog
from diffpy.srmise.modelevaluators import AICc
from diffpy.srmise.peaks import GaussianOverR

Expand Down
Loading