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%20Explore%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%20re%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%20capstone%20note%0A%20%20%20%20from%20course%20import%20PATHS%0A%0A%20%20%20%20THIS%20%3D%20%2235_capstone_explore.py%22%0A%20%20%20%20STUDIO%20%3D%20%22uv%20run%20--with%20marimo-studio%3D%3D0.4.1%22%20%20%23%20marimo%20Studio%20for%20one%20command%2C%20without%20adding%20it%20to%20the%20course's%20packages%0A%20%20%20%20STUDIO_PDF%20%3D%20'uv%20run%20--with%20%22marimo-studio%5Btypst%5D%3D%3D0.4.1%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%20Explore%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(r%22%22%22%0A%20%20%20%20%23%23%201%20%C2%B7%20The%20brief%0A%0A%20%20%20%20Take%20**one**%20tool%20or%20idea%20from%20the%20course%20further%2C%20on%20the%20course's%20data%20or%20your%20own.%20The%20ideas%20below%20say%20what%20you%20would%20make%2C%20where%20to%20start%2C%20the%20first%20steps%2C%20and%20what%20to%20show%3B%20they%20are%20starting%20points%2C%20not%20a%20list%20to%20finish.%20Your%20own%20idea%20is%20welcome%20too%3A%20the%20last%20card%20says%20how%20to%20shape%20it.%0A%0A%20%20%20%20Whatever%20you%20pick%2C%20make%20**something%20that%20works%20and%20that%20you%20can%20show**%3A%20a%20file%2C%20a%20page%2C%20a%20portal%2C%20a%20notebook.%20Write%20its%20path%20in%20the%20note%20(section%203)%2C%20and%20the%20checklist%20confirms%20it%20exists.%0A%0A%20%20%20%20**Working%20as%20a%20group.**%20Pick%20one%20idea%20for%20the%20group.%20Split%20it%20if%20it%20splits%20naturally%20(one%20person%20on%20the%20data%2C%20one%20on%20the%20page)%2C%20and%20put%20it%20together%20on%20one%20laptop%20for%2015%3A45.%0A%0A%20%20%20%20%23%23%202%20%C2%B7%20Ideas%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%20_cards%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%221%20%C2%B7%20A%20data%20portal%20for%20your%20own%20data%20(Datasette)%22%3A%20rf%22%22%22%0A%20%20%20%20**You%20make%3A**%20a%20running%20Datasette%20portal%20on%20a%20SQLite%20file%20of%20your%20choice%2C%20with%20descriptions%2C%20facets%20and%20a%20saved%20query%20of%20your%20own.%0A%0A%20%20%20%20**Start%20from%3A**%20%6032_datasette.py%60%2C%20sections%202%20to%204%3B%20primer%2017.%0A%0A%20%20%20%20**First%20steps%3A**%0A%0A%20%20%20%201.%20Turn%20a%20table%20into%20a%20SQLite%20file%3A%20%60table.to_sql(%22mytable%22%2C%20sqlite3.connect(%22my_data%2Fmine.sqlite%22)%2C%20index%3DFalse)%60%20(or%20use%20your%20Round%204%20release).%0A%20%20%20%202.%20Write%20a%20%60metadata.json%60%20(a%20title%20and%20a%20description%20per%20column)%20and%20a%20%60datasette.json%60%20(facets%2C%20one%20canned%20query%20with%20a%20%60%3Aparameter%60)%2C%20as%20in%20section%204.%0A%20%20%20%203.%20In%20a%20second%20terminal%3A%20%60uv%20run%20datasette%20serve%20my_data%2Fmine.sqlite%20-m%20my_data%2Fmetadata.json%20-c%20my_data%2Fdatasette.json%20-p%208001%60.%0A%0A%20%20%20%20**Show%3A**%20the%20portal%2C%20a%20facet%2C%20your%20saved%20query%20with%20a%20value%20typed%20in%2C%20and%20its%20JSON%20address.%0A%0A%20%20%20%20**Time%3A**%20about%20an%20hour.%20**Extra%20install%3A**%20none.%0A%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20%222%20%C2%B7%20Report%20pages%20from%20your%20notebook%20(marimo%20Studio)%22%3A%20rf%22%22%22%0A%20%20%20%20**You%20make%3A**%20a%20page%20built%20from%20%6031_share_round.py%60%20that%20places%20its%20named%20results%20(the%20round%20dropdown%2C%20the%20release%20numbers%2C%20the%20suppressed%20table)%2C%20exported%20for%20its%20readers%3A%20one%20of%20the%20two%20pages%20in%20%60studio%2F31_share_round%2F%60%2C%20changed%2C%20or%20a%20page%20of%20your%20own.%0A%0A%20%20%20%20**Start%20from%3A**%20the%20show-and-tell%20before%20lunch%3B%20the%20two%20pages%20in%20%60studio%2F31_share_round%2F%60%3A%20%60release-report%2Findex.html%60%20(a%20web%20page%2C%20in%20HTML)%20and%20%60release-brief%2Fmain.typ%60%20(one%20printed%20page%2C%20in%20Typst)%3B%20Studio's%20guide%20at%20marimo-team.github.io%2Fmarimo-studio.%0A%0A%20%20%20%20**First%20steps%3A**%0A%0A%20%20%20%201.%20Export%20the%20web%20page%3A%20%60%7BSTUDIO%7D%20marimo-studio%20view%20export%20release-report%20--target%2031_share_round.py%20--output%20report%60%2C%20then%20%60uv%20run%20python%20-m%20http.server%208010%20--directory%20report%60%20and%20open%20the%20address%20it%20prints.%20To%20export%20again%2C%20delete%20%60report%60%20first%3A%20Studio%200.4.1%20cannot%20replace%20an%20earlier%20export.%0A%20%20%20%202.%20Change%20it%3A%20open%20%60studio%2F31_share_round%2Frelease-report%2Findex.html%60%20in%20a%20text%20editor%20(a%20heading%2C%20a%20sentence%2C%20a%20tile%20that%20places%20another%20number%20from%20%60release_summary%60)%2C%20check%20it%20with%20%60%7BSTUDIO%7D%20marimo-studio%20validate%20release-report%20--target%2031_share_round.py%60%2C%20and%20export%20again.%20The%20printed%20page%20exports%20the%20same%20way%3A%20%60%7BSTUDIO_PDF%7D%20marimo-studio%20view%20export%20release-brief%20--target%2031_share_round.py%20--output%20brief%60%20(the%20first%20time%20downloads%20about%2034%20MB%20more)%2C%20then%20serve%20%60brief%60%20and%20open%20it.%0A%20%20%20%203.%20Or%20make%20your%20own%20(stop%20marimo%20first%3A%20Studio%20writes%20into%20%6031_share_round.py%60)%3A%20add%20a%20cell%20%60published_page%20%3D%20mo.plain(published)%60%20(a%20static%20page%20cannot%20run%20marimo's%20interactive%20table%2C%20but%20it%20can%20hold%20a%20plain%20one)%2C%20then%20%60%7BSTUDIO%7D%20marimo-studio%20view%20create%20my-report%20--target%2031_share_round.py%60.%20The%20starter%20places%20**every**%20cell%2C%20including%20the%20one%20listing%20the%20cells%20with%20the%20fewest%20respondents%3A%20delete%20them%20all%2C%20and%20place%20only%20suppressed%20results%2C%20like%20%60%3Cmarimo-output%20value%3D%22published_page%22%3E%3C%2Fmarimo-output%3E%60%20and%20%60%3Cstrong%20mo-value%3D%22release_summary.suppressed%22%3E%3C%2Fstrong%3E%60.%0A%0A%20%20%20%20**Show%3A**%20the%20page%2C%20and%20why%20every%20result%20on%20it%20is%20safe%20to%20publish.%20The%20review%20below%20checks%20your%20pages.%0A%0A%20%20%20%20**Time%3A**%20about%20an%20hour.%20**Extra%20install%3A**%20Studio%20is%20not%20part%20of%20the%20course%3B%20the%20first%20%60%7BSTUDIO%7D%60%20command%20downloads%20it%20(about%2020%20MB)%20without%20changing%20the%20course's%20packages.%0A%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20%223%20%C2%B7%20Clean%20a%20file%20and%20save%20it%20as%20Parquet%22%3A%20r%22%22%22%0A%20%20%20%20**You%20make%3A**%20a%20clean%20Parquet%20file%20from%20a%20messy%20CSV%20(yours%2C%20or%20%60reference%2Fopenstat_population_wide.csv%60)%2C%20and%20a%20comparison%20of%20the%20two.%0A%0A%20%20%20%20**Start%20from%3A**%20primer%2016%20(file%20formats)%3B%20%6010_get_round.py%60%2C%20section%201%20(reading%20without%20losing%20anything)%3B%20%6020_check_round.py%60%2C%20sections%204%20and%205%20(cleaning%20as%20code).%0A%0A%20%20%20%20**First%20steps%3A**%0A%0A%20%20%20%201.%20Read%20the%20CSV%20with%20%60dtype%3Dstr%60%2C%20decide%20each%20column's%20type%2C%20and%20fix%20what%20is%20wrong%2C%20one%20commented%20step%20at%20a%20time.%0A%20%20%20%202.%20%60table.to_parquet(%22my_data%2Fclean.parquet%22%2C%20index%3DFalse)%60%3B%20read%20it%20back%20with%20%60pd.read_parquet%60%20and%20compare%20rows%20and%20types.%0A%20%20%20%203.%20Compare%20the%20two%20files'%20sizes%20(%60Path(...).stat().st_size%60)%20and%20what%20each%20keeps%20(codes%2C%20empty%20cells%2C%20types).%0A%0A%20%20%20%20**Show%3A**%20the%20file%20before%20and%20after%2C%20the%20types%20that%20survived%2C%20and%20the%20size%20difference.%0A%0A%20%20%20%20**Time%3A**%2045%20minutes%20to%20an%20hour.%20**Extra%20install%3A**%20none.%0A%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20%224%20%C2%B7%20One%20stage%20in%20polars%22%3A%20r%22%22%22%0A%20%20%20%20**You%20make%3A**%20one%20step%20of%20the%20pipeline%20(the%20join%20to%20the%20code%20list%2C%20or%20a%20grouped%20table)%20written%20with%20polars%2C%20giving%20the%20same%20result%20as%20your%20pandas%20version.%0A%0A%20%20%20%20**Start%20from%3A**%20the%20polars%20notes%20in%20%6010_get_round.py%60%20(sections%203%20and%204%2C%20*The%20same%20join%20in%20polars*%20and%20*The%20same%20reshape%20in%20polars*).%0A%0A%20%20%20%20**First%20steps%3A**%0A%0A%20%20%20%201.%20%60import%20polars%20as%20pl%60%3B%20%60rows%20%3D%20pl.from_pandas(group_data)%60%20or%20%60pl.read_csv(path%2C%20infer_schema%3DFalse)%60%20(every%20column%20as%20text).%0A%20%20%20%202.%20Write%20the%20step%20with%20polars'%20methods%20(%60join(...%2C%20validate%3D%22m%3A1%22)%60%2C%20%60group_by(...).agg(...)%60).%0A%20%20%20%203.%20Compare%20with%20the%20pandas%20result%3A%20same%20rows%2C%20same%20totals.%0A%0A%20%20%20%20**Show%3A**%20both%20versions%20side%20by%20side%2C%20and%20what%20you%20found%20easier%20or%20harder.%0A%0A%20%20%20%20**Time%3A**%20about%20an%20hour.%20**Extra%20install%3A**%20none.%0A%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20%225%20%C2%B7%20Read%20from%20your%20office's%20database%22%3A%20r%22%22%22%0A%20%20%20%20**You%20make%3A**%20a%20notebook%20cell%20that%20reads%20a%20table%20from%20a%20database%20you%20use%20at%20work%20(SQLite%2C%20PostgreSQL%2C%20MySQL%2C%20SQL%20Server)%2C%20**read-only**%2C%20into%20pandas%2C%20with%20the%20password%20kept%20out%20of%20the%20notebook.%0A%0A%20%20%20%20**Start%20from%3A**%20%6010_get_round.py%60%2C%20section%203%2C%20*Connect%20to%20your%20own%20database*.%0A%0A%20%20%20%20**First%20steps%3A**%0A%0A%20%20%20%201.%20Find%20out%20which%20database%20it%20is%20and%20whether%20you%20may%20read%20it%20from%20your%20laptop%20(ask%20before%20you%20try).%0A%20%20%20%202.%20Put%20the%20password%20in%20an%20environment%20variable%2C%20never%20in%20the%20notebook%3A%20%60os.environ%5B%22DB_PASSWORD%22%5D%60.%0A%20%20%20%203.%20Read%20one%20small%20table%2C%20and%20check%20it%20the%20way%20you%20checked%20Round%201%3A%20rows%2C%20types%2C%20codes%20intact.%0A%0A%20%20%20%20**Show%3A**%20the%20cell%20(without%20the%20password)%2C%20the%20table%2C%20and%20one%20thing%20you%20checked.%0A%0A%20%20%20%20**Time%3A**%20depends%20on%20access%3B%20have%20a%20plan%20B.%20**Extra%20install%3A**%20the%20driver%20for%20your%20database%2C%20if%20it%20is%20not%20SQLite%20or%20DuckDB.%0A%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20%226%20%C2%B7%20Match%20your%20own%20list%20of%20names%20to%20codes%22%3A%20r%22%22%22%0A%20%20%20%20**You%20make%3A**%20a%20matching%20report%20for%20a%20list%20of%20names%20your%20office%20receives%20(places%2C%20schools%2C%20establishments)%3A%20exact%20matches%2C%20close%20matches%20to%20confirm%2C%20and%20names%20with%20no%20match.%0A%0A%20%20%20%20**Start%20from%3A**%20%6083_stretch_day3.py%60%2C%20S3.5.%0A%0A%20%20%20%20**First%20steps%3A**%0A%0A%20%20%20%201.%20Put%20the%20list%20and%20the%20reference%20list%20(names%20with%20codes)%20in%20%60my_data%2F%60.%0A%20%20%20%202.%20Normalise%20both%20(case%2C%20accents%2C%20abbreviations)%2C%20match%20exactly%20first%2C%20then%20%60difflib.get_close_matches%60%20within%20a%20group%20(like%20a%20province).%0A%20%20%20%203.%20Save%20the%20report%2C%20with%20a%20column%20a%20person%20fills%20in%20to%20confirm%20each%20close%20match.%0A%0A%20%20%20%20**Show%3A**%20the%20report%2C%20and%20one%20close%20match%20that%20was%20right%20and%20one%20that%20was%20wrong.%0A%0A%20%20%20%20**Time%3A**%20about%20an%20hour.%20**Extra%20install%3A**%20none.%0A%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20%227%20%C2%B7%20Take%20a%20stretch%20exercise%20further%22%3A%20r%22%22%22%0A%20%20%20%20**You%20make%3A**%20a%20stretch%20exercise%20from%20%6081_stretch_day1.py%60%2C%20%6082_stretch_day2.py%60%20or%20%6083_stretch_day3.py%60%2C%20extended%20to%20the%20course's%20real%20data%20or%20your%20own%3A%20complementary%20suppression%20on%20the%20real%20release%2C%20the%20two-parameter%20query%20in%20your%20portal%2C%20the%20contract%20as%20a%20class%20on%20Round%204.%0A%0A%20%20%20%20**Start%20from%3A**%20the%20stretch%20notebook.%0A%0A%20%20%20%20**Show%3A**%20what%20the%20exercise%20did%20on%20the%20small%20example%2C%20and%20what%20changed%20on%20real%20data.%0A%0A%20%20%20%20**Time%3A**%2045%20minutes%20to%20an%20hour.%20**Extra%20install%3A**%20none.%0A%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20%228%20%C2%B7%20Your%20own%20idea%22%3A%20r%22%22%22%0A%20%20%20%20**You%20make%3A**%20whatever%20your%20group%20wants%20to%20try%2C%20if%20it%20fits%20three%20things%3A%20it%20uses%20**data**%20(the%20course's%20or%20yours)%2C%20it%20**checks**%20something%20(a%20contract%2C%20a%20comparison%2C%20a%20read-back)%2C%20and%20it%20**produces**%20something%20you%20can%20show.%0A%0A%20%20%20%20**Start%20from%3A**%20write%20the%20idea%20in%20one%20sentence%20in%20the%20note%20(*What%20we%20worked%20on*)%20and%20show%20it%20to%20a%20training%20assistant%20before%20you%20start%3A%20they%20will%20help%20you%20cut%20it%20to%20an%20hour.%0A%0A%20%20%20%20**Show%3A**%20the%20thing%2C%20and%20what%20checking%20it%20taught%20you.%0A%20%20%20%20%22%22%22%2C%0A%20%20%20%20%7D%0A%20%20%20%20mo.accordion(%7Btitle%3A%20mo.md(text)%20for%20title%2C%20text%20in%20_cards.items()%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%23%20Your%20work%0A%0A%20%20%20%20Work%20in%20this%20notebook%20(add%20cells%20below%20with%20the%20**%2B**%20button)%2C%20in%20a%20notebook%20of%20your%20own%20(in%20marimo's%20file%20list%2C%20*New%20notebook*)%2C%20or%20in%20a%20terminal%2C%20whatever%20the%20idea%20needs.%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%23%20For%20the%20Studio%20idea%3A%20review%20what%20your%20page%20publishes%0A%0A%20%20%20%20A%20page%20exported%20for%20the%20public%20contains%20every%20result%20it%20places%2C%20for%20every%20state%20it%20prepares.%20This%20review%20reads%20every%20Studio%20page%20in%20%60studio%2F%60%20(the%20web%20pages'%20%60index.html%60%20and%20the%20printed%20pages'%20%60main.typ%60)%20and%20sorts%20each%20placed%20result%3A%20suppressed%20(safe%20to%20publish)%20or%20not.%20It%20only%20reads%20the%20files%3B%20press%20it%20again%20after%20each%20change.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20placed_results(page%3A%20str)%20-%3E%20pd.DataFrame%3A%0A%20%20%20%20%22%22%22Every%20notebook%20result%20a%20page%20places%2C%20in%20HTML%20or%20in%20Typst%3A%20how%20it%20is%20placed%2C%20and%20the%20name%20it%20reads.%22%22%22%0A%20%20%20%20found%20%3D%20(%5B(%22cell%22%2C%20n)%20for%20n%20in%20re.findall(r'%3Cmarimo-cell%5B%5E%3E%5D*%5Csname%3D%22(%5B%5E%22%5D%2B)%22'%2C%20page)%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%2B%20%5B(%22output%22%2C%20n)%20for%20n%20in%20re.findall(r'%3Cmarimo-output%5B%5E%3E%5D*%5Csvalue%3D%22(%5B%5E%22%5D%2B)%22'%2C%20page)%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%2B%20%5B(%22value%22%2C%20n)%20for%20n%20in%20re.findall(r'%5Csmo-value%3D%22(%5B%5E%22%5D%2B)%22'%2C%20page)%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%2B%20%5B(kind%2C%20n)%20for%20kind%2C%20n%20in%20re.findall(r'marimo_(cell%7Coutput%7Cvalue)%5C(%22(%5B%5E%22%5D%2B)%22'%2C%20page)%5D)%0A%20%20%20%20return%20pd.DataFrame(found%2C%20columns%3D%5B%22placed%20as%22%2C%20%22name%22%5D).drop_duplicates(ignore_index%3DTrue)%0A%0A%0A%40app.function%0Adef%20publication_review(page%3A%20str)%20-%3E%20pd.DataFrame%3A%0A%20%20%20%20%22%22%22Each%20result%20a%20page%20places%2C%20with%20whether%20it%20may%20go%20on%20a%20public%20page.%22%22%22%0A%20%20%20%20safe%20%3D%20%7B%22round_control%22%3A%20%22the%20round%20dropdown%22%2C%20%22release_summary%22%3A%20%22counts%20from%20the%20suppressed%20table%22%2C%20%22published%22%3A%20%22the%20suppressed%20table%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22published_page%22%3A%20%22the%20suppressed%20table%2C%20as%20plain%20HTML%22%2C%20%22release_codebook%22%3A%20%22the%20codebook%3A%20no%20data%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22group_control%22%3A%20%22the%20group%20picker%20(36_capstone_presentation.py)%22%2C%20%22briefing%22%3A%20%22a%20group's%20note%3A%20no%20data%22%7D%0A%20%20%20%20unsafe%20%3D%20%7B%22full_table%22%3A%20%22has%20the%20respondents%20column%3A%20never%20on%20a%20public%20page%22%2C%20%22stored%22%3A%20%22the%20microdata%3A%20one%20row%20per%20person%22%7D%0A%20%20%20%20placed%20%3D%20placed_results(page)%0A%0A%20%20%20%20def%20verdict(name%3A%20str)%20-%3E%20str%3A%0A%20%20%20%20%20%20%20%20root%20%3D%20re.split(r%22%5B.%5C%5B%5D%22%2C%20name)%5B0%5D%20%20%23%20release_summary.cells%20reads%20release_summary%0A%20%20%20%20%20%20%20%20if%20root%20in%20unsafe%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%22NOT%20SAFE%3A%20%22%20%2B%20unsafe%5Broot%5D%0A%20%20%20%20%20%20%20%20if%20root%20in%20safe%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%22safe%3A%20%22%20%2B%20safe%5Broot%5D%0A%20%20%20%20%20%20%20%20if%20re.fullmatch(r%22cell-%5Cd%2B%22%2C%20root)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%22check%20it%3A%20a%20whole%20cell%20from%20the%20starter%20page%3B%20replace%20it%20with%20a%20named%2C%20suppressed%20result%22%0A%20%20%20%20%20%20%20%20return%20%22check%20it%3A%20is%20it%20built%20from%20the%20suppressed%20table%20only%3F%22%0A%0A%20%20%20%20return%20placed.assign(verdict%3Dplaced%5B%22name%22%5D.map(verdict))%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20review_button%20%3D%20mo.ui.run_button(label%3D%22Review%20our%20Studio%20pages%22)%0A%20%20%20%20review_button%0A%20%20%20%20return%20(review_button%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(review_button)%3A%0A%20%20%20%20mo.stop(not%20review_button.value)%0A%20%20%20%20_pages%20%3D%20sorted(%5B*(PATHS.root%20%2F%20%22studio%22).glob(%22*%2F*%2Findex.html%22)%2C%20*(PATHS.root%20%2F%20%22studio%22).glob(%22*%2F*%2Fmain.typ%22)%5D)%0A%20%20%20%20_parts%20%3D%20%5B%5D%0A%20%20%20%20for%20_page%20in%20_pages%3A%0A%20%20%20%20%20%20%20%20_review%20%3D%20publication_review(_page.read_text(encoding%3D%22utf-8%22))%0A%20%20%20%20%20%20%20%20_flagged%20%3D%20int(_review%5B%22verdict%22%5D.str.startswith((%22NOT%20SAFE%22%2C%20%22check%20it%22)).sum())%0A%20%20%20%20%20%20%20%20_parts%20%2B%3D%20%5Bmo.callout(mo.md(f%22**%7B_page.parent.relative_to(PATHS.root).as_posix()%7D%3A**%20%7Blen(_review)%7D%20result(s)%20placed%3B%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%20%20%20%20%2B%20(f%22**%7B_flagged%7D%20to%20fix%20or%20check**%20before%20you%20export%20it.%22%20if%20_flagged%20else%20%22every%20one%20is%20suppressed.%22))%2C%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%20kind%3D%22warn%22%20if%20_flagged%20else%20%22success%22)%2C%20_review%5D%0A%20%20%20%20mo.vstack(_parts)%20if%20_parts%20else%20mo.callout(mo.md(%22No%20Studio%20page%20yet%3A%20idea%202%2C%20step%202.%22)%2C%20kind%3D%22neutral%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%203%20%C2%B7%20The%20group's%20note%0A%0A%20%20%20%20Write%20*What%20we%20made*%20as%20paths%20inside%20the%20course%20folder%2C%20one%20per%20line%20(like%20%60my_data%2Fclean.parquet%60%2C%20%60report%60%2C%20%60studio%2F31_share_round%2Fmy-report%60)%3A%20the%20checklist%20below%20confirms%20each%20one%20exists.%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)%3A%0A%20%20%20%20note_form%20%3D%20course.note_form(group_name.value)%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.function%0Adef%20explore_status(group%3A%20str%2C%20answers%3A%20dict%5Bstr%2C%20str%5D)%20-%3E%20pd.DataFrame%3A%0A%20%20%20%20%22%22%22The%20checklist%3A%20the%20note%2C%20and%20each%20path%20under%20What%20we%20made.%22%22%22%0A%20%20%20%20saved%20%3D%20bool(course.group_slug(group))%20and%20course.note_path(group).exists()%0A%20%20%20%20rows%20%3D%20%5B%7B%22step%22%3A%20%22The%20group's%20note%20saved%22%2C%20%22done%22%3A%20%22yes%22%20if%20saved%20else%20%22not%20yet%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22detail%22%3A%20course.note_path(group).relative_to(PATHS.root).as_posix()%20if%20saved%20else%20%22%22%2C%20%22next%22%3A%20%22%22%20if%20saved%20else%20%22Type%20the%20group's%20name%20at%20the%20top%2C%20then%20save%20the%20note.%22%7D%5D%0A%20%20%20%20paths%20%3D%20course.made_paths(answers)%0A%20%20%20%20rows%20%2B%3D%20%5B%7B%22step%22%3A%20f%22Made%3A%20%7Bp%7D%22%2C%20%22done%22%3A%20%22yes%22%20if%20(PATHS.root%20%2F%20p).exists()%20else%20%22not%20yet%22%2C%20%22detail%22%3A%20%22%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22next%22%3A%20%22%22%20if%20(PATHS.root%20%2F%20p).exists()%20else%20%22No%20such%20file%20or%20folder%20in%20the%20course%20folder%3A%20check%20the%20path.%22%7D%20for%20p%20in%20paths%5D%0A%20%20%20%20if%20not%20paths%3A%0A%20%20%20%20%20%20%20%20rows.append(%7B%22step%22%3A%20%22Something%20made%22%2C%20%22done%22%3A%20%22not%20yet%22%2C%20%22detail%22%3A%20%22%22%2C%20%22next%22%3A%20%22List%20what%20you%20made%20under%20What%20we%20made%2C%20one%20path%20per%20line.%22%7D)%0A%20%20%20%20return%20pd.DataFrame(rows)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20refresh_status%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%20refresh_status%0A%20%20%20%20return%20(refresh_status%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(group_name%2C%20note_form%2C%20refresh_status)%3A%0A%20%20%20%20refresh_status.value%20%20%23%20pressing%20Refresh%20runs%20this%20cell%20again%0A%20%20%20%20explore_status(group_name.value%2C%20note_form.value)%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
15341a3458de5f1e385c4c1f8eb20ce0