diff --git a/recipes.py b/recipes.py index 4dbab2f..293264a 100644 --- a/recipes.py +++ b/recipes.py @@ -150,21 +150,11 @@ class PriceDB: def load(self, dct: Dict[str, Any]) -> List[str]: issues = [] - if isinstance(dct["price"], float): - self.price = dct["price"] - elif isinstance(dct["price"], int): - self.price = float(dct["price"]) - else: - raise RuntimeError(f"{dct['price']} has to be int or float") + self.price = dct["price"] self.amount = 1.0 if "amount" in dct: - if isinstance(dct["amount"], float): - self.amount = dct["amount"] - elif isinstance(dct["amount"], int): - self.amount = float(dct["amount"]) - else: - raise RuntimeError(f"{dct['amount']} has to be int or float") + self.amount = dct["amount"] self.unit = None if "unit" in dct: @@ -194,12 +184,7 @@ class IngredientInstance: self.amount = self.defaultamount if "amount" in dct: - if isinstance(dct["amount"], float): - self.amount = dct["amount"] - elif isinstance(dct["amount"], int): - self.amount = float(dct["amount"]) - else: - raise RuntimeError(f"{dct['amount']} has to be int or float") + self.amount = dct["amount"] self.unit = self.defaultunit if "unit" in dct: