Skip to content

fix(project): keep a project's settings and modules when it is upgraded - #206

Open
ehennestad wants to merge 2 commits into
check-installation-before-migrationfrom
keep-project-settings-on-upgrade
Open

ehennestad wants to merge 2 commits into
check-installation-before-migrationfrom
keep-project-settings-on-upgrade

Conversation

@ehennestad

Copy link
Copy Markdown
Collaborator

Problem

reorganizeProjectFolder upgrades a project from the old layout by calling createProject and then copying the old files into the new folders. createProject writes new datalocation_settings.json and filepath_settings.json catalogs, and the copy puts the project's datalocation_settings.mat and filepath_settings.mat beside them. StorableCatalog uses a json file whenever one exists, so an upgraded project loads the default data locations and an empty list of data variables. The upgrade reports success, and the project's settings stay unused in the mat files.

A project in the old layout lists no modules, because main applies ophys.twophoton to every project. A project in the current layout uses only the modules it lists, so an upgraded project gets the core module only. Its two-photon session methods are not listed, and the RoiGroup and RoiSignalArray file adapters, which 7 of the 9 preset data variables use, are not available.

Change

After the copy, reorganizeProjectFolder deletes a new json catalog that has a copied mat file beside it. The models then load the mat file, which is how StorableCatalog already treats a project stored as mat.

reorganizeProjectFolder writes nansen.module.ophys.twophoton and the core module to Preferences.DataModule in project.nansen.json. It does not call Project.setOptionalModules, because that method also adds the variables of a module using the data locations of the current project. The project has those variables in its own catalog, since the 9 presets on main have the same names as the variable templates of the module.

ProjectFolderUpgradeTest now covers a successful upgrade.

🤖 Generated with Claude Code

ehennestad and others added 2 commits November 8, 2026 17:49
The upgrade tests only covered failures. These tests state what a
successful upgrade has to keep: the data locations and data variables
of the project, and the two-photon module that every project in the
old layout used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
createProject writes new json catalogs for the data locations and the
data variables, and the upgrade copies the project's mat files beside
them. StorableCatalog uses a json file whenever there is one, so an
upgraded project had default data locations and no data variables. A
new json catalog with a copied mat file beside it is now removed.

A project in the old layout lists no modules, because main applies
ophys.twophoton to every project. The upgrade now lists that module,
so the session methods and file adapters of the module stay available.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ehennestad
ehennestad added this pull request to stack #187 November 8, 2026 16:50
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Test Results

680 tests  +4   679 ✅ +4   1m 33s ⏱️ +2s
 54 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 96f531b. ± Comparison against base commit acee67f.

@ehennestad ehennestad self-assigned this Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant