pyam.cmd package¶
Submodules¶
pyam.cmd.args module¶
Standard argumments for sub command scripts
- Functions:
add_common_args(parser): Adds common arguments to parser
pyam.cmd.cohort module¶
Main routine for pyAutoMark cohort command
pyam.cmd.config module¶
Main routine for config command
- pyam.cmd.config.add_args(parser: argparse.ArgumentParser) None [source]¶
Add arguments for config command
- pyam.cmd.config.main(args=None) None [source]¶
Set or query configuration parameters.
Keys may be in ‘.’ format e.g. 2022.assessor.username sets assessor.username in cohort 2022 global name may be used to set global parameters across all cohorts (unless set locally). If no value is given print out current value.
pyam.cmd.extract_downloads module¶
Extracts files for given list of archive files into student directories under cohort
pyam.cmd.find_duplicates module¶
Main routing for find-duplicates command
- class pyam.cmd.find_duplicates.FileRecord(student: pyam.cohort.Student, file: pathlib.Path)[source]¶
Bases:
object
Record of path with student owner, stats and digest
- student¶
The Student for this file
- Type
- stat¶
The file.stat for the file
- file¶
The Path to the file
- Type
pathlib.Path
- digest¶
The identifying digest of the file
- file: pathlib.Path¶
- student: pyam.cohort.Student¶
- pyam.cmd.find_duplicates.add_args(parser=ArgumentParser(prog='sphinx-build', usage=None, description='Main routing for find-duplicates command\n', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True))[source]¶
Add find_duplicates command arguments to parser
- pyam.cmd.find_duplicates.get_records(cohort_names: Sequence[str]) List[pyam.cmd.find_duplicates.FileRecord] [source]¶
Given a list of cohort names return a list of FileRecords for each student and file in a manifest
- pyam.cmd.find_duplicates.group_records(records: List[pyam.cmd.find_duplicates.FileRecord]) Dict [source]¶
GIve a list of file records group them by digest. Return a dictionary of matching records indexed by digest
pyam.cmd.generate_template module¶
Main generate-template command.
- pyam.cmd.generate_template.add_args(parser=ArgumentParser(prog='sphinx-build', usage=None, description='Main generate-template command.\n', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True))[source]¶
Return args for this script
- pyam.cmd.generate_template.main(args=None)[source]¶
Generate a template marking spreadsheet
Starts from specified template or template-template.xlsx and adds in a row per test with the description, a named cell to filled in as PASSED or FAILED from the students reports and a mark as per the test manifest.
The following Global defined names are used in template
institution_name institution_department course_code course_name assessor_name assessor_email assessment_name automark student_name student_id student_email student_course date mark
pyam.cmd.github_push module¶
Main ROtine for github-retirieve command
- pyam.cmd.github_push.add_args(parser=ArgumentParser(prog='sphinx-build', usage=None, description='Main ROtine for github-retirieve command', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True))[source]¶
Parse and return args for this script
- pyam.cmd.github_push.main(args=None)[source]¶
Push files into student repositories on github (classroom).
- Cohort manifest be configured with:
- github.template:
The name of the template repository (prefix for student repositories)
- github.url:
URL to github organisation where repositories reside
- github.branch:
Name of students main branch
Students must have ‘Github Username’ field in csv file and an assessment specified.
pyam.cmd.github_retrieve module¶
Main Routine for github-retirieve command
- pyam.cmd.github_retrieve.add_args(parser=ArgumentParser(prog='sphinx-build', usage=None, description='Main Routine for github-retirieve command', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True))[source]¶
Parse and return args for this script
- pyam.cmd.github_retrieve.main(args=None)[source]¶
Retrieve files from student repositories on github (classroom).
- Cohort manifest be configured with:
- github.template:
The name of the template repository (prefix for student repositories)
- github.url:
URL to github organisation where repositories reside
- github.branch:
Name of students main branch
Students must have ‘Github Username’ field in csv file.
pyam.cmd.init module¶
Main routine for pyAutoMark init command
pyam.cmd.mark module¶
Main routine for mark command.
- pyam.cmd.mark.add_args(parser=ArgumentParser(prog='sphinx-build', usage=None, description='Main routine for mark command.\n', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True))[source]¶
Add and parse args for this script
- pyam.cmd.mark.analyse_report(report_path: pathlib.Path, tests: dict, log=None)[source]¶
Returns a dictionary of results from a report file at path
- pyam.cmd.mark.fill_workbook(template, student, report)[source]¶
Fill in workbook 0 of template with student and report details
- pyam.cmd.mark.get_reports(cohort, students, paths, prefix) dict [source]¶
Returns a reports dictionary for given students and reports list
- pyam.cmd.mark.main(args=None)[source]¶
Generate mark spreadsheets for each student
Reads in test reports and a template spreadsheet. Creates a mark spreadsheet for each student from template with the cells named by the test ids set to PASSED or FAILED based on the report.
Completes the following additional defined names in the template for each student:
student_name
student_id
student_email
student_course
date
assessor_name
course_code
course_name
course_assessment
institution_name
institution_department
pyam.cmd.run module¶
Main routine for run command
pyam.cmd.write_csv module¶
Implementation of write-csv command
- pyam.cmd.write_csv.add_args(parser=ArgumentParser(prog='sphinx-build', usage=None, description='Implementation of write-csv command', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True))[source]¶
Add and parse args for this script
- pyam.cmd.write_csv.get_id_and_mark(path)[source]¶
Returns student id and mark from spreadsheet at path
- pyam.cmd.write_csv.get_marks(cohort, students, prefix, paths) dict [source]¶
Sets marks for a set of students from spreadsheets
Given a list of paths, or a cohort name and prefix Returns a dictionary mapping student_id to marks.
Will warn if there are missing marks or missing students.