Skip to content

Replace pickled splines with other data serialization method #2

@scottstanie

Description

@scottstanie

Noting this issue for whichever improved method we use to save the carballo cost lookup table: The Scipy RegularGridInterpolator objects have changed in recent versions, leading to this unwrapping error:

  File "/Users/staniewi/repos/dolphin/src/dolphin/unwrap/_unwrap.py", line 425, in unwrap
    unw_path, conncomp_path = unwrap_whirlwind(
                              ^^^^^^^^^^^^^^^^^
  File "/Users/staniewi/repos/dolphin/src/dolphin/unwrap/_whirlwind.py", line 99, in unwrap_whirlwind
    unw = ww.unwrap(igram, corr, nlooks, mask=mask)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/staniewi/miniconda3/envs/mapping-312/lib/python3.12/site-packages/whirlwind/_unwrap.py", line 28, in unwrap
    cost = compute_carballo_costs(igram, corr, nlooks, mask)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/staniewi/miniconda3/envs/mapping-312/lib/python3.12/site-packages/whirlwind/_cost.py", line 74, in compute_carballo_costs
    cost_up = compute_cost(-phase_dx_smooth, corr_dx)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/staniewi/miniconda3/envs/mapping-312/lib/python3.12/site-packages/whirlwind/_cost.py", line 65, in compute_cost
    p1_batch = spline_pdf1((phase_batch, corr_batch, nlooks))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/staniewi/miniconda3/envs/mapping-312/lib/python3.12/site-packages/scipy/interpolate/_rgi.py", line 391, in __call__
    _spline = self._spline
              ^^^^^^^^^^^^
AttributeError: 'RegularGridInterpolator' object has no attribute '_spline'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions