All pages
Powered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

Tutorials

Making Your First Marinara

This tutorial will guide you through creating a classic marinara sauce using TomatoPy. We'll cover everything from ingredient selection to final taste testing.

Prerequisites

Before starting, make sure you have:

  • Basic understanding of Python

  • TomatoPy installed

  • Virtual environment set up

Step 1: Setting Up Your Kitchen

First, let's initialize our virtual kitchen and configure the equipment:

from tomatopy import Kitchen, KitchenHardware

# Initialize kitchen
kitchen = Kitchen()

# Set up hardware
hardware = KitchenHardware()
stove = hardware.get_stove()
blender = hardware.get_blender()

# Configure stove
stove.configure(
    burners={
        1: {"temperature": 100, "size": "medium"},  # For simmering
        2: {"temperature": 200, "size": "large"}    # For initial cooking
    }
)

Step 2: Preparing Ingredients

Let's create our ingredients with optimal properties:

from tomatopy import Tomato, Garlic, Basil, OliveOil

# Create San Marzano tomatoes
tomatoes = Tomato(
    ripeness=0.9,
    variety="San Marzano",
    weight=800  # grams
)

# Create fresh garlic
garlic = Garlic(
    cloves=4,
    freshness=0.95,
    size="medium"
)

# Create fresh basil
basil = Basil(
    leaves=20,
    freshness=0.95,
    variety="Genovese"
)

# Create olive oil
olive_oil = OliveOil(
    amount=60,  # ml
    quality="extra_virgin",
    acidity=0.3  # %
)

Step 3: Creating the Recipe

Let's set up our recipe with proper proportions and cooking instructions:

from tomatopy import Recipe

# Create marinara recipe
marinara = Recipe("Classic Marinara")

# Add ingredients
marinara.add_ingredient(tomatoes)
marinara.add_ingredient(garlic)
marinara.add_ingredient(basil)
marinara.add_ingredient(olive_oil)

# Set cooking parameters
marinara.set_cooking_method("simmer")
marinara.set_duration("45m")
marinara.set_temperature(100)  # Celsius

Step 4: Cooking Process

Now, let's execute the cooking process step by step:

# Step 1: Heat oil and garlic
garlic_oil = kitchen.cook(
    [olive_oil, garlic],
    method="sauté",
    temperature=160,
    duration="5m",
    stirring_frequency="constant"
)

# Step 2: Add and cook tomatoes
tomato_mixture = kitchen.cook(
    [garlic_oil, tomatoes],
    method="simmer",
    temperature=100,
    duration="30m",
    stirring_frequency="occasional"
)

# Step 3: Blend the sauce
sauce = blender.blend(
    tomato_mixture,
    speed="medium",
    duration="1m",
    consistency="smooth"
)

# Step 4: Add basil and finish
final_sauce = kitchen.cook(
    [sauce, basil],
    method="simmer",
    temperature=90,
    duration="10m",
    stirring_frequency="occasional"
)

Step 5: Quality Control

Let's analyze our sauce to ensure it meets our standards:

from tomatopy import TasteTester

# Create taste tester
tester = TasteTester()

# Analyze sauce
profile = tester.analyze(final_sauce)

# Check quality metrics
print(f"Sweetness: {profile.sweetness}")
print(f"Acidity: {profile.acidity}")
print(f"Umami: {profile.umami}")
print(f"Overall balance: {profile.balance}")

# Get texture analysis
texture = tester.analyze_texture(final_sauce)
print(f"Consistency: {texture.consistency}")
print(f"Smoothness: {texture.smoothness}")

Step 6: Adjustments and Refinements

Based on our analysis, we can make adjustments if needed:

# If too acidic, add a pinch of sugar
if profile.acidity > 0.7:
    final_sauce = kitchen.adjust(
        final_sauce,
        ingredient="sugar",
        amount=5,  # grams
        method="stir"
    )

# If too thick, add some water
if texture.consistency > 0.8:
    final_sauce = kitchen.adjust(
        final_sauce,
        ingredient="water",
        amount=50,  # ml
        method="stir"
    )

Step 7: Final Quality Check

Let's perform a final quality assessment:

# Get comprehensive quality report
quality_report = tester.assess_quality(final_sauce)

# Print quality metrics
print(f"Overall quality: {quality_report.overall_score}")
print(f"Balance score: {quality_report.balance_score}")
print(f"Texture score: {quality_report.texture_score}")

# Get recommendations
print("Recommendations:")
for rec in quality_report.recommendations:
    print(f"- {rec}")

Troubleshooting

Common Issues

  1. Sauce Too Acidic

    # Add sugar to balance acidity
    sauce = kitchen.adjust(sauce, ingredient="sugar", amount=5)
  2. Sauce Too Thick

    # Add water to thin sauce
    sauce = kitchen.adjust(sauce, ingredient="water", amount=50)
  3. Insufficient Flavor

    # Add more garlic or basil
    sauce = kitchen.adjust(sauce, ingredient="garlic", amount=2)

Best Practices

  1. Always Check Ingredient Quality

    if not all(ing.is_fresh() for ing in [tomatoes, garlic, basil]):
        print("Warning: Some ingredients may not be fresh")
  2. Monitor Temperature

    with kitchen.temperature_monitor() as monitor:
        sauce = kitchen.cook(...)
        if monitor.get_max() > 110:
            print("Warning: Temperature too high")
  3. Regular Stirring

    # Set up automatic stirring
    kitchen.set_stirring_frequency("every_5m")

Next Steps

  • Perfect Pizza Production - Learn to make pizza

  • Advanced Flavor Profiling - Master taste analysis

  • API Reference - Explore the full API

Advanced Flavor Profiling

This tutorial will guide you through advanced techniques for analyzing and optimizing flavor profiles using TomatoPy's taste testing capabilities.

Prerequisites

Before starting, make sure you have:

  • Basic understanding of Python

  • TomatoPy installed

  • Understanding of basic taste concepts

  • Experience with basic flavor analysis

Step 1: Setting Up the Taste Testing Environment

First, let's initialize our taste testing environment:

Step 2: Basic Flavor Analysis

Let's start with a comprehensive flavor analysis:

Step 3: Advanced Aroma Analysis

Let's dive deep into aroma profiling:

Step 4: Texture Analysis

Let's analyze the texture profile:

Step 5: Flavor Balance Analysis

Let's analyze the balance of flavors:

Step 6: Comparative Analysis

Let's compare multiple ingredients:

Step 7: Flavor Optimization

Let's optimize the flavor profile:

Step 8: Advanced Visualization

Let's create detailed visualizations of our flavor profiles:

Advanced Techniques

Multi-Dimensional Analysis

Time-Based Analysis

Statistical Analysis

Best Practices

  1. Proper Sample Preparation

  2. Comprehensive Analysis

  3. Data Validation

Next Steps

  • - Explore the full API

  • - Learn optimization techniques

  • - Try more recipes

from tomatopy import TasteTester, TasteProfile

# Initialize taste tester
tester = TasteTester()

# Configure testing environment
tester.configure(
    temperature=22,  # Celsius
    humidity=0.65,
    lighting="standard",
    background_noise="minimal"
)
# Create a test ingredient
from tomatopy import Tomato

test_tomato = Tomato(
    ripeness=0.9,
    variety="San Marzano",
    weight=150  # grams
)

# Perform comprehensive analysis
profile = tester.analyze(
    test_tomato,
    depth="comprehensive",
    include_aroma=True,
    include_texture=True
)

# Access basic metrics
print(f"Sweetness: {profile.sweetness}")
print(f"Acidity: {profile.acidity}")
print(f"Umami: {profile.umami}")
# Get detailed aroma profile
aroma_profile = tester.analyze_aroma(
    test_tomato,
    include_secondary_notes=True,
    include_tertiary_notes=True
)

# Access aroma metrics
print("Primary Notes:")
for note in aroma_profile.primary_notes:
    print(f"- {note.name}: {note.intensity}")

print("\nSecondary Notes:")
for note in aroma_profile.secondary_notes:
    print(f"- {note.name}: {note.intensity}")

print("\nTertiary Notes:")
for note in aroma_profile.tertiary_notes:
    print(f"- {note.name}: {note.intensity}")
# Get detailed texture profile
texture_profile = tester.analyze_texture(
    test_tomato,
    include_mouthfeel=True,
    include_structural_analysis=True
)

# Access texture metrics
print(f"Firmness: {texture_profile.firmness}")
print(f"Juiciness: {texture_profile.juiciness}")
print(f"Mouthfeel: {texture_profile.mouthfeel}")
print(f"Structural integrity: {texture_profile.structural_integrity}")
# Analyze flavor balance
balance = tester.analyze_balance(test_tomato)

# Access balance metrics
print(f"Overall balance: {balance.overall_score}")
print(f"Sweet-sour ratio: {balance.sweet_sour_ratio}")
print(f"Umami enhancement: {balance.umami_enhancement}")
print(f"Flavor complexity: {balance.complexity}")
# Create multiple test ingredients
tomato1 = Tomato(ripeness=0.8, variety="San Marzano")
tomato2 = Tomato(ripeness=0.9, variety="Roma")
tomato3 = Tomato(ripeness=0.7, variety="Cherry")

