Skip to content

Commit

Permalink
fix: added 'hits' as dose unit, catch asserts when trying to compute …
Browse files Browse the repository at this point in the history
…min/median/max dose
  • Loading branch information
ErikBjare committed Jun 25, 2024
1 parent 4886db1 commit c0800c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions qslang/dose.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
ureg.define("serving = x") # for now
ureg.define("puff = x") # for now
ureg.define("puffs = x") # for now
ureg.define("hit = x") # for now
ureg.define("hits = x") # for now

ureg.define("B = 10**9 * x") # for noting billions of CFU, for example

Expand Down
2 changes: 1 addition & 1 deletion qslang/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def _print_daily_doses(
print(
f" - min/median/max dose: {min_dose.amount_with_unit}/{median_dose.amount_with_unit}/{max_dose.amount_with_unit}"
)
except pint.errors.DimensionalityError:
except (pint.errors.DimensionalityError, AssertionError):
logger.warning(
"Couldn't compute min/median/max doses due to inconsistent units"
)
Expand Down

0 comments on commit c0800c4

Please # to comment.