Repository navigation
Add n_submodels shared method to compound models - #5747
Merged
Merged
Conversation
pllim
reviewed
Jan 27, 2017
| Test that CompoundModel.get_n_submodels() properly returns the number | ||
| of components. | ||
| """ | ||
| g2 = Gaussian1D() + Gaussian1D() |
Member
There was a problem hiding this comment.
We should also test that non-compound model return 1, or is that non-applicable? @nden?
pllim
reviewed
Jan 27, 2017
| is the default behavior it is good to be aware of. | ||
|
|
||
| One is also able to get the number of components (also known as submodels) in | ||
| a compound model by using ``get_n_submodels`` method:: |
Member
There was a problem hiding this comment.
The mention of "method" and its name needs to be corrected to reflect the correct new property.
Member
|
Also need a change log for v2.0 under new feature. |
add changelog entry
Member
Author
Member
|
LGTM 👍 |
Member
Contributor
|
@mirca 👍 for using a |
Member
Author
|
@nden It makes a lot of sense to me that this should work with single models too :) |
Member
Author
|
@nden Let me know if the changes suffice, thanks! |
pllim
reviewed
Feb 8, 2017
| Return the number of components in a single model, which is | ||
| obviously 1. | ||
| """ | ||
|
|
Member
There was a problem hiding this comment.
Nitpick: Blank line not necessary.
Member
|
LGTM 👍 |
Contributor
|
Looks good! Thanks @mirca! |
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.
This PR adds a
propertyshared method calledn_submodelsto_CompoundModelwhich provides a clearer way to get the number of components in a compound model.Fix #4093
cc @pllim @nden