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

Improve typing of arithmetic, Quantity.shift(), Quantity.to_dataframe() #55

Merged
merged 8 commits into from
Feb 23, 2022

Conversation

khaeru
Copy link
Owner

@khaeru khaeru commented Feb 23, 2022

This adds explicit arithmetic so that:

x = 4.2 * Quantity(…)

…works and satisfies mypy.

Also:

  • Improve typing of Quantity.shift().

PR checklist

  • Checks all ✅
  • Update documentation
  • Update doc/whatsnew.rst

@khaeru khaeru added the enh New feature or request label Feb 23, 2022
@khaeru khaeru self-assigned this Feb 23, 2022
@codecov-commenter
Copy link

codecov-commenter commented Feb 23, 2022

Codecov Report

Merging #55 (f133e00) into main (d4f0d4b) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #55   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           36        36           
  Lines         2605      2628   +23     
=========================================
+ Hits          2605      2628   +23     
Impacted Files Coverage Δ
genno/computations.py 100.00% <100.00%> (ø)
genno/core/attrseries.py 100.00% <100.00%> (ø)
genno/core/quantity.py 100.00% <100.00%> (ø)
genno/core/sparsedataarray.py 100.00% <100.00%> (ø)
genno/tests/core/test_computer.py 100.00% <100.00%> (ø)
genno/tests/core/test_quantity.py 100.00% <100.00%> (ø)
genno/tests/test_computations.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4f0d4b...f133e00. Read the comment docs.

@khaeru khaeru changed the title Add arithmetic Improve typing of arithmetic, Quantity.shift(), Quantity.to_dataframe() Feb 23, 2022
@khaeru khaeru merged commit ca4c4c0 into main Feb 23, 2022
@khaeru khaeru deleted the enh-2022-W08 branch February 23, 2022 14:03
@khaeru khaeru linked an issue Feb 23, 2022 that may be closed by this pull request
1 task
@khaeru khaeru mentioned this pull request Feb 23, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve typing
2 participants