Repository navigation
Fixed #2274 - #3220
Fixed #2274#3220
Conversation
|
@adonath - Thanks! Can you please add a regression test and a changelog entry? |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Ah, Ok!I misunderstood the use of custom_model. I just realized it returns a class not an instance...my bad.
8cf68e1 to
9a82024
Compare
|
Thanks for the comments! They are adressed in the newest commit. |
9a82024 to
3b43ba4
Compare
|
This looks better 👍 |
|
👍 |
|
Since @cdeil signs off then I'm convinced. |
This PR is a quick fix for #2274. I use the
custom_modelfunction to create anastropy.modeling.Modelinstance internally, when the model is a an ordinary function. Furthermore I added a check, that themodelargument is callable.@cdeil, @eteq