Giter Site home page Giter Site logo

nytid's Introduction

nytid

Handle TA bookings for lab sessions, tutorials etc.

We want to turn the TimeEdit schedule into a sign-up sheet in Google Sheets that our TAs can use to sign up for teaching slots.

import nytid.schedules.utils as utils

COURSES = {
  "DD1310": 
  "https://cloud.timeedit.net/kth/web/public01/ri.ics?sid=7&p=0.w%2C12.n&objects=453080.10&e=220609&enol=t&ku=29&k=1B9F3AD696BCA5C434C68950EFD376DD",
  "DD1317": 
  "https://cloud.timeedit.net/kth/web/public01/ri.ics?sid=7&p=0.w%2C12.n&objects=455995.10&e=220609&enol=t&ku=29&k=BA4400E3C003685549BC65AD9EAD3DC58E"
}

for course, url in COURSES.items():
  utils.generate_signup_sheet(course, url)

Now we have two CSV files, DD1310.csv and DD1317.csv, in the current working directory that we can upload to Google Sheets. Once uploaded, we can use the share URL with the following functions.

import nytid.schedules.utils as utils

dd1317 = utils.read_signup_sheet_from_url(utils.google_sheet_to_csv_url("https://docs.google.com/spreadsheets/d/the-share-url"))

dd1310 = utils.read_signup_sheet_from_url(utils.google_sheet_to_csv_url("https://docs.google.com/spreadsheets/d/the-share-url"))

ta_time_dd1310 = utils.hours_per_TA(dd1310)
amanuenses = utils.compute_amanuensis_data(dd1310+dd1317)

nytid's People

Contributors

alba-kth avatar dbosk avatar dependabot[bot] avatar

Watchers

 avatar  avatar

nytid's Issues

Write up use design from automation talk

The slides from the automation talk:

\begin{frame}[fragile]
  \begin{example}[TA pool]
    \begin{itemize}
      \item \mintinline{bash}{nytid recommend -c "DD131[0-9]" -u [email protected]}
      \item \mintinline{bash}{nytid reqruit -c "prgi23"}
      \item Can use \texttt{ladok3} to filter out graduated students.
    \end{itemize}
  \end{example}
  
  \pause
  \begin{example}[TA sign up]
    \begin{itemize}
      \item \mintinline{bash}{nytid schedule mine --set  https://timeedit...}
      \item \mintinline{bash}{nytid signup -c "prgi23"}
      \item \mintinline{bash}{nytid schedule signed --set ~/public_html/TA.ics}
    \end{itemize}
  \end{example}
\end{frame}
\begin{frame}[fragile]
  \begin{example}[TA confirmation]
    \begin{itemize}
      \item \mintinline{bash}{nytid checkin -c prgi23 --next }
      \item TimeEdit to automate running check-in.
      \item Email or Zulip (or Slack) API to send reminders to check in.
      \item \mintinline{bash}{nytid confirm -c prgi23 --now TA1 TA2 TA3}
      \item \mintinline{bash}{nytid confirm -c prgi23 --time "2023-09-31 13:15"}
    \end{itemize}
  \end{example}
  \pause
  \begin{example}[Reporting hours]
    \begin{itemize}
      \item \mintinline{bash}{nytid report}
    \end{itemize}
  \end{example}
\end{frame}

Changing the schedule, updating the sign-up sheet

Sometimes we add new sessions and we must update the sign-up sheet. Changes:

  • When we add something, we simply merge and upload a new one.
  • When we remove a session, we must notify the TAs who signed up. This can easily be done by email.

Add `hr` command

We want to be able to automatically email updates to HR. For instance, when we add new TAs or new TAs sign up, we can automatically send an email to HR to add them.

The command should keep track of what has been sent before and only send differences (the updates).

HR-plus integration

Sell it to the HR department by allowing for the HR people to not have to enter times manually

Improve time reporting for HR

  • Let the TAs confirm their times after a session.
  • Let the TAs add arbitrary times for grading.
  • Let the course responsible generate an XLSX-file for HR
  • Allow timesheet generation based on confirmed times or sign-up sheet.

Handle bookings for presentations in Canvas

When we know which TAs are available for which sessions, we can add bookable time slots in Canvas automatically. We should also be able to update bookings when more TAs join.

We have to consider how to handle TAs cancelling. If the TA cancels, we must keep track of spots that must be filled. Then, when a new TA joins, we fill the empty seat instead of adding a new one.

Eliminate the use of `arrow`

Arrow is not as good as datetime and causes some problems. Also Arrow will be removed from ics in the future.

Design

Daniel:

Då tänkte jag bygga in tidrapporteringen och att boka in sig på labbpass i ett. Så assarna kan köra pytid för att boka in sig på labbar och övningar. Sedan kan de bekräfta tiden efteråt med pytid . Sedan kan jag automatiskt skapa xlsx-filen åt HR.

Precis, de är separata, man måste bekräfta att man är där. Jag tänker mig pytid boka i början av en kurs; pytid start, pytid slut för att logga labbpass (men den defaultar på närmast utsatta pass utifall att man kör dem i efterhand. Sedan pytid rapportera för att skapa en rapport åt HR.

Jag funderar på att lagra data i AFS. Konfig för olika kurser är ju inget problem. Bokningar och rapporterad tid med någon klurig setup av rättigheter. Alternativt något helt annat sätt.

Det är hur mina tankar går just nu. Men vi får se vad jag kommer fram till.

Alexander:

Jag skulle vilja hämta labbpassen från KTH:s REST:api, typ:

import json
import urllib.request
import datetime

KURS  = "DD1310"
START = "2021-09-14"
#END = ""
END = "2021-12-21"

schemaurl = "https://www.kth.se/social/api/schema/v2/course/"+KURS+"?startTime="+START
if END != "": schemaurl += "&endTime=" + END

print("Getting data from:", schemaurl)

request_data = urllib.request.urlopen( schemaurl ).read()
utf_data = request_data.decode('utf-8')
json_data = json.loads(utf_data)

for schemaitem in json_data['entries']:
    # Om det är en Datorlaboration, Laboration eller laboration
    if "aboration" in schemaitem['type_name']['sv']:
        starttid = schemaitem['start']
        datum, tid = starttid.split(' ')
        # veckodag via datetime
        dag = datetime.date(*list([int(x) for x in datum.split('-')])).strftime("%A")[:3]
        tid = tid[:2]
        d, endtid = schemaitem['end'].split()
        endtid = endtid[:2]        
        
        print("Labb", datum, dag, tid, '-', endtid)

Daniel:

Något sådant jag tänkte också. Men jag tänkte sikta på TimeEdit istället för Social. Är Social bättre?

Fördelen jag ser med TimeEdit är att alla lärosäten använder TimeEdit.

The `schedule` subcommands

The schedule command should list the user's schedule.

  • First, by outputting tab-separated CSV (#14) by default.
  • But also by option to output to ICS format (#11).
  • For this we need the config command to set URLs to schedules, #15 .
  • Add time subcommand that summarizes total teaching time for all scheduled teaching.
    • Add options for different values.
    • Add interactive mode to set values for each event.
    • Store result in data directory.
    • Option to write signup sheet to local file (not in data directory).
  • show command shows own events and who else signed up.
    • Add option --all to include all events. (--user "" has this effect.)
  • Add ics command that does the same as show but outputs ICS data.

Add default value for `courses new` command

We can add to the config the default value for each parameter in the courses new command.

Consider adding

nytid config courses.new.DD1310.num_students -s 200
nytid config courses.new.DD1310.num_groups -s 6

then run

nytid courses new prgm24 --code DD1310 --ics ...

and the number of students and groups are picked up from the config based on the matching course code.

Add `schedule new` command to add event

We want to easily add a new event to the schedule, so that TAs can book.

However, this can't be done with the sign-up sheets. Since we can't edit the Google Sheet from nytid.

Add `amanuensis` command

The command should be able to export an "amanuensis contract" including all sessions the TA have included in the amanuensis employment.

This way the command can compute "mertid" when the TA has signed up for more hours. Or extend the contract by emailing HR and Alexander (at the moment).

Add `export` command that exports schedule to ICS formatted file

If we allow export of the schedule to an ICS formatted file, we can put that file in ~/public_html/pytid.ics and then import with Google Calendar (or similar). We should let the command do this automatically if the ~/public_html folder exists. Otherwise print it to stdout or a named file.

Store data in AFS file system

We can store the data somewhere in /afs. We just need correct permissions. Have a default config on KTH servers, so that TAs and course responsible can run it there.

Have a directory for pytid data. Teachers may create subdirectories for courses (through pytid). In this directory we keep course specific configuration and data.

For each course we have a group (created by pytid). The course responsible adds the TAs to the group (through pytid). The TAs can then add or remove themselves from sessions. We could have append-only access for TAs and a format for bookings that add or remove, thus pytid parses all to determine the current status.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.