Skip to content

Refactor notes

Files >1000 LOC (split candidates)

Each of the files below carries an inline [REFACTOR NOTE] comment at the top suggesting a future split. They were left intact during the structural refactor — treat them as candidates only when you're already touching them for an unrelated reason.

File LOC
src/depth_fm/training/lightning_module.py 1982
src/depth_fm/objectives/losses.py 1226
src/depth_fm/viz/debug_viz.py 3382
src/dataset/core/base.py 1369

Don't proactively split unless asked.

Test paths broken after the refactor

About 48 unit tests under tests/ use string-based mock.patch("dataset.X.Y") and caplog.at_level(logger="dataset.X") calls that still reference pre-refactor module paths. Functionality is unchanged — only the test patches reference stale names.

Files affected:

  • test_mars_hirise_unit.py
  • test_preprocessing.py
  • test_download.py
  • test_sampler.py
  • test_depthfm.py

Paths to update:

Old prefix New prefix
dataset.mars_hirise dataset.core.base
dataset.cog_conversion dataset.preprocessing.cog_conversion
dataset.sampler dataset.sampling.sampler
depth_fm.lightning_module depth_fm.training.lightning_module

The integration suite (-m integration) still requires real data at /scratch/mars_hirise.

Logging configuration

Configured via logger_config.json:

  • stdout: WARNING+
  • stderr: ERROR+
  • app.log: DEBUG+ (full trace)