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

Refactor and optimize storeCarbs function to limit carb equivalents of FPU conversion to 1.0 grams #240

Merged
merged 1 commit into from
May 28, 2024

Commits on May 26, 2024

  1. Limit carb equivalents of FPU conversion to 1.0 grams:

    * Extracted the FPU processing logic into a new helper function `processFPU`, which ensures that each carb equivalent is at least 1.0 grams by adjusting the interval if necessary.
    * Added logic in new helper function`processFPU` to adjust the interval when the calculated carb equivalent is less than 1.0 grams.
    * Adjusted spread over time by computing duration again so total carb equivalents remain consistent
    * Refactored the main `storeCarbs` function to be more concise and easier to understand.
    * Introduced detailed docstrings to explain the purpose and functionality of the `storeCarbs`, `processFPU`, and `calculateComputedDuration` functions.
    dnzxy committed May 26, 2024
    Configuration menu
    Copy the full SHA
    e93ef86 View commit details
    Browse the repository at this point in the history