# Perform comparative analysis
comparison = tester.compare(
    [tomato1, tomato2, tomato3],
    metrics=["sweetness", "acidity", "umami", "aroma"]
)

# Access comparison results
print("\nSweetness Comparison:")
for tomato, score in comparison.get_rankings("sweetness"):
    print(f"- {tomato.variety}: {score}")

print("\nAcidity Comparison:")
for tomato, score in comparison.get_rankings("acidity"):
    print(f"- {tomato.variety}: {score}")
# Create a target profile
target_profile = TasteProfile(
    sweetness=0.7,
    acidity=0.6,
    umami=0.8,
    aroma_intensity=0.75
)

# Analyze current profile
current_profile = tester.analyze(test_tomato)

# Get optimization recommendations
recommendations = tester.get_optimization_recommendations(
    current_profile,
    target_profile
)

# Print recommendations
print("\nOptimization Recommendations:")
for rec in recommendations:
    print(f"- {rec}")
# Create basic visualization
viz = tester.visualize_profile(profile)

# Customize visualization
viz.set_color_scheme("tomato")
viz.set_scale("logarithmic")
viz.set_style("radar")

# Add additional metrics
viz.add_metrics(["aroma", "texture"])

# Display visualization
viz.show()
# Perform multi-dimensional analysis
analysis = tester.analyze_multi_dimensional(
    test_tomato,
    dimensions=[
        "taste",
        "aroma",
        "texture",
        "mouthfeel",
        "aftertaste"
    ]
)

# Access multi-dimensional results
print("\nMulti-Dimensional Analysis:")
for dimension, metrics in analysis.items():
    print(f"\n{dimension.upper()}:")
    for metric, value in metrics.items():
        print(f"- {metric}: {value}")
# Analyze flavor development over time
time_analysis = tester.analyze_time_development(
    test_tomato,
    duration="5m",
    interval="30s"
)

# Plot time-based development
viz = tester.visualize_time_development(time_analysis)
viz.show()
# Perform statistical analysis
stats = tester.analyze_statistics(
    [tomato1, tomato2, tomato3],
    metrics=["sweetness", "acidity", "umami"]
)

# Access statistical results
print("\nStatistical Analysis:")
print(f"Mean sweetness: {stats.mean('sweetness')}")
print(f"Standard deviation: {stats.std('sweetness')}")
print(f"Correlation matrix: {stats.correlation_matrix}")
# Ensure consistent sample preparation
if not tester.validate_sample(test_tomato):
    print("Warning: Sample may not be suitable for analysis")
# Use comprehensive analysis for detailed results
profile = tester.analyze(
    ingredient,
    depth="comprehensive",
    include_all_metrics=True
)
# Validate analysis results
if profile.is_valid():
    # Proceed with analysis
    print(profile.get_summary())
else:
    print("Warning: Analysis may be incomplete")
API Reference
Best Practices
Recipes Library

Perfect Pizza Production

This tutorial will guide you through creating a perfect pizza using TomatoPy. We'll cover everything from dough preparation to final baking and quality assessment.

Prerequisites

Before starting, make sure you have:

  • Basic understanding of Python

  • TomatoPy installed

  • Virtual environment set up

  • Understanding of basic pizza concepts

Step 1: Setting Up Your Kitchen

First, let's initialize our virtual kitchen and configure the pizza oven:

from tomatopy import Kitchen, KitchenHardware

# Initialize kitchen
kitchen = Kitchen()

# Set up hardware
hardware = KitchenHardware()
oven = hardware.get_oven()

# Configure pizza oven
oven.configure(
    temperature=450,  # Celsius
    heat_source="wood",
    humidity=0.65,
    heat_zones={
        "center": 450,
        "edges": 480,
        "top": 460
    }
)

Step 2: Preparing the Dough

Let's create the perfect pizza dough with proper fermentation:

from tomatopy import PizzaDough

# Create pizza dough
dough = PizzaDough(
    thickness="medium",
    size="14inch",
    style="neapolitan",
    hydration=0.65,  # 65% hydration
    fermentation_time="24h",
    flour_type="00",
    salt_content=0.02  # 2% salt
)

# Check dough properties
print(f"Dough hydration: {dough.get_hydration()}")
print(f"Fermentation status: {dough.get_fermentation_status()}")

Step 3: Creating the Sauce

Let's prepare a classic pizza sauce:

from tomatopy import PizzaSauce, Tomato, Garlic, Basil

# Create sauce ingredients
tomatoes = Tomato(
    ripeness=0.9,
    variety="San Marzano",
    weight=400  # grams
)

garlic = Garlic(
    cloves=3,
    freshness=0.95,
    size="medium"
)

basil = Basil(
    leaves=10,
    freshness=0.95,
    variety="Genovese"
)

