Repository navigation
fix(project): keep a project's settings and modules when it is upgraded - #206
Open
ehennestad wants to merge 2 commits into
Open
ehennestad wants to merge 2 commits into
ehennestad wants to merge 2 commits into
Conversation
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>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
reorganizeProjectFolderupgrades a project from the old layout by callingcreateProjectand then copying the old files into the new folders.createProjectwrites newdatalocation_settings.jsonandfilepath_settings.jsoncatalogs, and the copy puts the project'sdatalocation_settings.matandfilepath_settings.matbeside them.StorableCataloguses 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
mainappliesophys.twophotonto 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 theRoiGroupandRoiSignalArrayfile adapters, which 7 of the 9 preset data variables use, are not available.Change
After the copy,
reorganizeProjectFolderdeletes a new json catalog that has a copied mat file beside it. The models then load the mat file, which is howStorableCatalogalready treats a project stored as mat.reorganizeProjectFolderwritesnansen.module.ophys.twophotonand the core module toPreferences.DataModuleinproject.nansen.json. It does not callProject.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 onmainhave the same names as the variable templates of the module.ProjectFolderUpgradeTestnow covers a successful upgrade.🤖 Generated with Claude Code