Brewtarget / brewtarget

Main brewtarget source code repository.
GNU General Public License v3.0
312 stars 134 forks source link

Hop calculation issues #715

Open ID2GO opened 1 year ago

ID2GO commented 1 year ago

Discussed in https://github.com/Brewtarget/brewtarget/discussions/596

Since my upgrade this weekend from version 2.3 to 3.0.5 I noticed that the IBU calculations are off. The higher it should be, the greater the difference becomes. I'm working on a Blond beer with OG 1.052, addition of 45grams with 4,1 Alpha and an intended IBU of 21 Tinseth. Since the upgrade the IBU is shown as 19.1. The numbers do not correct after closing & reopening the program. This problem also shows in other recipes. Is there a way to check the formula & correct it? Originally posted by **jimdbr** May 24, 2021 I am using the latest development version of Brewtarget. I am having issues with hops additions. The calculated IBU is not updated correctly until after I leave the hop tab and return. The numbers are sometimes bogus. A couple of examples: I added 28g of Cascade pellets for 60 minutes and had 0 IBU. I added 28g of Eldorado pellets for 10 minutes and had a calculated IBU of approximately 43,000. I love hops but this might be excessive. I added Galaxy pellets with an alpha of 12 to the database. When I include it in a recipe it comes in as leaf hops instead of pellets. I don't have the previous version of Brewtarget available so I need to head over to Brewers Friend for today's brew. I will play with Brewtarget later to see if any of this is reproducible.
matty0ung commented 1 year ago

Sorry to hear you're having these problems. Thanks for the detailed bug report.

This could be, at least in part, related to https://github.com/Brewtarget/brewtarget/issues/695. Certainly the pellet showing as leaf sounds like it's caused by or related to that problem (which should get fixed in the forthcoming 3.0.6 release.)

I'll see if I can reproduce the problems you're seeing.

ID2GO commented 1 year ago

Thank you for your reply,

Your remark about the leaves triggered a thought to check the recipes again. The install & import changed the hops from pellets to leaves!

Maybe you can recreate this. It's weird as if it's reading the database in a different way, like the data is not stored correctly or differently in the old vs the new database.

23 jan. 2023 16:17:18 matty0ung @.***>:

Sorry to hear you're having these problems. Thanks for the detailed bug report.

This could be, at least in part, related to #695[https://github.com/Brewtarget/brewtarget/issues/695]. Certainly the pellet showing as leaf sounds like it's caused by or related to that problem (which should get fixed in the forthcoming 3.0.6 release.)

I'll see if I can reproduce the problems you're seeing.

