Skip to content

Fixed #2274 - #3220

Merged
embray merged 1 commit into
astropy:masterfrom
adonath:fix_convolution_issues
Dec 19, 2014
Merged

embray merged 1 commit into
astropy:masterfrom
adonath:fix_convolution_issues

Conversation

@adonath

@adonath adonath commented Dec 17, 2014

Copy link
Copy Markdown
Member

This PR is a quick fix for #2274. I use the custom_model function to create an astropy.modeling.Model instance internally, when the model is a an ordinary function. Furthermore I added a check, that the model argument is callable.
@cdeil, @eteq

@cdeil

cdeil commented Dec 17, 2014

Copy link
Copy Markdown
Member

@adonath - Thanks!

Can you please add a regression test and a changelog entry?

Comment thread astropy/convolution/utils.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking isinstance(model, _ModelMeta) implies that the model argument may also be a model class, which would somehow have to be instantiated with parameters. I don't think it works that way, so there's no reason to include this check.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the custom_model function is used to create a model from a function, the model instance is of type _ModelMeta, and could also be passed to discretize_model. That's why I included this check. But as the function could be directly passed to discretize_model it is not really necessary...I agree.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, Ok!I misunderstood the use of custom_model. I just realized it returns a class not an instance...my bad.

@eteq

eteq commented Dec 17, 2014

Copy link
Copy Markdown
Member

Looks fine to me aside from @embray's comments, @adonath .

(Don't worry about the test failure here - it's not realy, just Travis being tempramental.)

@adonath
adonath force-pushed the fix_convolution_issues branch from 8cf68e1 to 9a82024 Compare December 18, 2014 14:41
@adonath

adonath commented Dec 18, 2014

Copy link
Copy Markdown
Member Author

Thanks for the comments! They are adressed in the newest commit.

@adonath
adonath force-pushed the fix_convolution_issues branch from 9a82024 to 3b43ba4 Compare December 18, 2014 15:01
@embray embray added this to the v1.0.0 milestone Dec 18, 2014
@embray

embray commented Dec 18, 2014

Copy link
Copy Markdown
Member

This looks better 👍

@cdeil

cdeil commented Dec 18, 2014

Copy link
Copy Markdown
Member

👍

@embray

embray commented Dec 19, 2014

Copy link
Copy Markdown
Member

Since @cdeil signs off then I'm convinced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants