Skip to content

Remove the dead MATLAB code left on the imaging path #207

Open

Description

@vrrigs

🤖 AI text below 🤖

Context

The imaging path no longer uses MATLAB. TiffSplit ingestion moved to Python in 6f1c52b ("AcquiredTiff population translation to python", 2026-05-21), and suite2p runs from Python (suite2p_slurm_job.py, conda or uv, #204); neither imaging slurm script loads matlab. Code and comments from the MATLAB version are still there. None of it runs, but it suggests a dependency on U19-pipeline-matlab and on module load matlab that no longer exists.

Found while checking what on the imaging path still uses conda or MATLAB (#204).

Dead code

  • AcquiredTiff.old_make (u19_pipeline/imaging_pipeline.py:184-198): it ran ingest_scaninfo_shell.sh with the U19-pipeline-matlab/scripts directory. Nothing calls it, and the Python make replaced it.
  • u19_pipeline/automatic_job/ingest_scaninfo_shell.sh: only old_make uses it. It runs module load matlab/R2024a and matlab ... populate_Imaging_AcquiredTiff(...).
  • u19_pipeline/automatic_job/params_config.py:269-276: datajoint_proj_dir, u19_matlab_dir, startup_pipeline_matlab_dir and ingest_scaninfo_script. Only old_make reads them, but params_config computes them on every import (get_root_directory()). Check that datajoint_proj_dir isn't used elsewhere before removing it.
  • u19_pipeline/automatic_job/slurm_creator.py:22-23: default_preprocessing_tool = "kilosort2" and default_matlab_ver = "R2020b" are not used anywhere.

Stale comments

  • u19_pipeline/automatic_job/recording_handler.py:485 says "call matlab script that handles TiffSplits", and line 489 says "fovs records ingested in matlab Script". Both now happen in AcquiredTiff.make in Python.
  • The second line of the TiffSplit definition (u19_pipeline/imaging_pipeline.py:206) says "make function is declared in the U19-pipeline-matlab repository". It is an ordinary comment, not the table comment (that is the first # line), so editing it doesn't touch the table.

Worth a look, but leave it if unsure

  • u19_pipeline/automatic_job/SlurmFiles/slurm_real.slurm and slurm_real_spock.slurm are tracked copies of old generated scripts (module load matlab/R2020a, anacondapy). generate_slurm_file overwrites slurm_real.slurm on every run, which is likely why the handler's cron wrapper pulls with --autostash.
    • Untracking them (git rm --cached plus .gitignore) would make the deployed checkout stop showing local changes.
    • The pull that removes them from the index also deletes the file on u19proc. The handler writes it again before each use, so check that first.

Not dead (keep)

  • module load matlab/R2024a in the ephys slurm scripts (slurm_creator.py, conda and uv): native MATLAB Kilosort 2 / 3 paramsets need it on the node (see spock_uv_env.md).
  • The MATLAB references in u19_pipeline/utility.py: they are about matching MATLAB's psychometric fit and MATLAB DataJoint blobs.

Size

Small: delete one method, one shell script, a few constants and two comments. Tests: the existing imaging and handler tests should still pass, and a grep for old_make, ingest_scaninfo and startup_pipeline_matlab_dir should find nothing.

Pull request coverage

Open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions