Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vasudevan, Rama K
pycroscopy
Commits
0e6f0d92
Commit
0e6f0d92
authored
Jul 28, 2020
by
ssomnath
Browse files
More robust and transparent checks of fitted dimensions
parent
c177d033
Changes
1
Hide whitespace changes
Inline
Side-by-side
pycroscopy/analysis/fitter.py
View file @
0e6f0d92
...
...
@@ -49,10 +49,18 @@ class Fitter(Process):
# Validate other arguments / kwargs here:
if
variables
is
not
None
:
if
not
np
.
all
(
np
.
isin
(
variables
,
self
.
h5_main
.
spec_dim_labels
)):
if
isinstance
(
variables
,
str
):
variables
=
[
variables
]
if
not
isinstance
(
variables
,
(
list
,
tuple
)):
raise
TypeError
(
'variables should be a string / list or tuple'
'of strings. Provided object was of type: {}'
''
.
format
(
type
(
variables
)))
if
not
all
([
dim
in
self
.
h5_main
.
spec_dim_labels
for
dim
in
variables
]):
raise
ValueError
(
'Provided dataset does not appear to have the'
' spectroscopic dimension(s): "{}" that need '
'to be fitted'
.
format
(
variables
))
' spectroscopic dimension(s): {} that need '
'to be fitted: {}'
''
.
format
(
self
.
h5_main
.
spec_dim_labels
,
variables
))
# Variables specific to Fitter
self
.
_guess
=
None
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment