import%20marimo%0A%0A__generated_with%20%3D%20%220.25.2%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22%2C%20app_title%3D%22Capstone%20%C2%B7%20The%20next%20round%22)%0A%0Awith%20app.setup%3A%0A%20%20%20%20%23%20The%20setup%20cell%20runs%20first.%20It%20holds%20the%20imports%20and%20settings%20every%20other%20cell%20uses.%0A%20%20%20%20import%20importlib%0A%20%20%20%20import%20re%0A%20%20%20%20import%20tomllib%0A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20import%20pandas%20as%20pd%0A%0A%20%20%20%20import%20course%20%20%23%20this%20course's%20helpers%3A%20file%20locations%20and%20the%20database%0A%20%20%20%20from%20course%20import%20PATHS%0A%0A%20%20%20%20ROUND_ID%20%3D%20%222024Q3%22%20%20%23%20Round%204%2C%20released%20when%20the%20capstone%20starts%0A%20%20%20%20ROUND%20%3D%20re.compile(r%22%5E%5Cd%7B4%7DQ%5B1-4%5D%24%22)%20%20%23%20what%20a%20round%20ID%20looks%20like%2C%20as%20in%20run.py%0A%20%20%20%20THIS%20%3D%20%2233_capstone_next_round.py%22%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%20Capstone%20%C2%B7%20The%20next%20round%0A%0A%20%20%20%20The%20capstone%20is%20done%20**in%20groups**%3A%20your%20table%20is%20your%20group.%20Each%20group%20picks%20one%20of%20three%20options%2C%20works%20on%20it%20together%2C%20and%20presents%20it%20at%2015%3A45.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20course.capstone_options(THIS)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20group_name%20%3D%20mo.ui.text(label%3D%22Your%20group's%20name%20(your%20table)%3A%22%2C%20placeholder%3D%22like%20Table%203%22%2C%20full_width%3DTrue)%0A%20%20%20%20group_name%0A%20%20%20%20return%20(group_name%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(rf%22%22%22%0A%20%20%20%20%23%23%201%20%C2%B7%20The%20brief%0A%0A%20%20%20%20A%20new%20round%20arrives.%20Nobody%20tells%20you%20what%20is%20different%20about%20it.%20Your%20pipeline%20must%20take%20it%2C%20or%20stop%2C%20or%20warn%2C%20with%20a%20message%20you%20can%20explain.%20Then%20your%20group%20decides%20what%20happens%20to%20the%20release%2C%20and%20says%20why.%20This%20is%20the%20job%20the%20course%20was%20building%20towards%3A%20not%20writing%20new%20code%2C%20but%20running%20what%20you%20built%20on%20data%20you%20have%20not%20seen%2C%20and%20accounting%20for%20every%20number%20that%20leaves%20your%20hands.%0A%0A%20%20%20%20%7C%20%7C%20**Round%204**%20%7C%20**or%3A%20your%20own%20next%20survey%20release**%20%7C%0A%20%20%20%20%7C%3A--%7C%3A--%7C%3A--%7C%0A%20%20%20%20%7C%20the%20data%20%7C%20%60rounds%2F%7BROUND_ID%7D%2Fsurvey.csv%60%2C%20released%20at%20the%20start%20of%20the%20capstone%20%7C%20the%20next%20release%20of%20a%20survey%20file%20you%20work%20with%2C%20if%20it%20has%20the%20survey's%20columns%20(household%2C%20member%2C%20area%20code%2C%20region%2C%20age%2C%20sex%2C%20weight)%20%7C%0A%20%20%20%20%7C%20getting%20it%20%7C%20your%20facilitator%20shares%20%60data-management-round4.zip%60%3A%20copy%20it%20into%20the%20course%20folder%20and%20run%20%60uv%20run%20python%20-m%20zipfile%20-e%20data-management-round4.zip%20..%60%2C%20as%20for%20a%20day's%20update%20(%60SETUP.md%60)%20%7C%20copy%20it%20into%20%60rounds%2F%3Cround%20ID%3E%2F%60%2C%20with%20a%20round%20ID%20like%20%602025Q1%60%20%7C%0A%20%20%20%20%7C%20configuring%20it%20%7C%20%6010_get_round.py%60%2C%20section%202%2C%20as%20for%20every%20round%20%7C%20the%20same%2C%20using%20the%20*Adapting%20this%20to%20your%20data*%20notes%20at%20the%20end%20of%20%6010_get_round.py%60%20%7C%0A%0A%20%20%20%20**Working%20as%20a%20group.**%20Everyone%20has%20a%20pipeline%3A%20run%20the%20round%20on%20**each**%20of%20your%20laptops.%20Pipelines%20written%20by%20different%20people%20may%20catch%20different%20things%3B%20where%20yours%20disagree%2C%20find%20out%20why.%20That%20is%20your%20best%20material%20for%2015%3A45.%0A%0A%20%20%20%20**The%20steps%3A**%0A%0A%20%20%20%201.%20**Configure**%20the%20round%2C%20then%20run%20the%20whole%20pipeline%20with%20one%20command%3A%20%60uv%20run%20python%20run.py%20--round%20%3Cround%20ID%3E%60.%0A%20%20%20%202.%20**Explain**%20every%20stop%20and%20every%20warning%20it%20prints%2C%20in%20the%20fixed%20order%20from%20the%20new-edition%20module%20(%6030_new_edition.py%60)%3A%20read%20the%20message%2C%20find%20the%20stage%2C%20look%20at%20the%20rows%2C%20then%20decide%20whether%20the%20data%2C%20the%20code%20or%20the%20configuration%20is%20wrong%20(%6030_new_edition.py%60%2C%20section%202).%0A%20%20%20%203.%20**Compare**%20the%20round%20with%20the%20one%20before%20it%20(section%203)%3A%20the%20numbers%20that%20moved%20are%20your%20evidence.%0A%20%20%20%204.%20**Decide**%20what%20happens%20to%20the%20release%2C%20and%20**write%20the%20group's%20note**%20(section%204).%0A%0A%20%20%20%20The%20checklist%20below%20fills%20itself%20in%20from%20your%20files.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%202%20%C2%B7%20Where%20you%20are%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20found_rounds()%20-%3E%20list%5Bstr%5D%3A%0A%20%20%20%20%22%22%22Round%20IDs%20that%20have%20a%20folder%20in%20rounds%2F%20or%20a%20saved%20configuration.%22%22%22%0A%20%20%20%20folders%20%3D%20%7Bp.name%20for%20p%20in%20(PATHS.root%20%2F%20%22rounds%22).iterdir()%20if%20p.is_dir()%7D%20if%20(PATHS.root%20%2F%20%22rounds%22).exists()%20else%20set()%0A%20%20%20%20saved%20%3D%20%7Bp.stem%20for%20p%20in%20PATHS.config.glob(%22*.toml%22)%20if%20not%20p.stem.endswith(%22.check%22)%7D%0A%20%20%20%20return%20sorted(r%20for%20r%20in%20folders%20%7C%20saved%20if%20ROUND.match(r))%0A%0A%0A%40app.function%0Adef%20round_status(round_id%3A%20str%2C%20group%3A%20str)%20-%3E%20pd.DataFrame%3A%0A%20%20%20%20%22%22%22The%20checklist%20for%20one%20round%20and%20one%20group%2C%20read%20from%20the%20files%20and%20the%20database%3A%20what%20is%20done%2C%20and%20what%20to%20do%20next.%22%22%22%0A%20%20%20%20rows%20%3D%20%5B%5D%0A%0A%20%20%20%20def%20step(name%3A%20str%2C%20done%3A%20bool%2C%20detail%3A%20str%2C%20next_step%3A%20str)%20-%3E%20None%3A%0A%20%20%20%20%20%20%20%20rows.append(%7B%22step%22%3A%20name%2C%20%22done%22%3A%20%22yes%22%20if%20done%20else%20%22not%20yet%22%2C%20%22detail%22%3A%20detail%2C%20%22next%22%3A%20%22%22%20if%20done%20else%20next_step%7D)%0A%0A%20%20%20%20files%20%3D%20sorted((PATHS.root%20%2F%20%22rounds%22%20%2F%20round_id).glob(%22*%22))%20if%20(PATHS.root%20%2F%20%22rounds%22%20%2F%20round_id).exists()%20else%20%5B%5D%0A%20%20%20%20step(%22The%20round's%20file%20is%20in%20rounds%2F%22%2C%20bool(files)%2C%20%22%2C%20%22.join(p.name%20for%20p%20in%20files)%2C%20f%22Unzip%20Round%204%2C%20or%20copy%20your%20own%20release%20into%20rounds%2F%7Bround_id%7D%2F%20(section%201).%22)%0A%0A%20%20%20%20config_file%20%3D%20PATHS.config%20%2F%20f%22%7Bround_id%7D.toml%22%0A%20%20%20%20config%20%3D%20tomllib.loads(config_file.read_text(encoding%3D%22utf-8%22))%20if%20config_file.exists()%20else%20None%0A%20%20%20%20step(%22Configuration%20saved%22%2C%20config%20is%20not%20None%2C%20f%22%7Bconfig%5B'file'%5D%7D%2C%20code%20list%20edition%20%7Bconfig.get('code_list_edition'%2C%20'2023Q4')%7D%22%20if%20config%20else%20%22%22%2C%0A%20%20%20%20%20%20%20%20%20%2210_get_round.py%2C%20section%202%3A%20map%20each%20role%20to%20a%20column%2C%20pick%20the%20code%20list%20edition%2C%20and%20save.%22)%0A%0A%20%20%20%20staged%20%3D%20stored%20%3D%200%0A%20%20%20%20if%20PATHS.database.exists()%3A%0A%20%20%20%20%20%20%20%20with%20course.database(read_only%3DTrue)%20as%20con%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20tables%20%3D%20%7Br%5B0%5D%20for%20r%20in%20con.execute(%22SELECT%20table_name%20FROM%20duckdb_tables()%22).fetchall()%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20f%22staging_%7Bround_id.lower()%7D%22%20in%20tables%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20staged%20%3D%20con.execute(f%22SELECT%20count(*)%20FROM%20staging_%7Bround_id.lower()%7D%22).fetchall()%5B0%5D%5B0%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%22persons%22%20in%20tables%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20stored%20%3D%20con.execute(%22SELECT%20count(*)%20FROM%20persons%20WHERE%20round%20%3D%20%3F%22%2C%20%5Bround_id%5D).fetchall()%5B0%5D%5B0%5D%0A%20%20%20%20step(%22Staged%20(Get)%22%2C%20staged%20%3E%200%2C%20f%22%7Bstaged%3A%2C%7D%20rows%22%20if%20staged%20else%20%22%22%2C%20f%22uv%20run%20python%20run.py%20--round%20%7Bround_id%7D%22)%0A%20%20%20%20step(%22Stored%20(Check%2C%20then%20Store)%22%2C%20stored%20%3E%200%2C%20f%22%7Bstored%3A%2C%7D%20rows%20in%20persons%22%20if%20stored%20else%20%22%22%2C%0A%20%20%20%20%20%20%20%20%20%22If%20run.py%20stopped%2C%20read%20its%20last%20lines%3A%20they%20name%20the%20stage%20and%20what%20to%20do.%22)%0A%0A%20%20%20%20folder%20%3D%20PATHS.release%20%2F%20round_id%0A%20%20%20%20released%2C%20detail%20%3D%20False%2C%20%22%22%0A%20%20%20%20if%20(folder%20%2F%20%22release.sqlite%22).exists()%3A%0A%20%20%20%20%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20checked%20%3D%20importlib.import_module(%2231_share_round%22).check_release(folder)%0A%20%20%20%20%20%20%20%20%20%20%20%20released%20%3D%20bool(checked%5B%22suppressed%20hidden%22%5D.all()%20and%20checked%5B%22rows%22%5D.nunique()%20%3D%3D%201)%0A%20%20%20%20%20%20%20%20%20%20%20%20detail%20%3D%20f%22%7Bchecked%5B'rows'%5D.iloc%5B0%5D%7D%20cells%20in%20each%20file%22%20%2B%20(%22%22%20if%20released%20else%20%22%3B%20the%20files%20disagree%3A%20open%2031_share_round.py%2C%20section%205%22)%0A%20%20%20%20%20%20%20%20except%20Exception%20as%20error%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20detail%20%3D%20f%22could%20not%20be%20checked%3A%20%7Btype(error).__name__%7D%3A%20%7Berror%7D%22%0A%20%20%20%20step(%22Release%20built%20and%20checked%20(Share)%22%2C%20released%2C%20detail%2C%20f%22run.py%20builds%20it%20after%20Store%3B%20or%2031_share_round.py%2C%20section%205%2C%20round%20%7Bround_id%7D.%22)%0A%0A%20%20%20%20portal%20%3D%20(folder%20%2F%20%22metadata.json%22).exists()%20and%20(folder%20%2F%20%22datasette.json%22).exists()%0A%20%20%20%20step(%22Portal%20files%20written%20(optional)%22%2C%20portal%2C%20%22metadata.json%2C%20datasette.json%22%20if%20portal%20else%20%22%22%2C%20%2232_datasette.py%2C%20section%204%2C%20for%20this%20release.%22)%0A%0A%20%20%20%20note%20%3D%20course.note_path(group)%20if%20course.group_slug(group)%20else%20None%0A%20%20%20%20saved%20%3D%20note%20is%20not%20None%20and%20note.exists()%0A%20%20%20%20step(%22The%20group's%20note%20saved%22%2C%20saved%2C%20note.relative_to(PATHS.root).as_posix()%20if%20saved%20else%20%22%22%2C%0A%20%20%20%20%20%20%20%20%20%22Type%20your%20group's%20name%20at%20the%20top%2C%20then%20section%204.%22%20if%20note%20is%20None%20else%20%22Section%204%20below.%22)%0A%20%20%20%20return%20pd.DataFrame(rows)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20_rounds%20%3D%20found_rounds()%0A%20%20%20%20round_choice%20%3D%20mo.ui.dropdown(options%3D_rounds%20or%20%5BROUND_ID%5D%2C%20value%3DROUND_ID%20if%20ROUND_ID%20in%20_rounds%20or%20not%20_rounds%20else%20_rounds%5B-1%5D%2C%20label%3D%22Your%20capstone%20round%3A%22)%0A%20%20%20%20refresh%20%3D%20mo.ui.button(label%3D%22Refresh%20the%20checklist%22%2C%20value%3D0%2C%20on_click%3Dlambda%20v%3A%20v%20%2B%201)%0A%20%20%20%20mo.hstack(%5Bround_choice%2C%20refresh%5D%2C%20justify%3D%22start%22%2C%20gap%3D2)%0A%20%20%20%20return%20refresh%2C%20round_choice%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(group_name%2C%20refresh%2C%20round_choice)%3A%0A%20%20%20%20refresh.value%20%20%23%20pressing%20Refresh%20runs%20this%20cell%20again%0A%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20_out%20%3D%20round_status(round_choice.value%2C%20group_name.value)%0A%20%20%20%20except%20Exception%20as%20_error%3A%0A%20%20%20%20%20%20%20%20_out%20%3D%20mo.callout(mo.md(f%22The%20checklist%20could%20not%20be%20read%3A%20%7Btype(_error).__name__%7D%3A%20%7B_error%7D%22)%2C%20kind%3D%22warn%22)%0A%20%20%20%20_out%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%203%20%C2%B7%20Compare%20it%20with%20the%20round%20before%0A%0A%20%20%20%20%60run.py%60%20prints%20what%20it%20found.%20This%20table%20puts%20the%20same%20evidence%20side%20by%20side%20with%20the%20round%20before%2C%20so%20what%20moved%20stands%20out.%20Look%20at%20every%20line%20that%20changed%20a%20lot%2C%20and%20ask%3A%20**is%20it%20the%20population%2C%20the%20field%20work%2C%20or%20the%20file%3F**%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20previous_round(round_id%3A%20str)%20-%3E%20str%20%7C%20None%3A%0A%20%20%20%20%22%22%22The%20latest%20round%20before%20this%20one%20that%20is%20stored%20in%20the%20database.%22%22%22%0A%20%20%20%20if%20not%20PATHS.database.exists()%3A%0A%20%20%20%20%20%20%20%20return%20None%0A%20%20%20%20with%20course.database(read_only%3DTrue)%20as%20con%3A%0A%20%20%20%20%20%20%20%20rounds%20%3D%20%5Br%5B0%5D%20for%20r%20in%20con.execute(%22SELECT%20DISTINCT%20round%20FROM%20persons%20WHERE%20round%20%3C%20%3F%20ORDER%20BY%20round%22%2C%20%5Bround_id%5D).fetchall()%5D%0A%20%20%20%20return%20rounds%5B-1%5D%20if%20rounds%20else%20None%0A%0A%0A%40app.function%0Adef%20round_evidence(round_id%3A%20str)%20-%3E%20tuple%5Bpd.DataFrame%2C%20list%5Bstr%5D%5D%3A%0A%20%20%20%20%22%22%22This%20round%20beside%20the%20previous%20stored%20one%3A%20size%2C%20weights%2C%20contract%20failures%20and%20cleaning%20steps%3B%20and%20this%20round's%20warnings.%22%22%22%0A%20%20%20%20check%20%3D%20importlib.import_module(%2220_check_round%22)%0A%20%20%20%20before_id%20%3D%20previous_round(round_id)%0A%20%20%20%20ids%20%3D%20%5Br%20for%20r%20in%20(before_id%2C%20round_id)%20if%20r%5D%0A%20%20%20%20staged%20%3D%20%7Br%3A%20check.load_staged(r)%20for%20r%20in%20ids%7D%0A%20%20%20%20lines%20%3D%20%7B%7D%0A%20%20%20%20for%20r%20in%20ids%3A%0A%20%20%20%20%20%20%20%20table%20%3D%20staged%5Br%5D%0A%20%20%20%20%20%20%20%20failures%20%3D%20check.validate_round(table%2C%20check.survey_schema(check.code_list_codes(check.round_edition(r))))%0A%20%20%20%20%20%20%20%20clean%2C%20cleaning%20%3D%20check.clean_round(table%2C%20check.load_check_config(r))%0A%20%20%20%20%20%20%20%20values%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22rows%20in%20the%20file%22%3A%20len(table)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22average%20weight%22%3A%20round(float(table%5B%22weight%22%5D.mean())%2C%201)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22weighted%20persons%22%3A%20round(float(table%5B%22weight%22%5D.sum()))%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22contract%20failures%20before%20cleaning%22%3A%20len(failures)%2C%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%23%20An%20empty%20column%20is%20how%20a%20role%20the%20configuration%20left%20out%20shows%20up%20(employment%20and%20hours%20are%20optional)%0A%20%20%20%20%20%20%20%20values%20%7C%3D%20%7Bf%22missing%20values%3A%20%7Bc%7D%22%3A%20int(table%5Bc%5D.isna().sum())%20for%20c%20in%20(%22age%22%2C%20%22sex%22%2C%20%22employed%22%2C%20%22hours%22)%7D%0A%20%20%20%20%20%20%20%20values%20%7C%3D%20%7Bf%22cleaning%3A%20%7Bs%7D%22%3A%20int(n)%20for%20s%2C%20n%20in%20zip(cleaning%5B%22step%22%5D%2C%20cleaning%5B%22values%20changed%22%5D)%7D%0A%20%20%20%20%20%20%20%20values%5B%22rows%20after%20cleaning%22%5D%20%3D%20len(clean)%0A%20%20%20%20%20%20%20%20lines%5Br%5D%20%3D%20values%0A%20%20%20%20rows%20%3D%20%5B%7B%22measure%22%3A%20measure%7D%20%7C%20%7Br%3A%20f%22%7Blines%5Br%5D.get(measure%2C%200)%3A%2C%7D%22%20for%20r%20in%20ids%7D%20for%20measure%20in%20lines%5Bround_id%5D%5D%0A%20%20%20%20if%20before_id%3A%0A%20%20%20%20%20%20%20%20for%20row%2C%20measure%20in%20zip(rows%2C%20lines%5Bround_id%5D)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20was%2C%20now%20%3D%20lines%5Bbefore_id%5D.get(measure%2C%200)%2C%20lines%5Bround_id%5D%5Bmeasure%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20row%5B%22change%22%5D%20%3D%20%22%22%20if%20was%20%3D%3D%20now%20%3D%3D%200%20else%20%22new%22%20if%20was%20%3D%3D%200%20else%20f%22%7B(now%20-%20was)%20%2F%20abs(was)%3A%2B.0%25%7D%22%0A%20%20%20%20warnings%20%3D%20check.warnings_for(staged%5Bround_id%5D%2C%20staged%5Bbefore_id%5D%20if%20before_id%20else%20None)%0A%20%20%20%20return%20pd.DataFrame(rows)%2C%20warnings%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(round_choice)%3A%0A%20%20%20%20compare_button%20%3D%20mo.ui.run_button(label%3Df%22Compare%20round%20%7Bround_choice.value%7D%20with%20the%20round%20before%22)%0A%20%20%20%20compare_button%0A%20%20%20%20return%20(compare_button%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(compare_button%2C%20round_choice)%3A%0A%20%20%20%20mo.stop(not%20compare_button.value)%0A%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20_table%2C%20_warnings%20%3D%20round_evidence(round_choice.value)%0A%20%20%20%20%20%20%20%20_out%20%3D%20mo.vstack(%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20_table%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20mo.md(%22**Warnings%20for%20this%20round%3A**%5Cn%5Cn%22%20%2B%20(%22%5Cn%22.join(f%22-%20%7Bw%7D%22%20for%20w%20in%20_warnings)%20if%20_warnings%20else%20%22none%22))%2C%0A%20%20%20%20%20%20%20%20%5D)%0A%20%20%20%20except%20NotImplementedError%20as%20_error%3A%0A%20%20%20%20%20%20%20%20_out%20%3D%20course.waiting_for(str(_error))%0A%20%20%20%20except%20Exception%20as%20_error%3A%0A%20%20%20%20%20%20%20%20_out%20%3D%20mo.callout(mo.md(f%22Round%20%7Bround_choice.value%7D%20cannot%20be%20compared%20yet%3A%20%7Btype(_error).__name__%7D%3A%20%7Bstr(_error).splitlines()%5B0%5D%7D.%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22It%20must%20be%20staged%20first%3A%20%60uv%20run%20python%20run.py%20--round%20%22%20%2B%20round_choice.value%20%2B%20%22%60.%22)%2C%20kind%3D%22neutral%22)%0A%20%20%20%20_out%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.accordion(%7B%22Stuck%3F%20Questions%20to%20ask%20of%20each%20line%20(open%20only%20after%20you%20have%20tried)%22%3A%20mo.md(r%22%22%22%0A%20%20%20%20-%20**A%20stop%20at%20Get%2C%20before%20anything%20is%20read%3A**%20is%20the%20configuration%20saved%2C%20and%20does%20every%20role%20point%20at%20a%20column%20that%20exists%20in%20*this*%20file%3F%20Files%20rename%20columns%20between%20rounds.%0A%20%20%20%20-%20**Far%20more%20missing%20values%20in%20a%20column%20than%20last%20round%3A**%20was%20a%20role%20left%20empty%20in%20the%20configuration%3F%20Employment%20and%20hours%20may%20be%20left%20empty%2C%20and%20then%20the%20whole%20column%20is.%0A%20%20%20%20-%20**Contract%20failures%20before%20cleaning%3A**%20which%20column%20and%20which%20rule%3F%20A%20value%20the%20contract%20does%20not%20allow%20may%20be%20a%20typing%20error%2C%20or%20a%20**new%20code**%20the%20questionnaire%20added.%20Cleaning%20sets%20invalid%20codes%20to%20missing%3A%20is%20that%20right%20for%20this%20one%2C%20or%20does%20the%20contract%20need%20the%20new%20code%3F%0A%20%20%20%20-%20**A%20cleaning%20step%20that%20changed%20far%20more%20values%20than%20last%20round%3A**%20that%20step%20is%20hiding%20something.%20Which%20values%20did%20it%20change%3F%0A%20%20%20%20-%20**The%20average%20weight%20moved%3A**%20a%20population%20does%20not%20grow%20by%20a%20quarter%20in%20three%20months.%20Were%20the%20weights%20computed%20differently%3F%20Who%20would%20know%3F%0A%20%20%20%20-%20**Totals%20far%20from%20the%20published%20population%20in%20every%20region%3A**%20together%20with%20the%20weight%20change%2C%20what%20does%20that%20tell%20you%3F%0A%0A%20%20%20%20The%20pipeline%20taking%20a%20round%20is%20not%20the%20same%20as%20the%20round%20being%20right.%20A%20warning%20is%20a%20question%20for%20a%20person%3A%20the%20pipeline%20cannot%20answer%20it.%0A%20%20%20%20%22%22%22)%7D)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%204%20%C2%B7%20Your%20decision%2C%20and%20the%20group's%20note%0A%0A%20%20%20%20Every%20warning%20ends%20in%20a%20decision%3A%20**publish**%20the%20release%20as%20it%20is%2C%20**publish%20with%20a%20note**%20to%20readers%2C%20or%20**hold**%20it%20until%20someone%20answers%20a%20question.%20There%20is%20no%20single%20right%20answer%3B%20there%20is%20an%20answer%20you%20can%20defend.%20Start%20*Decision%20and%20next%20step*%20with%20one%20of%20the%20three%2C%20then%20say%20why.%0A%0A%20%20%20%20Write%20in%20full%20sentences.%20The%20note%20is%20saved%20as%20%60notes%2F%3Cgroup%3E.md%60%2C%20a%20text%20file%20you%20can%20open%2C%20print%20or%20send.%20One%20person%20saves%20it%3B%20it%20is%20also%20your%20script%20at%2015%3A45.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(group_name%2C%20round_choice)%3A%0A%20%20%20%20note_form%20%3D%20course.note_form(group_name.value%2C%20made%3Df%22release%2F%7Bround_choice.value%7D%22)%0A%20%20%20%20save_button%20%3D%20mo.ui.run_button(label%3D%22Save%20the%20group's%20note%22)%0A%20%20%20%20mo.vstack(%5Bnote_form%2C%20save_button%5D)%0A%20%20%20%20return%20note_form%2C%20save_button%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(group_name%2C%20note_form%2C%20save_button)%3A%0A%20%20%20%20mo.stop(not%20save_button.value)%0A%20%20%20%20course.save_note(group_name.value%2C%20THIS%2C%20note_form.value)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20**Finished%20early%3F**%20Serve%20your%20Round%204%20release%20in%20Datasette%20(%6032_datasette.py%60%2C%20section%204%2C%20with%20this%20round%20chosen)%3B%20map%20Round%204%20back%20to%20the%202023Q4%20geography%20with%20your%20crosswalk%20(%6030_new_edition.py%60%2C%20section%203)%20and%20compare%20it%20with%20Round%201%3B%20or%20look%20at%20the%20ideas%20in%20%5B35_capstone_explore.py%5D(%2F%3Ffile%3D35_capstone_explore.py).%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20course.presentation_card()%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20course.what_you_built()%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
cbff748511c2e27090f05727c2266521