dev guide
Welcome to the developer documentation for the Linear Assignment toolbox. This documentation is intended to help developers to understand the code of the toolbox. It is expected that you are familiar with object-oriented programming in MATLAB.
[[TOC]]
The source code for this project is managed using Git and hosted on GitHub.
- To get the latest development version of the code, clone the repository using Git
git clone git@github.com:Biofrontiers-ALMC/cell-tracking-toolbox.git
cd lap-cell-tracker
- Switch to the development branch
git checkout dev
- Add the
tbx
directory to the MATLAB path
addpath('tbx/')
The toolbox is structured following the Best Practices outlined in this Mathworks Blogs post.
lap-cell-tracker (root)
|-- build/ - Project file (*.prj) to build the toolbox
|-- tbx/ - Main toolbox folder
|-- docs/ - MATLAB documentation
|-- lap-tracker/ - Classes and code
|-- tests/ - Testing code
We welcome contributions that make the code better. The recommended way to contribute code to the project is by submitting a pull request.
-
(Optional but recommended) Check for open issues or open a fresh issue for your feature idea or bug.
-
Create a copy of the project by forking using the GitHub interface on the project page.
-
Checkout the development branch
git checkout dev
-
Switch to a new working branch. You can name it whatever you like.
git checkout -b my-new-feature
-
Add your code.
-
Write a test showing that the bug was fixed or that the feature works as expected.
-
Once everything is working as expected, add the files and commit to your local repository.
git add -A git commit -m 'Fixed an incorrectly named variable in function()'
Please help us understand what you have changed by writing a descriptive title. If your changes are more extensive, please add a detailed message by running a full commit instead.
git add -A git commit
-
Push your changes to the forked repository
git push origin my-new-feature
-
Submit a merge request to the
dev
branch. A maintainer will then review the code and merge it with the main code if accepted.
This section is for maintainers of the project.
We use the Gitlab flow
model to organize the repository. In short, all development occurs on the main
dev
branch and new feature branches are merged by maintainters into dev
.
Once enough changes have accumulated, we will create a new release that merges
dev
into the master
branch.
Version numbers are created using the semantic versioning
specification. Version numbers are MAJOR.MINOR.PATCH
.
-
MAJOR
versions are incompatible with previous major versions. -
MINOR
versions are backwards compatible with previous versions. -
PATCH
versions are for backwards compatible bug fixes.
As the code grows, functions and properties will become deprecated to keep the codebase tidy. When deprecating functions and properties, we will keep compatibility for a major version.
Example workflow for deprecating a function/property:
- Function is deprecated in version 1.5.0 but is made backwards compatible
- Warnings are issued in all following versions 1.x.x
- Functionality and warnings are removed in the next major version release 2.0.0
-
Make sure that the
tbx/
folder and all its subfolders are added to the MATLAB path. -
Load
build/Linear Assignment Cell Tracker.prj
in MATLAB's Toolbox Packager tool. -
Check that the folders
lap-tracker
anddocs
are shown under 'Toolbox Files and Folders'. -
Under 'Install Actions', make sure that the following folders are present in the 'MATLAB Path' frame:
<Toolbox Folder>
If these folders are missing, check that the
/tbx
folder and its subfolders are added to the path, then click on Reset to the current MATLAB path. -
Click on the Package button on the toolbar.
-
To test the package, remove the
tbx/
folder and all its subfolders. Then run the tests described in the section above.
As of v2.0.0, the tests are outdated so ignore this section for now. I am reconsidering how unit testing will work in the future. One approach is to avoid unit testing but to evaluate the code by comparing the output against a ground truth dataset.
To ensure compatibility, there are a number of tests that are included in the folder.
To run these tests, use
runtests('testing')
This project also uses tags to group tests into different categories. For more details, consult the Developer's Guide of the Wiki.
Release procedures:
- Check that all tests are running
- Check that all new methods and properties are properly documented
- Check that the wiki is up to date
- Merge the
dev
branch withmaster
git checkout master
git merge dev
-
Resolve any conflicts
-
Update the Toolbox Project file (*.prj) in the
build
folder:- The toolbox folder should be set to
tbx/
. - Increment the version number.
- Check that MATLAB path only contains entries starting with
<Toolbox Folder>
. This avoids unexpected external files to be included. - Check that there are no external files or Java JAR files included.
- Update the Platform and Release Compatibility fields as necessary.
- Package the toolbox and check that the code runs as expected.
- The toolbox folder should be set to
-
Add all files and commit to master
git add -A git commit -m "Updated build to v1.x.x"
-
Create a new tag
git tag -a "v1.x.x" -m "Date of release"
-
Push both the repository and the tag
git push origin master git push --tags
-
Create a Release on GitHub:
- Go to Repository > Tags and select Edit Release Notes (pencil This is not optional, it is how GitHub creates releases.
- Write the release notes. This should be bulleted list with short tags,
e.g.
* **New:** New features * **Fixed:** Fixed bugs * **Improvement:** Making something user friendly/more accurate
- Upload the packaged toolbox (*.mltbx).
- Save changes. The new release should now appear under Project Overview > Releases.