给学生分配时间段的工具。

assignator的Python项目详细描述


自动分配学生到时间段的工具。在

安装

  • 来自pypi:

    pip install assignator
    
  • 开发版本:

    ^{pr2}$ 在

Python模块

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: 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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
eclipse如何将LWUIT主题文件加载到Java项目中?   JavaJPA HibernateFetchType。渴望和获取模式。加入非主键   java为单个和多个对象创建对象容器   java在到达末尾时在viewpager2中加载更多项目   java我怎么能忽略它。解压时存储DS_和MACOSX文件?   java我无法使用ApachePOI3.10读取xlsx文件   java为什么我在Android应用程序的webView中看到广告(我没有注册任何广告)   在Java中,PrintWriter write()方法在哪里写入数据   c#ProcessStartInfo挂在“WaitForExit”上?为什么?   安卓中的java解析查询问题   java Android摄像头在拍照时禁用   爪哇交货过早地从jsprit的仓库提货   java退避算法仿真   java我的计数反转算法有什么问题?   java什么导致一个类中的变量受到另一个类的影响?   JavaVaadin和Spring引导问题   java无法使用writerInterceptor拦截jersey资源方法   java如何根据配置选择RedisCluster、RedisStandalone和Sentinel连接?   java GSON/如何解析数字   java:字节码中的字符串concat转换为StringBuilder