You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
discretize_model should work or throw an error for non-model callable input #2274
One option would be to remove all the isinstance checks and slightly change the API (add an argument callable_n_dim=1) to be able to process any callable as input.
Another option would be to fix the isinstance checking to throw a TypeError if something other than a Parametric1DModel or a Parametric2DModel is passed.
@cdeil - I don't understand why callable_n_dim is necessary in your example. Can't it just be inferred from whether or not y_range is present? (E.g., y_range == None implies 1D, otherwise 2D). In that case, I'd say its appropriate only to check that it's consistent if a FittableModel is present. So that would give the bahvior that, if y_range==None and it's a Fittable2DModel, or y_range != None and its a Fittable1DModel, an error should be given. But if it's a callable, use y_range being None or not to infer the dimension.
Activity
cdeil commentedon Apr 30, 2014
@astrofrog @adonath What do you think would be a good fix for this bug?
(I've mentioned two options above, but there might be better ones?)
eteq commentedon May 5, 2014
@cdeil - I don't understand why
callable_n_dimis necessary in your example. Can't it just be inferred from whether or noty_rangeis present? (E.g.,y_range == Noneimplies 1D, otherwise 2D). In that case, I'd say its appropriate only to check that it's consistent if aFittableModelis present. So that would give the bahvior that, ify_range==Noneand it's aFittable2DModel, ory_range != Noneand its aFittable1DModel, an error should be given. But if it's a callable, usey_rangebeing None or not to infer the dimension.Fixed astropy#2274
Fixed astropy#2274
Fixed astropy#2274
Fixed astropy#2274
Fixed astropy#2274
Merge pull request #3220 from adonath/fix_convolution_issues
embray commentedon Dec 19, 2014
Fixed by #3220; thanks @adonath !