Updates to ~astropy.modeling.custom_model#11984
Merged
nden merged 2 commits intoastropy:mainfrom Aug 13, 2021
Merged
Conversation
Contributor
Author
|
Tagging @nden and @perrygreenfield. |
b3e78ed to
e8ceecd
Compare
Contributor
|
@WilliamJamieson Can you add a few words at the bottom of the first paragraph in this page |
Contributor
|
@dstansby Does this solve the issue with |
Contributor
|
Thanks for opening this - looking through the tests it looks like it solves my problem 👍 |
0853501 to
19bfd4c
Compare
nden
reviewed
Aug 13, 2021
20044ec to
8f18522
Compare
Contributor
|
@pllim Is the failure known? It looks unrelated. If so feel free to merge. |
Member
|
It is because of #12050 but unless you are in a big hurry, I would advise to wait till we fix the CI in main and then you can rebase. |
Member
Added tests for updates to `custom_model`. Added some documentation for the changes Added changelog entry
8f18522 to
087d1fa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request addresses the issues raised in #11791. Namely, what should be done with "parameters" set using
custom_modelwhich directly relate to the internal workings ofModel.In particular, it pointed out that weird behavior occurs when the user tries to set
n_outputsvia thecustom_modelinterface. This exposed the fact thatcustom_modelassumed that the model generated would always have exactly one output value, which should not be the case.This PR addresses the question of the banned/reserved list of parameters, by banning use of parameters which share a name with any "non-settable" property used in
Modeland using parameters sharing a name with a "settable" property to set the underlyingModelproperty. It also introduces the notion of aspecialparameter, which is a model parameter which is not settable, but maybe one that users may want to manipulate when dynamically creating new models (e.g.n_outputs).Fixes #11791
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
Extra CIlabel.no-changelog-entry-neededlabel.astropy-botcheck might be missing; do not let the green checkmark fool you.backport-X.Y.xlabel(s) before merge.