A tool for automatic assignments of students to timeslot.
Installation
-
From pypi:
pip install assignator -
Dev version:
git clone https://github.com/jb-leger/assignator cd assignator/ pip install -e .
Python module
assignments(bmat, order=1, ntry=10)
Make assignments between rows and columns.
The objective is to have assigments following the following conditions:
- all association are allowed in bmat,
- each row is associated with a unique column,
- each column is associated with a unique row,
- all rows are associated.
A classical use case is to assign students to defense schedule.
Parameters
----------
bmat : array of bool or int
Binary matrix indicating which assignments are allowed.
order : int, optional
Order of the greedy search. Default: 1. A higher oreder can be used for
small dataset if a solution can not be found with oreder 1.
ntry : int
Number of random tries to use to solve the assignments problem.
Returns
-------
AssignmentResult
Attributes are:
- ``best_assignments`` contains the assigments that solve the problem
or aith the higher number of associated rows.
- ``not_assigned_rows`` contains the indexes of not assignated rows in
the ``best_assignments`` (empty if the problem is solved)
- ``problematic_rows`` contains tuples of problematics rows indexes
and scores. A higher score indicating a row is problematic for the
assignement problem.
Cli usage
usage: assignator [-h] [-e TIMESLOT_FILE] [-o OUTPUT_FILE] [-t TIMESLOT_FILE]
[-g GROUPS_FILE]
INPUT_FILE
A tool to assign students to time slots.
With allowed assignments provided in a csv (e.g. from a survey),
provide a acceptable solution.
positional arguments:
INPUT_FILE Input CSV file with headers. Encoding and CSV dialect
are autodetected. This file must contain a header. The
firsts columns contains a student identifier (e.g. the
name or the name and the email address). Following
columns are timeslots. the column name must identify
the timeslot and therefore must be unique.
optional arguments:
-h, --help show this help message and exit
-e TIMESLOT_FILE, --export-timeslots TIMESLOT_FILE
Export in TIMESLOT_FILE all timeslots from the input
csv.
-o OUTPUT_FILE, --output OUTPUT_FILE
Output CSV file where to write assignments. The
encoding and CSV dialect is the same than the input.
-t TIMESLOT_FILE, --timeslots TIMESLOT_FILE
Restrict allowed timeslots to timeslots provided in
TIMESLOT_FILE. All line beginning with a '#' is
ignored. See -e to generate a version of this file. If
not provided, all timeslots are allowed.
-g GROUPS_FILE, --groups GROUPS_FILE
Students are in groups, and the assignments must be
done by groups. The GROUPS_FILE must be a CSV with a
header and two columns, the first must be a column
identifying the student and must have exactly the same
name than one of the columns provided in the
INPUT_FILE, and values must corresponds (order or rows
doesn't matter), and the second column must be a group
identifier (whatever its name). If more than one
student answer for a group, the intersection is made
to build allowed timeslots for the group.
Workflow example:
- Give a survey to your students providing a little bit more time
slots than student number. Export the survey result in CSV.
- To have a fist allocation, run the command:
assignator survey.csv -o output.csv
If you have not assigned students, contact all the students
marked as problematic (not only the not assigned) to extend
their choices. Once a allocation can be made go to next step.
- If you have more time slots than student, you can try to choice
the time slot you want to free.
1. First, export the timeslot list from the csv:
assignator survey.csv -e timeslots.txt
2. Edit the timeslots file, adding a '#' in the begining of the
timeslots you want to free.
3. Run the command with the timeslots
assignator -t timeslots.txt survey.csv -o output.csv
Metadata
Release files for assignator 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| assignator-0.4.tar.gz | 10.1 kB | Without provenance | Details for assignator-0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| assignator-0.4-py3-none-any.whl | Python 3 | none | any | Details for assignator-0.4-py3-none-any.whl |
Total release size: 21.0 kB
Release files / assignator-0.4.tar.gz
| Download URL | assignator-0.4.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47d9c27cec15f0d711da29a4ec7fd228275babdd692e785160f5b369931ab374
|
|
BLAKE2b-256 checksum How to use checksums |
8aea64e20f032da5d788665fcfb2324fde7bb33ac3412f017478036b13d6954c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Release files / assignator-0.4-py3-none-any.whl
| Download URL | assignator-0.4-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7cc949f68fa215df8704a1e2c77b6b11335efa4f8211d0c041bc6d7a1eb2e35
|
|
BLAKE2b-256 checksum How to use checksums |
e562552744549c661b6e9fa895f120dc22fe202e6f7b48682866c161f872afba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Security for assignator 0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.