refactor: extract GEXF export from the Apotheosis facade (closes #18) - #25
refactor: extract GEXF export from the Apotheosis facade (closes #18)#25Dani-giron wants to merge 2 commits into
Conversation
…rseame#18) draw(), add_attribute_schema() and save_gexf() move unchanged to a new export::gexf module that consumes the facade through its public API.
37b208b to
0ae7858
Compare
|
|
||
| // Once draw is built, we need to add the attribute schema to the GEXF XML | ||
| // Has to be done manually since gexf crate does not support it yet. | ||
| fn add_attribute_schema(xml: String, attributes: Vec<(String, String)>) -> String { |
There was a problem hiding this comment.
This functions shouldn't be necessary anymore (fixed at GEFX library)
|
Heads up: this PR will conflict with #34. This PR deletes the Whichever of the two merges second will get a real conflict there, not a false positive, one deletes the lines the other modifies. If #25 goes first, the |
Summary
apotheosis.rsmixed index coordination, persistence and GEXF visualization export (about 85 of its 250 lines, including manual XML string patching). Any change to the export format touched the same file holding the critical insert/search logic.Changes
src/export/gexf.rs(new):draw(),add_attribute_schema()andsave_gexf()moved unchanged, now a free functionexport::gexf::draw(&model, path)consuming the facade through its public API.src/controllers/apotheosis.rs:draw()removed. Two read-only accessors added:draw_model()(graph shape, one entry per layer) andrecord(index). Both are needed byexport::gexf::draw(), which lives outside this impl and cannot reachhnsw/recordsdirectly now that they are private ([Enhancement] Make Apotheosis internal fields private to protect the synchrony invariant #14/fix: make Apotheosis internal fields private (closes #14) #15).src/lib.rs:pub mod export;.Breaking change, declared: callers of
model.draw(path)move toexport::gexf::draw(&model, path). Verified nothing in this repo callsdraw()besides its own definition.Test plan
Test coverage for this refactor will be added as part of the dedicated test suite work (tests are being consolidated separately instead of per-PR).
cargo test,cargo checkpass locally.rustfmt --checkon the three changed files (apotheosis.rs,export/gexf.rs,export/mod.rs) passes. (src/lib.rswas excluded from the direct rustfmt check since it cascades to the whole module tree including unrelated pre-existing files.)cargo clippyon the full crate could not be verified locally (unrelated toolchain issue on this machine); will be validated by CI on this PR.Closes #18