hydra.build.comparereport module

Type-level model for the JSON snapshot compare-report: the per-module comparison record and the whole-report summary shared by the native generator drivers. See https://github.com/CategoricalData/hydra/issues/416.

class hydra.build.comparereport.CompareReport(rows: Annotated[Sequence[ModuleCompare], 'One record per compared module'], byte_eq_count: Annotated[int, 'How many modules were byte-identical'], total: Annotated[int, 'How many modules were compared'])

Bases: object

The whole compare-report: per-module records plus the byte-identical tally.

BYTE_EQ_COUNT = Name(value='byteEqCount')
class Builder(_rows: 'Sequence[ModuleCompare]' = None, _byte_eq_count: 'int' = None, _total: 'int' = None)

Bases: object

build()
byte_eq_count(byte_eq_count)
rows(rows)
total(total)
ROWS = Name(value='rows')
TOTAL = Name(value='total')
TYPE_ = Name(value='hydra.build.comparereport.CompareReport')
static builder()
byte_eq_count: Annotated[int, 'How many modules were byte-identical']
rows: Annotated[Sequence[ModuleCompare], 'One record per compared module']
total: Annotated[int, 'How many modules were compared']
with_byte_eq_count(byte_eq_count)
with_rows(rows)
with_total(total)
class hydra.build.comparereport.CompareStatus(*values)

Bases: Enum

The result of comparing one module’s JSON on the two sides.

BYTE_EQ = Name(value='byteEq')

The two sides are byte-identical

DIFFER = Name(value='differ')

Both sides exist but differ

MISSING = Name(value='missing')

Our side is absent (the canonical side has the module, ours does not)

TYPE_ = Name(value='hydra.build.comparereport.CompareStatus')
class hydra.build.comparereport.ModuleCompare(module: Annotated[str, "The module name (the JSON file's base name, without the .json suffix)"], status: Annotated[CompareStatus, 'The comparison status'], our_size: Annotated[int, 'The byte size of our (freshly generated) side, or 0 if missing'], canon_size: Annotated[int, 'The byte size of the canonical side'], diff_lines: Annotated[int, 'The number of differing lines (0 when byte-identical)'])

Bases: object

One module’s comparison record.

class Builder(_module: 'str' = None, _status: 'CompareStatus' = None, _our_size: 'int' = None, _canon_size: 'int' = None, _diff_lines: 'int' = None)

Bases: object

build()
canon_size(canon_size)
diff_lines(diff_lines)
module(module)
our_size(our_size)
status(status)
CANON_SIZE = Name(value='canonSize')
DIFF_LINES = Name(value='diffLines')
MODULE = Name(value='module')
OUR_SIZE = Name(value='ourSize')
STATUS = Name(value='status')
TYPE_ = Name(value='hydra.build.comparereport.ModuleCompare')
static builder()
canon_size: Annotated[int, 'The byte size of the canonical side']
diff_lines: Annotated[int, 'The number of differing lines (0 when byte-identical)']
module: Annotated[str, "The module name (the JSON file's base name, without the .json suffix)"]
our_size: Annotated[int, 'The byte size of our (freshly generated) side, or 0 if missing']
status: Annotated[CompareStatus, 'The comparison status']
with_canon_size(canon_size)
with_diff_lines(diff_lines)
with_module(module)
with_our_size(our_size)
with_status(status)