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.args.add_common_args(parser: argparse.ArgumentParser, select: Optional[List[str]] = None) None[source]

Add standard arguments to parser

pyam.cmd.cohort module

Main routine for pyAutoMark cohort command

pyam.cmd.cohort.add_args(parser: argparse.ArgumentParser)[source]

Add args for this command - none

pyam.cmd.cohort.main(args=None)[source]

Set or query cohort information.

If no cohort is specified list all valid cohorts. If given a cohort name but no further command set the default cohort.

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.extract_downloads.add_args(parser)[source]

Get and parse arguments for this script

pyam.cmd.extract_downloads.extract_details(file, log: Optional[logging.Logger] = None)[source]

Given a grade center filenamereturns username, original filename and submission date.

pyam.cmd.extract_downloads.main(args=None)[source]

Extract student submissions from downloads files

Currently supports Blackboard GradeCenterdownload format where fthe downloaded file names contain the username and submission date.

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

pyam.cohort.Student

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.find_duplicates.main(args=None)[source]

Find duplicate files from students across cohorts

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.generate_template.to_defined_name(nodeid: str) str[source]

Convert a test nodeid into a format suitable for xlsx defined name

Parameters

nodeid (str) – The Nodeid

Returns

A valid XLSX defined name

Return type

str

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.init.add_args(parser: argparse.ArgumentParser)[source]

Add args for this command - none

pyam.cmd.init.main(args=None)[source]

Initialise a directory for pyAutoMark

Creates configuration pyAutoMark.json and subdirectories based on a few questions

pyam.cmd.init.term_input(prompt: str) str[source]

Function to get input from terminal - even windows

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.run.add_args(parser)[source]

Parse Args and return them for this script

pyam.cmd.run.main(args=None)[source]

Run the test suite for specified cohort and students

Generates the test reports for each student in the reports folder.

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.

pyam.cmd.write_csv.main(args=None)[source]

Read marks from a set of mark spreadsheets and write them into csv files

pyam.cmd.write_csv.write_mark_csv(filename, marks)[source]

Write out student marks to a new csv file

Module contents