Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convenience functions for Matrix, Vector and NormalizationParameters #161

Merged
merged 9 commits into from
Jan 4, 2021

Conversation

vetlewi
Copy link
Collaborator

@vetlewi vetlewi commented Jan 4, 2021

I've added two optional fields for the mass and element number to the NormalizationParameters, added a __len__ method to the Vector class and added a warning to be issued to the user stating that the std attribute of the Matrix class won't be saved (warn user until issue #142 are fixed).

I've added a __len__ method to make it easier to check the length of a vector.
I've added two optional fields to the NormalizationParameters that can be useful.
I've added a user warning that if the matrix has the `std` attribute set it will not be saved.
I've added a test that checks for the warning when trying to save a matrix with the std field. Also minor changes to conform with code style
ompy/matrix.py Outdated Show resolved Hide resolved
ompy/models.py Outdated Show resolved Hide resolved
@fzeiser fzeiser added the Suggestion Suggestion for new feature/changes label Jan 4, 2021
I've implemented the suggested changes for the `Matrix` class.
The `NormalizationParameters` will now emit warnings if there are inconsistencies between the value of `A` attribute and `mass` field in `spincutPars`.
@fzeiser
Copy link
Collaborator

fzeiser commented Jan 4, 2021

Very nice. Thanks for the update!

@fzeiser fzeiser merged commit 1cb2ab0 into master Jan 4, 2021
@fzeiser fzeiser deleted the various-changes branch January 4, 2021 15:20
@fzeiser fzeiser changed the title Various changes Convenience functions for Matrix, Vector and NormalizationParameters Jan 14, 2021
fzeiser pushed a commit that referenced this pull request Jan 14, 2021
* optional arguments
In #161 some additional parameters were added to
`NormalizationParameters`. This caused trouble in `NormalizerGSF`, which
assumed that all parameters/attributes in `NormalizationParameters`
have to be set.

* Sphinx docs:
Workaround for documentation of non default members.
fzeiser pushed a commit that referenced this pull request Jan 14, 2021
* optional arguments
In #161 some additional parameters were added to
`NormalizationParameters`. This caused trouble in `NormalizerGSF`, which
assumed that all parameters/attributes in `NormalizationParameters`
have to be set.

* Sphinx docs:
Workaround for documentation of non default members.
fzeiser added a commit that referenced this pull request Jan 14, 2021
* optional arguments
In #161 some additional parameters were added to
`NormalizationParameters`. This caused trouble in `NormalizerGSF`, which
assumed that all parameters/attributes in `NormalizationParameters`
have to be set.
For now, I added a exclude_check_change attribute
to mark the real optional arguments. Alternatively NormalizerGSF
could be set to look just for some specific parameters it needs.

* Sphinx docs:
Workaround for documentation of non default members. Necessary due to astropy/sphinx-automodapi#115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Suggestion Suggestion for new feature/changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants