Differences between revisions 5 and 44 (spanning 39 versions)
Revision 5 as of 2010-01-27 17:55:09
Size: 2294
Editor: trogdor
Comment:
Revision 44 as of 2017-04-21 14:38:46
Size: 4964
Editor: ChadSeys
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Overview ==
Scheduler is a simple python script that creates Instructional Lab Schedules (example: [[attachment:103_4320.ps]]<<FootNote(You can go to http://pages.cs.wisc.edu/~ghost/gsview/index.htm to get a viewer for ps files)>>) from a set of simple text files. By default, the program creates a summary page that has a 12-up view of all the schedules, and detail pages for each of the individual schedules (these are about 8 inches square).
Line 20: Line 17:
Input files must be named in the form `<lab num>_<room num>.txt`. The first column has a comma (',') with no space on either side separating the day of the week and the start time. Times are in 24-hour format. Columns are separated by any amount of tabs or spaces but cannot span lines. Lines may begin with an octothorpe/hash/pound-sign ('#') and they will be ignored. Blank lines are also allowed, so please include them between days for readability. Input files must be named in the form `<lab num>_<room num>.txt`. The first column has a comma (',') with no space on either side separating the day of the week and the start time. Times are in 24-hour format. Columns are separated by any amount of tabs or spaces but cannot span lines. Lines that begin with a pound-sign ('#') will be ignored. Blank lines are also allowed, so please include them between days for readability.

{i} As of 2010-9-16, the config file is actually ''parsed'' and not just sliced-and-diced with string subscripting as it was before. Errors are found out much more effectively this way. Another addition is that the parser allows for section numbers to be prefixed with parenthetical course numbers. An example:

{{{
T,14:25 (321)301 Dhorkah 17:25
T,19:00 (321)302 Dhorkah 22:00

W,14:25 (623)301 McDermott 17:25
W,19:00 (623)303 McDermott 22:00
}}}
This is handy for rooms that are used for multiple labs.

{i} As of 2011-2-8, the config file has been expanded (yet) again. It is now permissible to put a "C" or a "c" in place of the section number for a lab. This tells scheduler that the timeslot is to be used for "consultation" and not a regularly scheduled lab. Scheduler will format the block differently.

{{{
F,8:00 C 15:00
F,16:00 c 17:00
}}}
The above will produce a consultation block on Friday from 8am to 3pm and another from 4pm to 5pm. No TA name is displayed in the output and putting one between the "C" and the end time ''will produce a parse error'' (this is new). This should help to cut down on typos (did you mean to have a "C" and no TA name, or did you type "C" instead of a section number?).
Line 23: Line 39:
Install Cygwin and be sure to include the packages python3, inkscape, and ghostscript .
Line 24: Line 41:
To run the file just execute it from the command line (it takes no arguments): To run the script just [[http://effbot.org/pyfaq/how-do-i-make-a-python-script-executable-on-unix.htm|execute]] it from the command line (it takes no arguments). An example of the output:
Line 27: Line 44:
[cwilson@trogdor]$ ./scheduler.py
Generating summary in [summary.ps]...DONE
Generating individual in [103_4320.ps]...DONE
Generating individual in [104_3328.ps]...DONE
Generating individual in [201_4314.ps]...DONE
Generating individual in [207_4310.ps]...DONE
# From the Start Menu, type 'cygwin' then open it.
$ cd /cygdrive/c/Users/Student/Desktop/Schedules/Fall 2015
$ python3 ../../scheduler/scheduler.py
# Then generate the PDF files (for printing) and the SVG files (for web pages)
$ ../../scheduler/ps2others.sh
Line 34: Line 50:
== Printing ==
When printing the schedules, first make sure that the preferences for paper size, orientation, and output are correct; this is best done by performing a test print with a regular piece of white paper, rather than the specially-colored green paper used for the final schedules.
Line 35: Line 53:
Windows:
{{{
C:\Documents and Settings\user\Desktop\scheduler>scheduler.py
Generating summary in [summary.ps]...DONE
Generating individual in [103_4320.ps]...DONE
Generating individual in [104_3328.ps]...DONE
Generating individual in [201_4314.ps]...DONE
Generating individual in [207_4310.ps]...DONE
}}}
If there are any problems with the printing, check to see if;

 * The orientation is set properly (if at all unsure, use portrait)
 * That the paper size is correct. At the moment, it is set to output as an 8.5" by 5" size sheet, which allows for two schedules per sheet. Be sure that the print media is set to Letter, rather than the [[http://en.wikipedia.org/wiki/ISO_216#The_A_series|demonstrably-superior A4]] paper size
 * Check to be sure that the option to print to a PS-enabled device is checked; this forces the printer to take its layout from the PS file and ensures that everything is the correct size.

If there are still problems with printing, please contact help@physics.wisc.edu .
Line 46: Line 62:
 * zip [[attachment:scheduler.zip]]
 * tarball [[attachment:scheduler.tar.gz]]

/!\ Please ignore the `.git/` directory in these archive files, this is for version control and can be ignored (unless you want to send me patches :) ).
 * zip [[attachment:schedulerFall2016.zip]]
Line 52: Line 65:
Please contact cwilson@physics.wisc.edu {i} Updates! See below... Now scheduler has '''much''' better error reporting, {{{reader.py}}} will show you the line and column number of any errors in the input files.

{i} More Updates! Scheduler has been updated so that "Consultation" sections are allowed in the config files.

{i} Even More Updates! Scheduler is now Python3-required (via the [[http://docs.python.org/library/2to3.html|2to3]] tool), has a much better [[http://pyparsing.wikispaces.com/|parser]], and allows nicer syntax in the config files (more on that below). What this means to you is that it should be faster and the config file is more forgiving (while also being accurate).

{i} Yet More Updates! Scheduler has been rewritten (almost) from scratch. Changes are largely on the code-side and so won't be noticed by users. Code in the''scheduler.py'' file is much shorter and easier to read. There is a test suite that checks to see that the code is performing as expected as well as making it ''much'' easier to change code in the future. You can find this under the download section.

Please contact [[mailto:cwilson@physics.wisc.edu|help@physics.wisc.edu]]

----
CategoryComputing

Configuration

This is an example of the layout of an input file (called '103_4320.txt'):

M,12:05 301     Ojalvo    14:00
M,14:25 302     Carmody   16:20
M,16:35 303     Ojalvo    18:30
M,19:05 304     N/A       21:00

T,7:45  305     Carmody    9:40
T,9:55  306     Zeng      11:50
T,12:05 307     Zeng      14:00
...

and so on...

Input files must be named in the form <lab num>_<room num>.txt. The first column has a comma (',') with no space on either side separating the day of the week and the start time. Times are in 24-hour format. Columns are separated by any amount of tabs or spaces but cannot span lines. Lines that begin with a pound-sign ('#') will be ignored. Blank lines are also allowed, so please include them between days for readability.

{i} As of 2010-9-16, the config file is actually parsed and not just sliced-and-diced with string subscripting as it was before. Errors are found out much more effectively this way. Another addition is that the parser allows for section numbers to be prefixed with parenthetical course numbers. An example:

T,14:25 (321)301        Dhorkah         17:25
T,19:00 (321)302        Dhorkah         22:00

W,14:25 (623)301        McDermott       17:25
W,19:00 (623)303        McDermott       22:00

This is handy for rooms that are used for multiple labs.

{i} As of 2011-2-8, the config file has been expanded (yet) again. It is now permissible to put a "C" or a "c" in place of the section number for a lab. This tells scheduler that the timeslot is to be used for "consultation" and not a regularly scheduled lab. Scheduler will format the block differently.

F,8:00  C                               15:00
F,16:00 c 17:00

The above will produce a consultation block on Friday from 8am to 3pm and another from 4pm to 5pm. No TA name is displayed in the output and putting one between the "C" and the end time will produce a parse error (this is new). This should help to cut down on typos (did you mean to have a "C" and no TA name, or did you type "C" instead of a section number?).

Usage

Install Cygwin and be sure to include the packages python3, inkscape, and ghostscript .

To run the script just execute it from the command line (it takes no arguments). An example of the output:

# From the Start Menu, type 'cygwin' then open it.
$ cd /cygdrive/c/Users/Student/Desktop/Schedules/Fall 2015
$ python3 ../../scheduler/scheduler.py
# Then generate the PDF files (for printing) and the SVG files (for web pages)
$ ../../scheduler/ps2others.sh

Printing

When printing the schedules, first make sure that the preferences for paper size, orientation, and output are correct; this is best done by performing a test print with a regular piece of white paper, rather than the specially-colored green paper used for the final schedules.

If there are any problems with the printing, check to see if;

  • The orientation is set properly (if at all unsure, use portrait)
  • That the paper size is correct. At the moment, it is set to output as an 8.5" by 5" size sheet, which allows for two schedules per sheet. Be sure that the print media is set to Letter, rather than the demonstrably-superior A4 paper size

  • Check to be sure that the option to print to a PS-enabled device is checked; this forces the printer to take its layout from the PS file and ensures that everything is the correct size.

If there are still problems with printing, please contact help@physics.wisc.edu .

Download

Bugs/Questions/Comments

{i} Updates! See below... Now scheduler has much better error reporting, reader.py will show you the line and column number of any errors in the input files.

{i} More Updates! Scheduler has been updated so that "Consultation" sections are allowed in the config files.

{i} Even More Updates! Scheduler is now Python3-required (via the 2to3 tool), has a much better parser, and allows nicer syntax in the config files (more on that below). What this means to you is that it should be faster and the config file is more forgiving (while also being accurate).

{i} Yet More Updates! Scheduler has been rewritten (almost) from scratch. Changes are largely on the code-side and so won't be noticed by users. Code in thescheduler.py file is much shorter and easier to read. There is a test suite that checks to see that the code is performing as expected as well as making it much easier to change code in the future. You can find this under the download section.

Please contact help@physics.wisc.edu


CategoryComputing

il: Scheduler (last edited 2017-04-21 14:38:46 by ChadSeys)