File tree Expand file tree Collapse file tree 4 files changed +44
-3
lines changed Expand file tree Collapse file tree 4 files changed +44
-3
lines changed Original file line number Diff line number Diff line change 1+ """Functionality related to definining fit modes."""
Original file line number Diff line number Diff line change 148148 'skewed_gaussian' : pe_skewnorm ,
149149 'cauchy' : pe_cauchy ,
150150}
151+
152+ ###################################################################################################
153+ ## ALL MODES
154+
155+ # Collect a store of all available modes
156+ MODES = {
157+ 'aperiodic' : AP_MODES ,
158+ 'periodic' : PE_MODES ,
159+ }
160+
161+
162+ def check_modes (component , check_params = False ):
163+ """Check the set of modes that are available.
164+
165+ Parameters
166+ ----------
167+ component : {'aperiodic', 'periodic'}
168+ Which component to check available modes for.
169+ check_params : bool, optional, default: False
170+ Whether to print out information on the parameters of each mode.
171+ """
172+
173+ print ('Available {:s} modes:' .format (component ))
174+ for mode in MODES [component ].values ():
175+ if not check_params :
176+ print (' {:10s} {:s}' .format (mode .name , mode .description ))
177+ else :
178+ print ('\n {:s}' .format (mode .name ))
179+ print (' {:s}' .format (mode .description ))
180+ mode .check_params ()
Original file line number Diff line number Diff line change @@ -88,7 +88,6 @@ def n_params(self):
8888 def check_params (self ):
8989 """Check the description of the parameters for the current mode."""
9090
91- print ('Parameters for the {} component in {} mode:' .format (\
92- self .component , self .name ))
91+ print ('Parameters for the {} mode:' .format (self .name ))
9392 for pkey , desc in self .params .descriptions .items ():
94- print ('\t {:15s} {:s}' .format (pkey , desc ))
93+ print (' {:15s} {:s}' .format (pkey , desc ))
Original file line number Diff line number Diff line change 1+ """Tests for specparam.modes.definitions."""
2+
3+ from specparam .modes .definitions import *
4+
5+ ###################################################################################################
6+ ###################################################################################################
7+
8+ def test_check_modes ():
9+
10+ check_modes ('aperiodic' )
11+ check_modes ('periodic' )
You can’t perform that action at this time.
0 commit comments