-
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.
Move PeakFitFactory into correct subpackage refs #219
- Loading branch information
1 parent
618e682
commit 3bd967c
Showing
9 changed files
with
37 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# flake8: noqa | ||
from __future__ import (absolute_import, division, print_function) # python3 compatibility | ||
|
||
from .peak_collection import PeakCollection | ||
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.peaks.mantid_fit_peak import MantidPeakFitEngine | ||
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 = MantidPeakFitEngine | ||
if name == 'Mantid': | ||
return MantidPeakFitEngine | ||
else: | ||
raise RuntimeError('Implement general scipy peak fitting engine') | ||
|
||
return engine_class |
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