Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Remove `Session.array_transform` attribute (obsolete single-transducer-pose model)

Aperta
#485 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
database

Direzione di ricerca

Inizia da src/openlifu/db/session.py e analizza la serializzazione di Session. Poi esamina la costruzione di Session in examples/tutorials/02_Database_Interaction.py e nel notebook corrispondente. Esegui i test del database in tests/test_database.py ed esamina tests/resources/example_db/ per individuare dati legacy di array_transform. Il lavoro è completato quando i fixture e gli esempi correnti non fanno più riferimento al campo, mentre from_dict continua a caricare le sessioni legacy.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

Remove the array_transform: ArrayTransform field from openlifu.db.Session, along with its to_dict / from_dict handling, the associated docstring notes, and every reference in examples, tests, and test-resource JSON.

Motivation

Session.array_transform was designed around the assumption that a session has a single canonical "the transducer position." In SlicerOpenLIFU that assumption no longer holds:

  • Each page that renders the transducer (pre-planning, localization, solution) picks whichever of the persisted transforms it needs (a specific approved virtual-fit result, a specific approved transducer-tracking result, or -- on the localization page -- both simultaneously).
  • The full list of transducer transforms lives in session.virtual_fit_results and session.transducer_tracking_results, keyed by target / photoscan.
  • Approval invalidation is now driven per-VF and per-TT rather than by writing back a single pose.

As a result, SlicerOpenLIFU has stopped reading and writing session.array_transform (see the accompanying downstream PR). The field is now unused by the primary consumer and only serves to confuse the persistence model.

Scope of changes required in this repo

  • src/openlifu/db/session.py
    • Remove the array_transform field definition on Session.
    • Remove the corresponding to_dict / from_dict handling for array_transform.
    • Update the solution_id field docstring, which currently claims the id is "cleared whenever the array_transform changes." That invalidation policy needs to be reconsidered (probably driven by VF / TT approval changes on the consumer side); at minimum, drop the array_transform reference from the doc.
  • examples/tutorials/02_Database_Interaction.py and the matching .ipynb -- drop the array_transform=ArrayTransform(...) argument from the Session(...) construction.
  • tests/test_database.py -- remove assertions on session.array_transform.matrix.shape / .units and any loop variables named array_transform that come from the same fixture.
  • Test resource JSON files under tests/resources/example_db/ that carry an "array_transform" block -- either drop the block or regenerate the fixtures so they no longer contain it. from_dict should tolerate the field being absent, so old on-disk sessions still load cleanly.
  • Sample database (openlifu-sample-database repo) sessions currently carry an "array_transform" block too; that repo will need a matching sweep, but that is out of scope for this issue.

Backwards compatibility

Session.from_dict should silently ignore a legacy "array_transform" key so that existing on-disk sessions (including the pinned openlifu-sample-database fixtures) still load with the new library version.

Downstream

Coordinated with the SlicerOpenLIFU cleanup that decommissions the array_transform read/write path on the consumer side.

Lingua principale
Python
Stelle
29
Fork
20
Merge medio
4h 31m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenwaterHealth/openlifu-python

Tutte le issue di OpenwaterHealth/openlifu-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.