From c30f1290c18e26ed7d25cb9cbadfbf1b96bc4922 Mon Sep 17 00:00:00 2001 From: Cal Wing Date: Thu, 27 Feb 2025 19:44:55 +1000 Subject: [PATCH] Try to fix task 7 --- a1.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/a1.py b/a1.py index c434886..583f82a 100644 --- a/a1.py +++ b/a1.py @@ -148,7 +148,7 @@ def calc_heights_water_out(initial_height: float, final_height: float, return water_height, water_mass # Task 7 -def calc_energy_power(heights: float, water_mass_outs: float, +def calc_energy_power(heights: tuple[float, ...], water_mass_outs: tuple[float, ...], relative_elevation: float, efficiency: float, time_inc: float) -> tuple[tuple[float, ...], tuple[float, ...]]: @@ -172,6 +172,7 @@ def calc_daily_profit(energy: tuple[float, ...], peak_tariff: float, # See if I get what the task sheet wants # [NOTE] It seems I am witing my own test suite :/ that wasn't the initention lol +# Tests do equal what I get when i test it in the shell def sheet_tasks(): from debug_lib import NO_EVAL, TUPLE_EVAL from debug_lib import compair_outputs @@ -184,7 +185,7 @@ def sheet_tasks(): (calc_new_water_height, (20, 40000, 1, 30), (19.985143183382704, 592567.1021442247)), (calc_heights_water_out, (40, 5, 40000, 1, 30), ((39.97898928844613, 39.95798409574207, 39.93698442188801), (838016.4324684857, 837796.3120398963, 837576.1916037091), TUPLE_EVAL)), (calc_energy_power, tuple(i for i in calc_heights_water_out(30, 20, 40000, 1, 30)) + (200, 85, 30), ((387.7129370269342, 387.56468335928287, 387.4164575872225), (46525.5524432321, 46507.762003113945, 46489.9749104667), TUPLE_EVAL)) - # (calc_daily_profit, (calc_energy_power(*(tuple(i for i in calc_heights_water_out(30, 20, 40000, 1, 30)) + (200, 85, 30)))[0], peak, off, 30), 2726.5251609213365) + # (calc_daily_profit, (calc_energy_power(*(tuple(i for i in calc_heights_water_out(30, 20, 40000, 1, 30)) + (200, 85, 30)))[0], 0.02, 0.005, 85), 2726.5251609213365) ) compair_outputs(TASKS)