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

[Issue: 182] Support for optional fields in FoodList #183

Merged
merged 4 commits into from
Nov 8, 2020

Conversation

0xEljh
Copy link

@0xEljh 0xEljh commented Nov 7, 2020

FoodList now supports entries with missing values.
This is done by adding an entry with a missing nutritional value via inputing OptionalFood.EMPTY_VALUE = -1 in its place.

  • New FoodManager class added to handle creation and retrieval of Food objects.
    -When an internal method calls getFood(), the missing values are calculated via NutritionCalculator.

A new utility class and package for string formatting added: allows formating with maps in a fashion similar to python's fstrings.

StringFormatter makes substitutions of the ${key_name} regex pattern in a string to their value mappings.

Makes progress on #182

- FoodList can now accept entries with missing values.
- Missing values are recalulated upon the use of a getFood() method call.
- add a string utility class for fstring-like support.
StringFormatter is a utility class that is not limited to supporting classes in list.
Copy link

@HengFuYuen HengFuYuen left a comment

Choose a reason for hiding this comment

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

Current commit LGTM.

};
}

}

Choose a reason for hiding this comment

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

Perhaps consider leaving a new line at the end of this file.

Remove reliance on time elapsed after datetime.now()
@0xEljh 0xEljh merged commit b73c61e into master Nov 8, 2020
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.

2 participants