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

Fix division float over Scalar and float over Array #32

Merged
merged 1 commit into from
Oct 10, 2019

Conversation

arthursoprana
Copy link
Contributor

@arthursoprana arthursoprana commented Oct 4, 2019

This PR intends to fix the following behavior:

from barril.units import Scalar
1 / Scalar(1.0, "m")
Scalar(1.0, 'm', 'length') # it should be 1/m here...

now results in the expected output

from barril.units import Scalar
1 / Scalar(1.0, "m")
Scalar(1.0, '1/m', '1 / length')

I'd say that this PR together with #31 will Fix #15.

@codecov
Copy link

codecov bot commented Oct 4, 2019

Codecov Report

Merging #32 into master will increase coverage by 0.02%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
+ Coverage   97.43%   97.46%   +0.02%     
==========================================
  Files          53       53              
  Lines        9174     9214      +40     
==========================================
+ Hits         8939     8980      +41     
+ Misses        235      234       -1

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, please take a look at my comments,

src/barril/units/_array.py Outdated Show resolved Hide resolved
src/barril/units/_array.py Outdated Show resolved Hide resolved
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a CHANGELOG entry

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a CHANGELOG entry. 👍

src/barril/units/_array.py Outdated Show resolved Hide resolved
src/barril/units/_scalar.py Outdated Show resolved Hide resolved
src/barril/units/_tests/test_array.py Outdated Show resolved Hide resolved
CHANGELOG.rst Outdated Show resolved Hide resolved
@prusse-martin prusse-martin self-requested a review October 10, 2019 13:16
@arthursoprana arthursoprana merged commit 2b79ba8 into ESSS:master Oct 10, 2019
@arthursoprana arthursoprana deleted the fb-BARRIL-15-fix-division branch October 10, 2019 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong unit representation when multiplying a composed unit
4 participants