moisture experiment
This commit is contained in:
parent
0018ccd15a
commit
b64445b59d
66
moisture.py
66
moisture.py
|
@ -1,26 +1,48 @@
|
||||||
from dataclasses import dataclass
|
|
||||||
|
|
||||||
from experiment import Experiment, Measurement, Variable
|
from experiment import Experiment, Measurement, Variable
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
def make_cold_bath_experiment(
|
||||||
class MoistureExperiment(Experiment):
|
date: str,
|
||||||
def __init__(
|
initial_moisture: float,
|
||||||
self,
|
water_temperature: float,
|
||||||
date: str,
|
soak_time: int,
|
||||||
cold_soak_time: float | None,
|
) -> Experiment:
|
||||||
cold_soak_temp: float | None,
|
|
||||||
hot_soak_time: float | None,
|
|
||||||
hot_soak_temp: float | None,
|
|
||||||
):
|
|
||||||
super().__init__(experiment="Moisture Analysis", date=date)
|
|
||||||
variables = [
|
|
||||||
Variable("cold-soak-time", "hour", (5, 45), cold_soak_time),
|
|
||||||
Variable("cold-soak-temp", "degF", (69, 72), cold_soak_temp),
|
|
||||||
Variable("hot-soak-time", "minute", (5, 20), hot_soak_time),
|
|
||||||
Variable("hot-soak-temp", "degF", (180, 200), hot_soak_temp),
|
|
||||||
]
|
|
||||||
self.add_variables(variables)
|
|
||||||
|
|
||||||
measurement = Measurement("moisture-content", "%", (0.06, 0.08))
|
return Experiment(
|
||||||
self.add_measurement(measurement)
|
date=date,
|
||||||
|
experiment="moisture-cold-bath",
|
||||||
|
variables=[
|
||||||
|
Variable(name="initial-moisture", unit="%", value=initial_moisture),
|
||||||
|
Variable(
|
||||||
|
name="water-temperature", unit="deg F", value=int(water_temperature)
|
||||||
|
),
|
||||||
|
Variable(name="soak-time", unit="hours", value=soak_time),
|
||||||
|
],
|
||||||
|
measurements=[
|
||||||
|
Measurement(name="final-moisture", unit="%"),
|
||||||
|
Measurement(name="final-temperature", unit="deg F"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def make_hot_bath_experiment(
|
||||||
|
date: str,
|
||||||
|
initial_moisture: float,
|
||||||
|
water_temperature: float,
|
||||||
|
soak_time: int,
|
||||||
|
) -> Experiment:
|
||||||
|
|
||||||
|
return Experiment(
|
||||||
|
date=date,
|
||||||
|
experiment="moisture-cold-bath",
|
||||||
|
variables=[
|
||||||
|
Variable(name="initial-moisture", unit="%", value=initial_moisture),
|
||||||
|
Variable(
|
||||||
|
name="water-temperature", unit="deg F", value=int(water_temperature)
|
||||||
|
),
|
||||||
|
Variable(name="soak-time", unit="minutes", value=soak_time),
|
||||||
|
],
|
||||||
|
measurements=[
|
||||||
|
Measurement(name="final-moisture", unit="%"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in New Issue