Skip to content

Fix floating point#2

Merged
OlegZv merged 10 commits intomasterfrom
fix-floating-point
Oct 12, 2019
Merged

Fix floating point#2
OlegZv merged 10 commits intomasterfrom
fix-floating-point

Conversation

@OlegZv
Copy link
Copy Markdown
Owner

@OlegZv OlegZv commented Oct 10, 2019

  • Added zeros after the decimal point to get correct float values

Improved error handling at the decoder

Modified decoder.py

  • added a check for the type of the payload provided. sometimes seen it be a byte string. will raise TypeError
  • handler when the sensor type wasn't found or nor defined at all. The library will return intermediate result and print the error
  • added handler for cases when the payload length is incorrect. This will raise the ValueError
  • added a broad except to raise any uncaught exceptions, but print out what was already decoded for future debugging.

OlegSomov added 2 commits October 9, 2019 23:14
Modified `decoder.py`
- added a check for the type of the payload provided. sometimes seen it to be a byte string. will raise TypeError
- handler when the sensor type wasn't found or nor defined at all. Library will return intermediate result and print the error
- added handler for cases when the payload length is incorrect. This will raise the ValueError
- added a broad except to raise any uncaugh exceptions, but print out what was already decoded for  future debugging.
@OlegZv OlegZv self-assigned this Oct 10, 2019
@OlegZv
Copy link
Copy Markdown
Owner Author

OlegZv commented Oct 10, 2019

This is a fix for #1 issue. I want to also add unit tests before merging.

OlegSomov added 7 commits October 11, 2019 23:50
requirements.txt have only tools for testing
also default strings handling is different. in 2.7 the string literal is str and stored as bytes
in 3.7 it's str stored as unicode.
also edited setup to be ready to push the change
@codecov-io
Copy link
Copy Markdown

codecov-io commented Oct 12, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@efe6233). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##             master     #2   +/-   ##
=======================================
  Coverage          ?   100%           
=======================================
  Files             ?      5           
  Lines             ?    149           
  Branches          ?      0           
=======================================
  Hits              ?    149           
  Misses            ?      0           
  Partials          ?      0
Impacted Files Coverage Δ
python_cayennelpp/tests/test_valid.py 100% <100%> (ø)
python_cayennelpp/tests/test_invalid.py 100% <100%> (ø)
python_cayennelpp/decoder.py 100% <100%> (ø)
python_cayennelpp/methods.py 100% <100%> (ø)

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 efe6233...a0d4995. Read the comment docs.

@OlegZv OlegZv merged commit 2fa6ebc into master Oct 12, 2019
@OlegZv
Copy link
Copy Markdown
Owner Author

OlegZv commented Oct 12, 2019

Fixed #1

@OlegZv OlegZv deleted the fix-floating-point branch October 12, 2019 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants