Skip to content

Arithmetic operations for Parameters and DescriptorNumbers #31

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

Closed
damskii9992 opened this issue Jul 16, 2024 Discussed in #27 · 0 comments · Fixed by #43
Closed

Arithmetic operations for Parameters and DescriptorNumbers #31

damskii9992 opened this issue Jul 16, 2024 Discussed in #27 · 0 comments · Fixed by #43
Assignees
Labels
feature PR label [scope] enhancement Adds/improves features (major.MINOR.patch)
Milestone

Comments

@damskii9992
Copy link
Contributor

damskii9992 commented Jul 16, 2024

Discussed in #27

Originally posted by damskii9992 July 15, 2024

General

Adding capability to do arithmetic operations on Parameters and DescriptorNumbers allow users to use fitted parameters to do quick and easy calculations with uncertainties and units to calculate items of interest, as well as quickly and easily create new parameters/descriptors from previous ones.

Current implementation

This is not currently implemented

Proposed implementation

Add the following methods to Parameter and DescriptorNumber:

__add__
__sub__
__mul__
__truediv__
__pow__
__neg__
__abs__

The output should be a Parameter with automatically calculated min/max if any of the elements of the arithmetic operation is a Parameter, otherwise the output should be a DescriptorNumber. In either case the unit and variance is also automatically propagated.

@damskii9992 damskii9992 self-assigned this Jul 16, 2024
@damskii9992 damskii9992 added [scope] enhancement Adds/improves features (major.MINOR.patch) feature PR label labels Jul 16, 2024
@rozyczko rozyczko added this to the Milestone 1 milestone Jul 31, 2024
@damskii9992 damskii9992 linked a pull request Aug 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature PR label [scope] enhancement Adds/improves features (major.MINOR.patch)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants