Records Class#

class acro.record.Records[source]

Bases: object

Stores data related to a collection of output records.

Methods

add(status, output_type, properties, sdc, ...)

Add an output to the results.

add_comments(output, comment)

Add a comment to an output.

add_custom(filename[, comment])

Add an unsupported output to the results dictionary.

add_exception(output, reason)

Add an exception request to an output.

finalise(path, ext)

Create a results file for checking.

finalise_excel(path)

Write outputs to an excel spreadsheet.

finalise_json(path)

Write outputs to a JSON file.

get(key)

Return a specified output from the results.

get_index(index)

Return the output at the specified position.

get_keys()

Return the list of available output keys.

print()

Print the current results.

remove(key)

Remove an output from the results.

rename(old, new)

Rename an output.

validate_outputs()

Prompt researcher to complete any required fields.

write_checksums(path)

Write checksums for each file to checksums folder.

__init__()[source]

Construct a new object for storing multiple records.

Return type:

None

add(status, output_type, properties, sdc, command, summary, outcome, output, comments=None)[source]

Add an output to the results.

Parameters:
statusstr

SDC status: {“pass”, “fail”, “review”}

output_typestr

Type of output, e.g., “regression”

propertiesdict

Dictionary containing structured output data.

sdcdict

Dictionary containing SDC results.

commandstr

String representation of the operation performed.

summarystr

String summarising the ACRO checks.

outcomeDataFrame

DataFrame describing the details of ACRO checks.

outputlist[str | list[DataFrame]

List of output DataFrames.

commentslist[str] | None, default None

List of strings entered by the user to add comments to the output.

Parameters:
  • status (str)

  • output_type (str)

  • properties (dict)

  • sdc (dict)

  • command (str)

  • summary (str)

  • outcome (DataFrame)

  • output (list[str] | list[DataFrame])

  • comments (list[str] | None)

Return type:

None

remove(key)[source]

Remove an output from the results.

Parameters:
keystr

Key specifying which output to remove, e.g., ‘output_0’.

Parameters:

key (str)

Return type:

None

get(key)[source]

Return a specified output from the results.

Parameters:
keystr

Key specifying which output to return, e.g., ‘output_0’.

Returns:
Record

The requested output.

Parameters:

key (str)

Return type:

Record

get_keys()[source]

Return the list of available output keys.

Returns:
list[str]

List of output names.

Return type:

list[str]

get_index(index)[source]

Return the output at the specified position.

Parameters:
indexint

Position of the output to return.

Returns:
Record

The requested output.

Parameters:

index (int)

Return type:

Record

add_custom(filename, comment=None)[source]

Add an unsupported output to the results dictionary.

Parameters:
filenamestr

The name of the file that will be added to the list of the outputs.

commentstr | None, default None

An optional comment.

Parameters:
  • filename (str)

  • comment (str | None)

Return type:

None

rename(old, new)[source]

Rename an output.

Parameters:
oldstr

The old name of the output.

newstr

The new name of the output.

Parameters:
  • old (str)

  • new (str)

Return type:

None

add_comments(output, comment)[source]

Add a comment to an output.

Parameters:
outputstr

The name of the output.

commentstr

The comment.

Parameters:
  • output (str)

  • comment (str)

Return type:

None

add_exception(output, reason)[source]

Add an exception request to an output.

Parameters:
outputstr

The name of the output.

reasonstr

The reason the output should be released.

Parameters:
  • output (str)

  • reason (str)

Return type:

None

print()[source]

Print the current results.

Returns:
str

String representation of all outputs.

Return type:

str

validate_outputs()[source]

Prompt researcher to complete any required fields.

Return type:

None

finalise(path, ext)[source]

Create a results file for checking.

Parameters:
pathstr

Name of a folder to save outputs.

extstr

Extension of the results file. Valid extensions: {json, xlsx}.

Parameters:
  • path (str)

  • ext (str)

Return type:

None

finalise_json(path)[source]

Write outputs to a JSON file.

Parameters:
pathstr

Name of a folder to save outputs.

Parameters:

path (str)

Return type:

None

finalise_excel(path)[source]

Write outputs to an excel spreadsheet.

Parameters:
pathstr

Name of a folder to save outputs.

Parameters:

path (str)

Return type:

None

write_checksums(path)[source]

Write checksums for each file to checksums folder.

Parameters:
pathstr

Name of a folder to save outputs.

Parameters:

path (str)

Return type:

None