two bugs in Gourmet

Asked by Ed Stevens on 2019-01-25

Running Gourmet 0.17.4 on Ubuntu 16.04 LTS. Really like the program and have been using it for some time now, so feel comfortable with most of the features and operations. That said, I've come across a couple of issues.

Issue #1 - when I enter an ingredient in the input field, if that ingredient starts with the letter 'a', when the ingredient is then added to the ingredient list, the leading 'a' is stripped off, and the quantity is pre-listed as '1'. For example, if I enter 'apple juice', it shows up in the list as 'pple juice' with a quantity of one.

Issue #2 - I add several recipes to a shopping list. On reviewing the shopping list, I see that could have been combined were not - because their names aren't exact matches. For instance, one recipe calls for 'flour, all purpose', and the other 'all-purpose flour'. Well, I understand why they are listed separately in the shopping list at that point, but the problem then is as follows: In order to 'normalize' ingredient names, I go back to the recipes and change the ingredient names to be the same - 'flour' and 'flour', for example. The change is made in the recipe, but when I then delete and rebuild the shopping list, the ingredients there show up with their original - and different - names. The only way I have found to correct this is to completely delete and re-enter a recipe.

Question information

Language:
English Edit question
Status:
Solved
For:
Gourmet Edit question
Assignee:
No assignee Edit question
Solved by:
Ed Stevens
Solved:
2019-01-28
Last query:
2019-01-28
Last reply:
2019-01-26

Hi Ed. I have the same setup.

The first behavior you are describing I cannot reproduce, so can't really say anything about it.

The second issue, however is easily resolved, as Gourmet has functionality for it.
I run Gourmet in a Dutch environment, so I am translating things on the fly and my translations might be off, so bear with me.
Go to Settings --> Plugins.
Open the 3rd tab "Tools" and activate the option "keymanagement" (it is the 3rd from the top).
Close the window.
Open any recipe and click on "edit ingredients". On the left hand side, below "description" and "ingredients" there is now a tab named "ingredient keys". Click that.
You will now see the ingredients of that recipe and their keys. Those keys are the "normalized descriptions" you are talking about.
When you add a new ingredient (your "flour, all-purpose"), a new key is created, identical to the description of the ingredient.
Then you added another new ingredient ("all-purpose flour") which obtained a new key "all-purpose flour".
Although both ingredients are the same for humans, they are not for a computer.
Now lets fix this!
Close the recipe and go to the main Gourmet window. Click on "Tools" and then on "Ingredientkey-management".
If you now type "flour" in the search box, all ingredients with "flour" in their ingredient key will be listed and you can in one go normalize the ingredient key for all your "flour, all-purpose" and all other flours as well (so for example "whole grain flour").
Since now the keys are normalized (i.e. the same) for your all purpose flour, your shopping list will add them up, even if the ingredient itself has a different description. Note: the names shown on the shopping list are the keys, not the ingredients themselves.
Hopes this resolves your issue and answers your question!
Let us know!
Best,
Harald

Ed Stevens (edstevens) said : #2

Harald,

Thanks for the tips. That seems to have taken care of my #2. Being at the "one leg into retirement" end of a career in IT, mostly as a Database Administrator, the concepts are familiar, but I just didn't know how it was implemented in this app.

My #1 is very puzzling and I won't be surprised if no one can reproduce it. I'll do some more focused and controlled testing and see if I can develop a pattern.

Ed Stevens (edstevens) said : #3

Ok, I've done some more testing with the 'truncated leading A' issue. I started entering a new dummy recipe. First ingreditent was 'apples', entered in the 'add ingredient' field. It dropped into the ingredients list as it should, as 'apple' with no quantity or UOM. Next I entered 'apple juice'. I dropped into the list as I described earlier, as 'pple juice', with a quantity of '1' and no UOM.

From there I played around with other things. Anytime the ingredient was a single word beginning with 'a', everything was fine. But if the ingredient was two words with the first beginning with 'a', then the problem occurred.

Saxon Shuttleworth (saxons) said : #4

Hi Ed,

Thank you for reporting these issues. I investigated issue #1.

Environment:
Gourmet 0.17.4 and master branch on Ubuntu and Windows.

Steps to reproduce:
1. Click "New" button for new recipe
2. Click "Ingredients" tab
3. Add each of the following ingredients separately to "Add ingredient" text field:
"apple"
"an apple"
"apple juice"
"Apple juice"
"a beet"
"a dozen eggs"
"a pair of Yubari King melons"

Expected Results:
"apple"
"1 apple"
"apple juice"
"Apple juice"
"1 beet"
"12 eggs"
"2 Yubari King melons"

Actual Results:
1. The ingredients are listed as:
"apple"
"1 apple"
"1 pple juice"
"Apple juice"
"1 beet"
"12 eggs"
"2 Yubari King melons"

Notes:
If the first word in the ingredient string starts with a lower case "a", the first letter ("a") is stripped off and substituted with quantity of "1", "a dozen" is substituted with quantity of "12" and "a pair" is substituted with quantity of "2".

Gourmet is designed to translate words into equivalent numbers,for example:
"a" --> "1"
"an" --> "1"
"a couple" --> "2"
"a dozen" --> "12"
"twenty" --> "20"

Conclusion:
There appears to be a bug in the ingredients parser. The ingredient parser should only translate "a" to "1" if it is single character. In addition, the ingredient parser is not translating capitalized number words correctly, for example:
"A dozen" is not translated to quantity of "12".

Regards,

Saxon.
--

Excellent work, Ed and Saxon,

Gourmet is my go-to application for my kitchen planning, and I would love to see development continuing and improvements and bug-fixes being implemented.

However, I am by no means a programmer; I could contribute in conceptual design and functional testing (with around 15 ERP-implementations under my belt in the role of project manager).

My question would therefore be: who can implement the solution, i.e. who can do the handy-work here?

Can we get together a team that can support Bernard Reiter (who is a great guy and has apparently taken over ownership from Thomas Hinkle, the original creator of this excellent software)?

Gourmet would require an upgrade to Python 3.x and then the various bug fixes and tweaks for it to be future-proof. If not, I am afraid it will become obsolete without any real replacement in existence...

I know launchpad isn't the place to post this, but I'd figure I'd share my two cents...

Harald

Ed Stevens (edstevens) said : #6

So how does this work? I understand Gourmet is an open source project, but even after a 30+ year career in IT, I've never really looked at how such projects work and are maintained. And at this point in my life/career I really have no interest in learning a whole new language and infrastructure from scratch. Is Gourmet being maintained at all? If so, how does one go about filing an 'official' bug report to the developers?

Saxon Shuttleworth (saxons) said : #7

Hi Ed,

You can file bug reports and make feature requests from the Gourmet GitHub project page:
https://github.com/thinkle/gourmet/issues

Gourmet maintenance activity is unfortunately low. I'm in the process of learning and at the same time cleaning up the code base in preparation to upgrade the application to Python 3 and the latest GTK. I'm hoping to have something by the end of summer.

Regards,

Saxon.
--

Ed Stevens (edstevens) said : #8

Saxon - thanks for the lead. I'll file the bug report.