faustedition / faust-macrogen

WIP implementation of the new macrogenesis model
http://faustedition.net/macrogenesis
0 stars 0 forks source link

Reloading graph info leads to duplicates in the order #25

Closed thvitt closed 5 years ago

thvitt commented 5 years ago

To reproduce,

  1. run macrogen to create target/macrogenesis/macrogenesis-info.zip
  2. `MacrogenesisInfo(Path('target/macrogenesis/macrogenesis-info.zip'))

ERROR macrogen.graph Some refs appear more than once in the order: 2 III H.30 (3), 2 III H.7:2 (3), 2 II H.69 (3), 2 II H.5a (2), 2 II H.4a (2), 2 III H.0 (2), 2 III H.69a (2), H P84 (2), 2 III H.6:2 (2), 2 III H.64b (2), 2 III H.25a (2), 2 III H.2a:2 (2), 2 III H.2a:5 (2), 2 III H.2a:4 (2), 2 III H.2a:3 (2), 2 III H.57a (2), 2 III H.59c (2), H P129 Var (2), 2 II H.2:1 (2), 2 II H.16a (2), 2 II H.8:1 (2), 2 II H.27:2 (2), wa: 182 i_r_o (1), 1 H.8 (1), 2 III H.27 alpha (1)

OTOH, the URIs in macrogenesis-info.zip/order.json do not contain duplicates. So what is wrong here?

thvitt commented 5 years ago

The use of pickle in combination with the model that treats references as quasi-singletons is problematic here. Unpickling an object creates the object in a way that doesn’t pass the URIs and assigns the field values later. Calling Witness.get(uri) as is done when reading the order creates a different instance of the same object.