Skip to content

Change the scaling behavior to default to representing servings rather than a multiplier #90

@melaniejones731

Description

@melaniejones731

The documentation for the CLI says that scale is implemented like this:

Scaling Recipes
Scale recipes on the fly using the : notation or the --scale flag:

# Double a recipe
cook recipe "Pizza.cook:2"

# Scale to 1.5x
cook recipe "Cake.cook" --scale 1.5

# Quarter a recipe
cook recipe "Soup.cook:0.25"

This is multiplier behavior.

I don't believe this is intuitive, especially when recipes servings are larger. If I am cooking a recipe with serving size 20, it is more likely that I want to serve 6 or 24 people than 10 or 40.

To me, it is vastly more conceivable to think if a user inputs cook recipe "Pizza.cook:2", their intent is to scale the recipe to 2 SERVINGS.

I would like to modify the default behavior to this:

Scaling Recipes
Scale recipes on the fly using the : notation or the --scale flag:

# Double a recipe
cook recipe "Pizza.cook:2x"

# Scale to 1.5x
cook recipe "Cake.cook" --scale 1.5

# Quarter a recipe
cook recipe "Soup.cook:0.25x"

# Scale to serving 2 people
cook recipe "Pizza.cook:2" 

# Scale to serving 10 people
cook recipe "Pizza.cook:10"


However, doing so could be a breaking change unless the underlying code in scale.rs for scale_to_target is updated to gracefully handle the scenario "unit" is none and serving is defined (or not) as it could lead to ambiguity when cli calls are made.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions