Giter Site home page Giter Site logo

Comments (6)

MFogleman avatar MFogleman commented on August 16, 2024

I created this beast.

The problem with the 'Bushel' is that it is completely not defined. A bushel of oats is a different weight than a bushel of wheat. The weight of a bushel of wheat is also going to vary depending on where you are. I found This site, which has some state standards that recognize some federal standards.

You also have to consider that the bushels weight assumes a specific moisture and other states of the product in certain products.

From https://www.thebalance.com/how-much-is-a-bushel-1389308

A bushel of tomatoes, for example, is supposed to weigh 56 pounds, as is a bushel of shelled corn. But if the corn is still in ears, a bushel is supposed to weigh a whopping 70 pounds. Leaves and greens take up more space with less weight, so a bushel of spinach need only be 20 pounds.

So you are looking at close to 100 usage cases for a bushel. This list would still be inaccurate in certain scenarios due to variances of the definition of a bushel of that product, and also not inclusive of all use cases.

Other options include

a measure of capacity equal to 64 US pints (equivalent to 35.2 liters), used for dry goods.
and convert it to kilograms. Or pick a common agricultural bushel, and add a disclaimer (maybe links to other bushel definitions).

I think no matter what, a disclaimer of how vague a 'bushel' is, should probably be included.

from metric_units_reddit_bot.

cannawen avatar cannawen commented on August 16, 2024

Yeah... I didn't realize how many kinds of bushels there were until all the farmers were upset in my reddit feedback thread, haha! I asked them if a volumetric conversion would be better, and they said no.

I feel like some simple keyword matching would help a lot, like if a post said "1 bushel of tomatoes" then we would use tomato-bushels.

Code-wise it might not be so bad if we made a object like

[
  {
    regex: /tomato(?:es)?/,
    lbs: 56
  },
  {
    regex: /spinach/,
    lbs: 20
  },
  {
    regex: function(inputString) {
      return inputString.match("ear") && inputString.match("corn");
    },
    lbs: 70
  }
  ...
]

But yes, it might be a fair bit of work to take into account ALL the bushel types... hmm. Maybe we can just start with a few, and then expand our bushel-recognition slowly? Is this a task you would like to continue, or are you sick of dealing with bushels? :o)

from metric_units_reddit_bot.

MFogleman avatar MFogleman commented on August 16, 2024

I'd like to give it a shot, but don't know how much time I'll have to devote to it. If anyone else wants to as well (It is hacktoberfest), I won't be offended. I think there is enough work and edge cases to keep multiple contributors busy.

from metric_units_reddit_bot.

cannawen avatar cannawen commented on August 16, 2024

@MFogleman Maybe you can do 2-3 bushel numbers to get the ball rolling, and I can make issues afterwards for other people to add more bushel types? If you get too busy just give me a shout here and I can try to find someone else to do it. Thank you!! :)

from metric_units_reddit_bot.

cannawen avatar cannawen commented on August 16, 2024

Hey @MFogleman, we have just added a CONTRIBUTING.md doc, please check it out when you have time! Sections "Etiquette", "Work on an issue" and "Make a PR" are most important

from metric_units_reddit_bot.

cannawen avatar cannawen commented on August 16, 2024

I'm going to temporarily remove bushels from all conversions to solve this issue for now, an issue can be opened later on to fix it "properly," taking into account keywords :)

from metric_units_reddit_bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.