-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #221 from neutrons/219_move_peaks
Move classes into the pyrs.peaks subproject
- Loading branch information
Showing
12 changed files
with
257 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# flake8: noqa | ||
from __future__ import (absolute_import, division, print_function) # python3 compatibility | ||
|
||
from .peak_collection import * | ||
from .peak_fit_factory import * | ||
|
||
__all__ = peak_collection.__all__ + peak_fit_factory.__all__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions
18
pyrs/core/peak_fit_factory.py → pyrs/peaks/peak_fit_factory.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
# Peak fitting engine | ||
from pyrs.core import mantid_fit_peak | ||
from pyrs.utilities import checkdatatypes | ||
|
||
|
||
SupportedPeakProfiles = ['Gaussian', 'PseudoVoigt', 'Voigt'] | ||
SupportedBackgroundTypes = ['Flat', 'Linear', 'Quadratic'] | ||
|
||
__all__ = ['PeakFitEngineFactory', 'SupportedPeakProfiles', 'SupportedBackgroundTypes'] | ||
|
||
|
||
class PeakFitEngineFactory(object): | ||
""" | ||
Peak fitting engine factory | ||
""" | ||
@staticmethod | ||
def getInstance(engine_name): | ||
def getInstance(name): | ||
""" Get instance of Peak fitting engine | ||
:param engine_name: | ||
:return: | ||
""" | ||
checkdatatypes.check_string_variable('Peak fitting engine', engine_name, ['Mantid', 'PyRS']) | ||
checkdatatypes.check_string_variable('Peak fitting engine', name, ['Mantid', 'PyRS']) | ||
|
||
# this must be here for now to stop circular imports | ||
from .mantid_fit_peak import MantidPeakFitEngine | ||
|
||
if engine_name == 'Mantid': | ||
engine_class = mantid_fit_peak.MantidPeakFitEngine | ||
if name == 'Mantid': | ||
return MantidPeakFitEngine | ||
else: | ||
raise RuntimeError('Implement general scipy peak fitting engine') | ||
|
||
return engine_class |
Oops, something went wrong.