comicbox.readinglists.combine ¶
Combine several lists of one reading order into one list and a report.
Pure: no files, no network. The inputs are in rank order, the first being primary. Guarantees:
- The same inputs in the same order give the same output.
- Combining a list with itself returns it unchanged, when every entry has a key.
- Adding an input never reorders the backbone’s own entries.
- A caller that wants to keep an existing order passes it first.
An entry with no key, no usable issue id and no series name and issue with a start year, volume or cover year, cannot be matched, so it is never joined with another, not even with itself in a copy of its list: combining such a list with itself gives that entry twice. A join on the series, issue and cover year alone, the weakest key, is reported with the name joins, and never brings together rows whose series years differ. Nor does a join on the series, volume number and issue: Z-Men (1963) and Z-Men (1991) volume 1 stay apart.
CombineResult dataclass ¶
The combined list and what combining found.
provenance is parallel to the list’s entries: the rows each came from, in rank order. only_in is indexed by input: the entries no other input has. name_joins are the entries some row joined on a series name alone, with a start year, volume or cover year: the joins most likely to be wrong. shared_ids are the ids left on more than one entry that no input repeats.
Source code in comicbox/readinglists/combine/__init__.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
EntryOrigin dataclass ¶
A row of an input: input_index ranks the input, row its entry.
Source code in comicbox/readinglists/combine/__init__.py
46 47 48 49 50 51 | |
IdConflict dataclass ¶
Two values for one source on one issue: one of the lists is wrong.
Combined entry entry keeps kept for source, a database; the row at input_index and row, joined to it, had dropped. A barcode that differs is a printing or an edition, so it is never one.
Source code in comicbox/readinglists/combine/__init__.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
OrderConflict dataclass ¶
An input puts combined entry entry somewhere the backbone does not.
Source code in comicbox/readinglists/combine/__init__.py
54 55 56 57 58 59 60 | |
SharedId dataclass ¶
A database id the combined list holds on more than one entry.
No input repeats it, so it names one issue, but the rows that carry it could not all be joined: one input gave the issue twice, with a different id each time, and a row of one input joins at most one row of another. That is bad data worth showing. entries are the positions.
Source code in comicbox/readinglists/combine/__init__.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
combine(reading_lists) ¶
Combine lists of one reading order, given in rank order.
Rows are the same issue when they share an entry_keys key. The first ordered input is the backbone of the order; an entry’s fields are the union of ids and otherwise the first value in rank order.
Source code in comicbox/readinglists/combine/__init__.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |