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

Minor change wrt typecheck (int vs float) #98

Merged
merged 2 commits into from
Dec 8, 2022
Merged

Conversation

Ryton
Copy link
Contributor

@Ryton Ryton commented Dec 7, 2022

minor inclusion in models getter for answer_a and answer_b, related to github issue #97 -> change: closes #97
if isinstance(val, float) and val.is_integer():
log.warning("coercing float value")
val = int(val)

@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Merging #98 (2e9f919) into main (aa0688d) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   92.81%   92.85%   +0.04%     
==========================================
  Files          25       25              
  Lines        2171     2184      +13     
  Branches      279      280       +1     
==========================================
+ Hits         2015     2028      +13     
  Misses        125      125              
  Partials       31       31              
Impacted Files Coverage Δ
aocd/models.py 93.34% <100.00%> (+0.08%) ⬆️
aocd/version.py 100.00% <100.00%> (ø)
tests/test_submit.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@wimglenn
Copy link
Owner

wimglenn commented Dec 7, 2022

It will be better to do this in the lower-level Puzzle._submit method, rather than in the property setters. That way you only have to do it once, not twice. We also need test coverage, as the Codecov report is complaining about.

edit: I've added the necessary test coverage and released this in advent-of-code-data v1.3.2. thanks for the contribution @Ryton !

@wimglenn wimglenn merged commit 67b5d1f into wimglenn:main Dec 8, 2022
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.

Add typecheck (int, float, str) to aocd.models.puzzle.answer_a/b?
2 participants