import%20marimo%0A%0A__generated_with%20%3D%20%220.23.9%22%0Aapp%20%3D%20marimo.App()%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%0A%20%20%20%20from%20scripts.learning_path_i18n%20import%20(%0A%20%20%20%20%20%20%20%20docs_reference_links%2C%0A%20%20%20%20%20%20%20%20language_switch_markdown%2C%0A%20%20%20%20%20%20%20%20load_catalog%2C%0A%20%20%20%20%20%20%20%20locale_from_argv%2C%0A%20%20%20%20%20%20%20%20navigation_markdown%2C%0A%20%20%20%20)%0A%0A%20%20%20%20locale%20%3D%20locale_from_argv()%0A%20%20%20%20catalog%20%3D%20load_catalog(%2206_reusable_pipeline_recipes%22%2C%20locale)%0A%0A%20%20%20%20def%20t(key%2C%20**values)%3A%0A%20%20%20%20%20%20%20%20return%20catalog.text(key%2C%20**values)%0A%0A%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20catalog%2C%0A%20%20%20%20%20%20%20%20docs_reference_links%2C%0A%20%20%20%20%20%20%20%20language_switch_markdown%2C%0A%20%20%20%20%20%20%20%20locale%2C%0A%20%20%20%20%20%20%20%20mo%2C%0A%20%20%20%20%20%20%20%20navigation_markdown%2C%0A%20%20%20%20%20%20%20%20t%2C%0A%20%20%20%20)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo%2C%20t)%3A%0A%20%20%20%20mo.md(f%22%23%20%7Bt('title')%7D%5Cn%5Cn%7Bt('intro')%7D%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(language_switch_markdown%2C%20locale%2C%20mo)%3A%0A%20%20%20%20mo.md(language_switch_markdown(%2206_reusable_pipeline_recipes%22%2C%20locale))%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo%2C%20t)%3A%0A%20%20%20%20mo.md(t(%22record_frame%22))%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20json%0A%0A%20%20%20%20import%20numpy%20as%20np%0A%0A%20%20%20%20import%20wandas%20as%20wd%0A%20%20%20%20from%20wandas%20import%20pipeline%20as%20pipeline_api%0A%0A%20%20%20%20return%20json%2C%20np%2C%20pipeline_api%2C%20wd%0A%0A%0A%40app.cell%0Adef%20_(np%2C%20wd)%3A%0A%20%20%20%20template_signal%20%3D%20wd.from_numpy(%0A%20%20%20%20%20%20%20%20np.array(%5B%5B1.0%2C%202.0%2C%204.0%2C%207.0%5D%5D)%2C%0A%20%20%20%20%20%20%20%20sampling_rate%3D8_000%2C%0A%20%20%20%20%20%20%20%20ch_labels%3D%5B%22sensor%22%5D%2C%0A%20%20%20%20)%0A%20%20%20%20template_result%20%3D%20template_signal.remove_dc().normalize()%0A%20%20%20%20return%20(template_result%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo%2C%20t%2C%20template_result)%3A%0A%20%20%20%20mo.md(t(%22template_history%22%2C%20operations%3D%5Brecord%5B%22operation%22%5D%20for%20record%20in%20template_result.operation_history%5D))%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo%2C%20t)%3A%0A%20%20%20%20mo.md(t(%22lineage_explanation%22))%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(pipeline_api%2C%20template_result)%3A%0A%20%20%20%20recipe_plan%20%3D%20pipeline_api.RecipePlan.from_frame(template_result%2C%20input_names%3D(%22signal%22%2C))%0A%20%20%20%20recipe_payload%20%3D%20recipe_plan.to_dict()%0A%20%20%20%20return%20(recipe_payload%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo%2C%20recipe_payload%2C%20t)%3A%0A%20%20%20%20operation_ids%20%3D%20%5Bnode%5B%22operation%22%5D%20for%20node%20in%20recipe_payload%5B%22nodes%22%5D%5D%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20t(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22recipe_table%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20input_name%3Drecipe_payload%5B%22inputs%22%5D%5B0%5D%5B%22name%22%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20node_count%3Dlen(operation_ids)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20operations%3D%22%2C%20%22.join(operation_ids)%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo%2C%20t)%3A%0A%20%20%20%20mo.md(t(%22recipe_schema%22))%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(json%2C%20pipeline_api%2C%20recipe_payload)%3A%0A%20%20%20%20recipe_json%20%3D%20json.dumps(recipe_payload)%0A%20%20%20%20loaded_recipe%20%3D%20pipeline_api.RecipePlan.from_dict(json.loads(recipe_json))%0A%20%20%20%20return%20loaded_recipe%2C%20recipe_json%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo%2C%20recipe_json%2C%20recipe_payload%2C%20t)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20t(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22schema_info%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20schema%3Drecipe_payload%5B%22schema%22%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20version%3Drecipe_payload%5B%22version%22%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20size%3Dlen(recipe_json.encode(%22utf-8%22))%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo%2C%20t)%3A%0A%20%20%20%20mo.md(t(%22json_round_trip%22))%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(loaded_recipe%2C%20np%2C%20wd)%3A%0A%20%20%20%20runtime_signal%20%3D%20wd.from_numpy(%0A%20%20%20%20%20%20%20%20np.array(%5B%5B2.0%2C%205.0%2C%208.0%2C%2014.0%5D%5D)%2C%0A%20%20%20%20%20%20%20%20sampling_rate%3D8_000%2C%0A%20%20%20%20%20%20%20%20metadata%3D%7B%22recording%22%3A%20%22next%22%7D%2C%0A%20%20%20%20%20%20%20%20ch_labels%3D%5B%22sensor%22%5D%2C%0A%20%20%20%20)%0A%20%20%20%20replayed_signal%20%3D%20loaded_recipe.apply(%7B%22signal%22%3A%20runtime_signal%7D)%0A%20%20%20%20direct_signal%20%3D%20runtime_signal.remove_dc().normalize()%0A%20%20%20%20return%20direct_signal%2C%20replayed_signal%2C%20runtime_signal%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(direct_signal%2C%20mo%2C%20np%2C%20replayed_signal%2C%20runtime_signal%2C%20t)%3A%0A%20%20%20%20np.testing.assert_allclose(replayed_signal.data%2C%20direct_signal.data)%0A%20%20%20%20assert%20replayed_signal.metadata%20%3D%3D%20%7B%22recording%22%3A%20%22next%22%7D%0A%20%20%20%20assert%20runtime_signal.operation_history%20%3D%3D%20%5B%5D%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20t(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22direct_result%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20metadata%3Dreplayed_signal.metadata%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20history%3Druntime_signal.operation_history%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo%2C%20t)%3A%0A%20%20%20%20mo.md(t(%22multiple_inputs%22))%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(np%2C%20pipeline_api%2C%20wd)%3A%0A%20%20%20%20base_template%20%3D%20wd.from_numpy(np.array(%5B%5B1.0%2C%201.0%2C%201.0%2C%201.0%5D%5D)%2C%20sampling_rate%3D8_000)%0A%20%20%20%20other_template%20%3D%20wd.from_numpy(np.array(%5B%5B2.0%2C%202.0%2C%202.0%2C%202.0%5D%5D)%2C%20sampling_rate%3D8_000)%0A%20%20%20%20mix_template_result%20%3D%20base_template.mix(other_template)%0A%20%20%20%20mix_recipe%20%3D%20pipeline_api.RecipePlan.from_frame(mix_template_result%2C%20input_names%3D(%22base%22%2C%20%22other%22))%0A%0A%20%20%20%20next_base%20%3D%20wd.from_numpy(np.array(%5B%5B3.0%2C%203.0%2C%203.0%2C%203.0%5D%5D)%2C%20sampling_rate%3D8_000)%0A%20%20%20%20next_other%20%3D%20wd.from_numpy(np.array(%5B%5B4.0%2C%204.0%2C%204.0%2C%204.0%5D%5D)%2C%20sampling_rate%3D8_000)%0A%20%20%20%20mixed_replay%20%3D%20mix_recipe.apply(%7B%22base%22%3A%20next_base%2C%20%22other%22%3A%20next_other%7D)%0A%20%20%20%20return%20mix_recipe%2C%20mixed_replay%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mix_recipe%2C%20mixed_replay%2C%20mo%2C%20np%2C%20t)%3A%0A%20%20%20%20mix_values%20%3D%20mixed_replay.data%0A%20%20%20%20np.testing.assert_allclose(mix_values%2C%207.0)%0A%20%20%20%20mo.md(t(%22mix_result%22%2C%20inputs%3D%5Bitem.name%20for%20item%20in%20mix_recipe.inputs%5D%2C%20values%3Dmix_values.tolist()))%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(catalog%2C%20docs_reference_links%2C%20locale%2C%20mo%2C%20t)%3A%0A%20%20%20%20mo.md(t(%22summary%22%2C%20**docs_reference_links(locale%2C%20catalog)))%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(locale%2C%20mo%2C%20navigation_markdown)%3A%0A%20%20%20%20mo.md(navigation_markdown(%2206_reusable_pipeline_recipes%22%2C%20locale))%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
dc3cfc45808a3b520bdffcda429041e9