qcg.pilotjob.reports module
- class qcg.pilotjob.reports.JobReport(report_file, buffer_size=100)
Bases:
objectBase class for report generating classes.
The
report_job_entrymust be overloaded by the child classes.- report_file
path to the report file
- Type
str
- buffer
buffer for caching reports
- Type
io.StringIO
- buffered_entries
number of buffered entries
- Type
int
- buffer_size
maximum number of entries in cache before they will be flushed to the report file
- Type
int
Initialize report class.
- Parameters
report_file (str) – path to the report file
buffer_size (int) – maximum number of entries to be buffered
- report_job(job, iteration)
Report job statistics.
- Parameters
job (Job) – job to report
iteration (int) – job’s iteration index
- flush()
Output buffered entries to the file.
- class qcg.pilotjob.reports.TextFileReport(report_file)
Bases:
JobReportGenerate human readable job report file.
Initialize text file reporter.
- Parameters
report_file (str) – path to the report file
- NAME = 'text'
- class qcg.pilotjob.reports.JsonFileReport(report_file)
Bases:
JobReportGenerate easy parsable JSON job report file.
Initialize text file reporter.
- Parameters
report_file (str) – path to the report file
- NAME = 'json'
- qcg.pilotjob.reports.none_reporter()
Dummy class for no reporting job’s.
- qcg.pilotjob.reports.get_reporter(format_name, report_file)
Return reporter class based on the name.
- The currently available reporter classes are:
‘text’ - human readable job reports ‘json’ - easy parsable JSON job reports ‘none’ - none reporting
- Parameters
format_name (str) – report format name
report_file (str) – path to the output file
- Returns
instance of report class
- Return type
- Raises
ValueError – when reporter with given name is not known