Skip to main content

Module for working with course requisite data and checking requisite satisfaciton.

Project description

Requisite Processor

The RequisiteProcessor class is designed to evaluate whether the prerequisite rules for a course are met given a list of completed courses and test score data.

Prerequisite Data

This module can make use of any arbitrary prerequisite information given that it is formatted correctly. For more information on the necessary structure as well as the latest prerequsite data for UNM courses, see this repo:

https://lobogit.unm.edu/unm-data-analytics/requisite-data#

Usage

Initialization

Initialize the RequisiteProcessor with a dictionary of prerequisite rules.

from requisite_processor.requisite_processor import RequisiteProcessor

prerequisite_rules = {
    "202310": {
        "MATH 1512": {
            "type": "course",
            "course": {"code": "MATH 1234"},
            "minimum_course_grade": "C"
        }
    }
}

processor = RequisiteProcessor(prerequisite_rules)

Processor Methods

The RequisiteProcessor contains the following methods: availabile_academic_periods: Returns a list of all academic periods in the dataset.

academic_periods = processor.availabile_academic_periods
print(academic_periods)  # Output: ['202310', '202380']

latest_available_academic_period: Returns the most recent academic period.

latest_period = processor.latest_available_academic_period
print(latest_period)  # Output: '202380'

check_satisfaction: Checks if a student satisfies the prerequisites for a course in a specific academic period.

Parameters:

  • course_code (str): Course to check prerequisites for.
  • courses_taken (list[dict], optional): List of completed courses and grades. Defaults to [].
  • test_scores (dict, optional): Test scores dictionary. Defaults to {}.
  • academic_period (str, optional): Academic period. Defaults to the latest available.
  • ignore_tests (bool, optional): Ignore test requirements. Defaults to False.
  • ignore_grades (bool, optional): Ignore grade requirements. Defaults to False.

Returns: RequisiteCheckResult object. The result of the prerequisite check.

See below for example usage.

Example Prerequisite Satisfaction Check

courses_taken = [{"code": "MATH 1250", "grade": "B"}]
test_scores = {"A01": 28}

result = processor.check_satisfaction(
    course_code="MATH 1512",
    courses_taken=courses_taken,
    test_scores=test_scores
)

print(result.satisfied)  # Output: True or False

Future Work

  • Write tests
  • Allow for more customization in how requisites are processed.
  • Write additional helper functions such as string representation of requirements, flattend requirements and more.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

requisite_processor-0.1.4.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

requisite_processor-0.1.4-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file requisite_processor-0.1.4.tar.gz.

File metadata

  • Download URL: requisite_processor-0.1.4.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/23.5.0

File hashes

Hashes for requisite_processor-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a277e2cd661a31a89db42036313b74a980ee403a397551a1dbbff7edba673c65
MD5 5bf8e10be3d64db9680808040540c97f
BLAKE2b-256 8a52321f84ac2b8cc5510c3f3f9e9b98f07e98f39a2a47b6e1e30251dd3117df

See more details on using hashes here.

File details

Details for the file requisite_processor-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for requisite_processor-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1c3f13b3a34eb0bf8d7dfa828e698f51f5dfcbf05d097c33cbdbaa5866127e90
MD5 c173640b9be4c3a3387d387f3a967eeb
BLAKE2b-256 8cc461af6266f03445fb693f4b5247144109f2b3c739d5e8e6188c0d47d22ad5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page