Repository navigation
12_LifeCycle_Project_Management
The ProjectManager is the orchestrator of all data artifacts within BioPro. It ensures that scientific data (images), analysis states (history), and metadata (project settings) are stored safely and remains portable.
Every BioPro project is a folder. The presence of a project.biopro file identifies it as a valid workspace.
my_experiment/
├── project.biopro # Main metadata & asset registry (JSON)
├── history.json # Full undo/redo chain for the session
├── .biopro.lock # Prevents multi-process corruption
├── assets/ # Folder for local copies of raw images
└── workflows/ # Saved analysis configurations
Scientific data integrity depends on preventing race conditions. If two people (or two instances of BioPro) try to edit the same project folder simultaneously, the data would likely corrupt.
-
Acquire: When a project is opened,
ProjectManagerwrites the current process ID (PID) to.biopro.lock. -
Verify: If a lock exists, it checks if that PID is still running. If the PID is dead (e.g., after a crash), it "steals" the lock. If the PID is alive, it raises
ProjectLockedError. -
Release: The lock is deleted only when the project is safely closed (via
close()).
BioPro supports two ways to handle your raw data (images/tensors).
| Method | Behavior | Pros | Cons |
|---|---|---|---|
| Copy to Workspace | File is copied into assets/ and hashed. |
Portable (can move folder to USB). | Uses more disk space. |
| Reference External | Only the absolute path is stored. | Zero extra disk space. | Breaks if you move the raw data. |
Every image is hashed using SHA-256. This allows BioPro to:
- Detect if you've already added an image (avoiding duplicates).
- Verify that a file hasn't been tampered with or corrupted since it was last analyzed.
BioPro never overwrites a project.biopro file directly. This prevents "partial saves" if the power goes out or the app crashes.
- Current state is written to
project.biopro.tmp. - The OS
replace()command moves the temp file over the real one. - This operation is atomic at the filesystem level—it either succeeds entirely or fails without touching the old data.
Constructor initializes the paths but does not open the files.
-
open_project(): Reads metadata, history, and acquires the lock. -
save(): Triggers an atomic save of all metadata and history threads. -
add_image(path, copy_to_workspace=True): Registers a new biological asset. -
save_workflow(module_id, payload): Persists a specific analysis configuration to theworkflows/directory.