# Create pizza sauce
sauce = PizzaSauce(
    base="tomato",
    consistency="smooth",
    seasoning_level="medium",
    herbs=["basil", "oregano"],
    garlic_content=0.05,  # 5% garlic
    sugar_content=0.02    # 2% sugar
)

Step 4: Preparing Toppings

Let's set up our toppings with proper proportions:

from tomatopy import Topping

# Create toppings
mozzarella = Topping(
    name="mozzarella",
    amount=200,  # grams
    distribution="even",
    moisture_content=0.52
)

pepperoni = Topping(
    name="pepperoni",
    amount=100,  # grams
    distribution="scattered",
    spiciness="medium"
)

basil = Topping(
    name="basil",
    amount=10,  # leaves
    distribution="scattered",
    freshness=0.95
)

Step 5: Assembling the Pizza

Now, let's create and assemble our pizza:

from tomatopy import Pizza

# Create pizza
pizza = Pizza(
    dough=dough,
    sauce=sauce,
    size="14inch",
    style="neapolitan"
)

# Add toppings
pizza.add_topping(mozzarella)
pizza.add_topping(pepperoni)
pizza.add_topping(basil)

# Check topping distribution
distribution = pizza.get_topping_distribution()
print(f"Topping distribution score: {distribution}")

Step 6: Baking Process

Let's execute the baking process with proper temperature control:

# Pre-heat oven
oven.preheat(
    temperature=450,
    duration="30m",
    heat_zones={
        "center": 450,
        "edges": 480,
        "top": 460
    }
)

# Bake pizza
baked_pizza = oven.bake(
    pizza,
    duration="2m",
    rotation_frequency="30s",
    steam_injection=True,
    crust_development="high"
)

# Monitor baking process
with oven.temperature_monitor() as monitor:
    print(f"Center temperature: {monitor.get_center_temp()}°C")
    print(f"Edge temperature: {monitor.get_edge_temp()}°C")

Step 7: Quality Assessment

Let's analyze our pizza to ensure it meets our standards:

from tomatopy import TasteTester

# Create taste tester
tester = TasteTester()

# Analyze pizza
profile = tester.analyze(baked_pizza)

# Check quality metrics
print(f"Crust crispness: {profile.crust_crispness}")
print(f"Cheese melt: {profile.cheese_melt}")
print(f"Topping distribution: {profile.topping_distribution}")

# Get texture analysis
texture = tester.analyze_texture(baked_pizza)
print(f"Crust texture: {texture.crust_texture}")
print(f"Cheese texture: {texture.cheese_texture}")

Step 8: Cutting and Serving

Let's cut our pizza into perfect slices:

# Cut pizza into slices
slices = baked_pizza.cut(
    method="standard",
    slices=8,
    slice_size="equal"
)

# Analyze slice quality
for i, slice in enumerate(slices):
    print(f"Slice {i+1} quality: {slice.get_quality_score()}")

Troubleshooting

Common Issues

  1. Soggy Crust

    # Adjust oven temperature and baking time
    baked_pizza = oven.bake(
        pizza,
        temperature=480,  # Higher temperature
        duration="1m30s"  # Shorter duration
    )
  2. Uneven Topping Distribution

    # Redistribute toppings
    pizza.redistribute_toppings(
        method="even",
        target_distribution=0.9
    )
  3. Overcooked Cheese

    # Adjust cheese layer
    pizza.adjust_cheese_layer(
        thickness="medium",
        distribution="even"
    )

Best Practices

  1. Proper Dough Fermentation

    # Check fermentation
    if dough.fermentation_time < "24h":
        print("Warning: Dough may not be fully fermented")
  2. Temperature Control

    # Monitor oven temperature
    with oven.temperature_monitor() as monitor:
        if monitor.get_max() > 500:
            print("Warning: Oven temperature too high")
  3. Topping Balance

    # Check topping balance
    if pizza.get_topping_balance() < 0.8:
        print("Warning: Toppings may not be balanced")

Advanced Techniques

Creating Multiple Pizzas

# Create batch of pizzas
pizzas = [
    Pizza.create_neapolitan(size="12inch"),
    Pizza.create_ny_style(size="18inch"),
    Pizza.create_chicago_style(size="10inch")
]

# Bake batch
baked_pizzas = oven.bake_batch(
    pizzas,
    rotation_frequency="30s",
    steam_injection=True
)

Custom Crust Development

# Configure advanced crust development
baked_pizza = oven.bake(
    pizza,
    crust_development={
        "bottom": "crispy",
        "edges": "chewy",
        "top": "golden"
    }
)

Next Steps

  • Advanced Flavor Profiling - Master taste analysis

  • API Reference - Explore the full API

  • Best Practices - Learn optimization techniques