— Reply to this email directly, view it on GitHub[https://github.com/Brewtarget/brewtarget/issues/715#issuecomment-1400521232], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AIF3BIURARDQ6DKOTAL7CWLWT2OH5ANCNFSM6AAAAAAUD6FUFM]. You are receiving this because you authored the thread.[Tracking afbeelding][https://github.com/notifications/beacon/AIF3BIQZP3VJ6MJB6GXP6NTWT2OH5A5CNFSM6AAAAAAUD6FUFOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSTPJBBA.gif]

matty0ung commented 1 year ago

This should be fixed in the 3.0.6 release. If you still see problems, please don't hesitate either to reopen this ticket or raise a new one.

ID2GO commented 1 year ago

I installed 3.0.6 and in some, but not all recipes, the pellets flipped to leaves again. I noticed it because the IBU values changed.

Op di 7 feb. 2023 09:48 schreef matty0ung @.***>:

This should be fixed in the 3.0.6 https://github.com/Brewtarget/brewtarget/releases/tag/v3.0.6 release. If you still see problems, please don't hesitate either to reopen this ticket or raise a new one.

— Reply to this email directly, view it on GitHub https://github.com/Brewtarget/brewtarget/issues/715#issuecomment-1420402992, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIF3BIQR763LUI6T3U42S4DWWID6NANCNFSM6AAAAAAUD6FUFM . You are receiving this because you authored the thread.Message ID: @.***>

matty0ung commented 1 year ago

Ah, hmm, interesting. Is it just recipes you edited with the 3.0.5 release or also other ones? Are there any error messages in the log file?

matty0ung commented 1 year ago

I'm wondering if maybe the bug in the 3.0.5 release meant that, after the software "misread" the value of the type field, it wrote the misread value back to the database.

mikfire commented 1 year ago

When I noticed the problem, that was the first thing I looked at. It didn't. Just reading the DB didn't seem to cause the values to be written back. I have no good guesses as to what would happen if a recipe were updated, but the problem would likely be isolated to just that recipe.

ID2GO commented 1 year ago

That recipe and those derived from it.

Op di 21 feb. 2023 13:50 schreef mikfire @.***>:

When I noticed the problem, that was the first thing I looked at. It didn't. Just reading the DB didn't seem to cause the values to be written back. I have no good guesses as to what would happen if a recipe were updated, but the problem would likely be isolated to just that recipe.

— Reply to this email directly, view it on GitHub https://github.com/Brewtarget/brewtarget/issues/715#issuecomment-1438427600, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIF3BIR3N6ME2FS3M7IC4QDWYS23DANCNFSM6AAAAAAUD6FUFM . You are receiving this because you authored the thread.Message ID: @.***>

matty0ung commented 1 year ago

I'll have a crack at doing the case insensitive matching that @mikfire sensibly suggested a while back. I can't promise it will fix things, but it might help. Hopefully @ID2GO you should find that, even before that fix, no further recipes are getting wrong hop types, and so, worst case, it's just needed to manually fix the recipes you manually edited in 3.0.5 (and any derived from them, as you say).

ID2GO commented 1 year ago

Has anyone noticed that when trying to import beerxml data from for instance brew dog that data can not be imported? Is that due to faulty data from Brew Dog or are the beerxml parameters to strict?

matty0ung schreef op ma 23-01-2023 om 07:17 [-0800]:

Sorry to hear you're having these problems. Thanks for the detailed bug report. This could be, at least in part, related to #695. Certainly the pellet showing as leaf sounds like it's caused by or related to that problem (which should get fixed in the forthcoming 3.0.6 release.) I'll see if I can reproduce the problems you're seeing. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

matty0ung commented 1 year ago

Has anyone noticed that when trying to import beerxml data from for instance brew dog that data can not be imported? Is that due to faulty data from Brew Dog or are the beerxml parameters to strict?

Usually the program should try to tell you why it could not import something, but it's true the error messages can be a bit technical. If you attach a problematic XML file here, we'll gladly have a look at it.

matty0ung commented 1 year ago

I downloaded the BeerXML for one of the BrewDog recipes from https://brewdogrecipes.com/recipes/punk-ipa-2007-2010. It's not correct BeerXML, eg it's missing content in the mandatory TYPE field in the STYLE records. (The BeerXML standard says the permitted values for this field are “Lager”, “Ale”, “Mead”, “Wheat”, “Mixed” or “Cider”. The brewdog recipe just has "".)

One of the problems with BeerXML is that the original specification is just a Word document, and there was no machine-parsable schema published for it. We have reverse-engineered a schema for Brewtarget, which gives us a way of validating BeerXML documents before we attempt to read them in (plus some relatively high confidence that the BeerXML we output is valid). But I think a lot of other programs have not gone to such lengths, so there can be a range of interpretations of what's OK.

When we eventually get on to BeerJSON, things will be a lot better as there is an official published schema that everyone is supposed to follow. (The schema has a few flaws, but it's relatively good.)

BeerJSON is taking a while to come, not because the JSON bit is hard but because it's a massively expanded scope compared with BeerXML. There approximately twice as many fields that can be represented in BeerJSON as in BeerXML. We've done most of the hard stuff, but there's still a bit of work to do.

ID2GO commented 1 year ago

Good morning programmers,

Just a thought from a user trying to understand a bit more without the desire or skills to dive into programming.

Would it be possible to build in a way to check and/or ajust formula's according to ones own experience? I don't like the idea that I can not see the calculations behind the outcome. I know my input and I see the output but what's going on in the black box?

Thanx

Rob

Matt Young schreef op za 29-04-2023 om 10:58 [-0700]:

I downloaded the BeerXML for one of the BrewDog recipes from https://brewdogrecipes.com/recipes/punk-ipa-2007-2010. It's not correct BeerXML, eg it's missing content in the mandatory TYPE field in the STYLE records. (The BeerXML standard says the permitted values for this field are “Lager”, “Ale”, “Mead”, “Wheat”, “Mixed” or “Cider”. The brewdog recipe just has "".) One of the problems with BeerXML is that the original specification is just a Word document, and there was no machine-parsable schema published for it. We have reverse-engineered a schema for Brewtarget, which gives us a way of validating BeerXML documents before we attempt to read them in (plus some relatively high confidence that the BeerXML we output is valid). But I think a lot of other programs have not gone to such lengths, so there can be a range of interpretations of what's OK. When we eventually get on to BeerJSON, things will be a lot better as there is an official published schema that everyone is supposed to follow. (The schema has a few flaws, but it's relatively good.) BeerJSON is taking a while to come, not because the JSON bit is hard but because it's a massively expanded scope compared with BeerXML. There approximately twice as many fields that can be represented in BeerJSON as in BeerXML. We've done most of the hard stuff, but there's still a bit of work to do. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>