DIFM-Brain / ofpetrial

GNU General Public License v3.0
0 stars 1 forks source link

least common factor #49

Open tmieno2 opened 3 months ago

tmieno2 commented 3 months ago

Non-ending loop in finding LCM in prep_plot_info().

tmieno2 commented 3 months ago

@brittanikedge, is this example after manual unit conversion? All the machines have decimal numbers.

brittanikedge commented 3 months ago

@tmieno2 The database saves all machines entered on the website in feet; that is why they are all decimals. We could convert it to meters in this case, However, if the problem is with decimals, we still need to solve it as we have other cases where machines are oddly sized. I believe it is Wendte that have a combine for soybean that is something like 43.3 feet wide.

tmieno2 commented 3 months ago

Yes, we need to fix the problem anyway, and it is fixed for the having weirdly sized machines, but not for decimals just because of unit conversion. I don't see why we need to convert the unit on the database to be honest. That is not what the "database" should be doing. What is the benefit?

tmieno2 commented 3 months ago

I can modify the code so that we can do looser matching of LCM though.

brittanikedge commented 3 months ago

The database stores everything in feet rather than having the unit and value stored. Everything is stored in feet and then the unit for reporting preference can be chosen later.

Does that make sense? I feel like maybe something got lost. And yes, no matter what we need to fix it work for decimals because those can exist regardless of whether a value was converted. This is particularly true because lcm() is using the section width which is likely to be a noninteger value.

tmieno2 commented 3 months ago

Yeah, I understand what it is doing. I just though it is odd if you are actively converting units of numbers entered in meter to feet within the database. That could introduces additional unit conversion back to meter. If information is provided in meter by the producer, then meter is probably the unit they want.

Anyway, I will modify the code so that we can find close enough lcm for widths with bunch of decimals.

brittanikedge commented 3 months ago

Ah, I understand. Yes, I told Scott that it didn't matter to me how we store it. But this seemed to be his preference although I don't remember why!

Anyway, thanks!

tmieno2 commented 3 months ago

Got it. Well it is not consequential.

The latest code should solve the problem we had!