-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The type annotations
OpenLIFU-python/src/openlifu/plan/solution_analysis.py
Lines 8 to 25 in 1463f53
| @dataclass | |
| class SolutionAnalysis(DictMixin): | |
| mainlobe_pnp_MPa: list[float] = field(default_factory=list) | |
| mainlobe_isppa_Wcm2: list[float] = field(default_factory=list) | |
| mainlobe_ispta_mWcm2: list[float] = field(default_factory=list) | |
| beamwidth_lat_3dB_mm: list[float] = field(default_factory=list) | |
| beamwidth_ax_3dB_mm: list[float] = field(default_factory=list) | |
| beamwidth_lat_6dB_mm: list[float] = field(default_factory=list) | |
| beamwidth_ax_6dB_mm: list[float] = field(default_factory=list) | |
| sidelobe_pnp_MPa: list[float] = field(default_factory=list) | |
| sidelobe_isppa_Wcm2: list[float] = field(default_factory=list) | |
| global_pnp_MPa: list[float] = field(default_factory=list) | |
| global_isppa_Wcm2: list[float] = field(default_factory=list) | |
| p0_Pa: list[float] = field(default_factory=list) | |
| TIC: Optional[float] = None | |
| power_W: Optional[float] = None | |
| MI: Optional[float] = None | |
| global_ispta_mWcm2: Optional[float] = None |
indicate that everything is supposed to be float, but here we end up with a numpy type instead:
OpenLIFU-python/src/openlifu/plan/solution.py
Lines 169 to 170 in 1463f53
| pk = np.max(pnp_MPa.data[focus_index] * mainlobe_mask) #TODO: pnp_MPa supposed to be a list for each focus: pnp_MPa(focus_index) | |
| solution_analysis.mainlobe_pnp_MPa += [pk] |
Besides violating the type hint, this will also not serialize and then deserialize faithfully, because the type would change on deserialization.
Traceability Information:
- Issue: OpenLIFU-python#156
- SOFTREQ: OpenLIFU-python#72
- Comment: This issue is related to the requirements defined in OpenLIFU-python#72.
This information was populated automatically by a script on 2025-06-09T18:01:53Z.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working