25 cfg = copy.deepcopy(fc.roomy_tanks(fc.shipped()))
26 t, F, mO, mF = fc.header_curve()
27 cfg.thrust.burn_time = float(t[-1])
28 f =
lambda y: interp1d(t, y, bounds_error=
False, fill_value=0.0)
29 with contextlib.redirect_stdout(io.StringIO()):
30 return setup_flight(cfg, f(F), f(mO), f(mF), liftoff_mass=liftoff)
33@pytest.fixture(scope="module")
65 cfg = copy.deepcopy(fc.roomy_tanks(fc.shipped()))
66 t, F, mO, mF = fc.header_curve()
67 cfg.thrust.burn_time = float(t[-1])
68 f =
lambda y: interp1d(t, y, bounds_error=
False, fill_value=0.0)
69 with contextlib.redirect_stdout(io.StringIO()):
70 return setup_flight(cfg, f(F), f(mO), f(mF), liftoff_mass=liftoff, ullage_gas_kg=gas)
74 own = as_configured[
"mass_budget"][
"ullage_gas_kg"]
77 total = flown[
"flight"].rocket.total_mass(0.0)
78 assert total == pytest.approx(as_configured[
"flight"].rocket.total_mass(0.0) + 0.515, abs=1e-3)
79 assert flown[
"mass_budget"][
"ullage_gas_kg"] == pytest.approx(gas)
80 assert flown[
"mass_budget"][
"airframe_kg"] == pytest.approx(as_configured[
"mass_budget"][
"airframe_kg"])
82 weighed =
_fly_with(liftoff=190.0 * LB, gas=gas)
83 assert weighed[
"flight"].rocket.total_mass(0.0) == pytest.approx(190.0 * LB, abs=1e-3)