From: Edward Delaporte Date: Sun, 22 Feb 2026 23:27:42 +0000 (-0600) Subject: Fix for NaN text from ods reader X-Git-Url: https://apps.delaporte.us/gitweb/dotfiles.git/commitdiff_plain/4ece039d5e285ffb3498001b8f0d07acd53b1f1a Fix for NaN text from ods reader --- diff --git a/invoke/school/tasks.py b/invoke/school/tasks.py index d311f61..d7c89e6 100644 --- a/invoke/school/tasks.py +++ b/invoke/school/tasks.py @@ -1,4 +1,3 @@ -# This file is meant to sit in ~ for use from all shells. from invoke import task from pandas_ods_reader import read_ods import pandas as pd @@ -100,7 +99,7 @@ def get_todays_assignments(df, date, person): def missing_on_day(c, person, day): df = read_ods(ODS_FILE) today = get_todays_assignments(df, day, person) - for subject in ['College Prep', 'Life Skills', 'Job Prep', 'Health']: + for subject in ['College Prep', 'Life Skills', 'Job Prep', 'Health Science']: if not 'All Day Event' in today['subject'].values and not subject in today['subject'].values: print(f'Missing {subject} for {person} on {day}') @@ -141,15 +140,17 @@ def print_day(c, person, date): print(f'- [ ] {task}') if(len(row['tip'].values) > 0): for tip in row['tip'].values: - if tip: + # Sometimes a float. + if hasattr(tip, 'strip'): print() - print(f'> Tip: {tip}') + print(f'> Tip: {tip.strip()}') if(len(row['when_done'].values) > 0): for tip in row['when_done'].values: - if tip: + # Sometimes a float. + if hasattr(tip, 'strip'): print() - print(f'**When done**: {tip}') + print(f'**When done**: {tip}.strip()') @task def files(c): @@ -173,5 +174,6 @@ def checklist(c): print('- [ ] start libreoffice and open `assignements.ods`') print('- [ ] copy a previous sheet to be the new first sheet, and update the date Monday date.') print('- [ ] `invoke missing YYYY.MM.DD` the .ods file.') - print('- [ ] `invoke preview-all YYYY.MM.DD`') + print('- [ ] `invoke make-all YYYY.MM.DD` to generate PDF files') + print('- [ ] review the PDF files and recreate if needed.')