Adding Cortex Features
Cortex is an open source analysis package. If you would like to contribute your own features, you may open a pull request.
How to add a new feature:
-
Clone LAMP-cortex from source.
git clone https://github.com/BIDMCDigitalPsychiatry/LAMP-cortex.git
-
Make sure you are on the master branch (and it is up to date). Create a new branch.
Github commands
git checkout master git pull git checkout -b my_new_feature
-
Write your code.
-
Add your file to run_pylint.sh to make sure you are following the python style guidelines. Please include good comments and docstrings.
-
Add unit tests for your code to the /tests folder. Add your file to run_tests.sh to show code coverage. Please note that if you are not a BIDMC user the existing tests will not work as you do not have access to our data. However, this code can be used as an example for testing your own code.
-
Add any new dependencies to pyproject.toml (if applicable).
-
Push your code.
Github commands
git add . git commit -m "i added a cool feature" git push --set-upstream origin my_new_feature
-
When you are ready, create a pull request (PR). Assign yourself, and assign someone from our team as a reviewer. At least one person must review and approve your code for it to be merged into master.
- When we review your code, we will run the unittests, test any new features, and check code for style. We may suggest changes or additions that we feel improve the code or integration with Cortex.
-
Along with your PR to cortex, you must add documentation for your code. This is very important to allow others to understand how to use your code.
- Your feature should be added as a new markdown file to the appropriate folder here: https://github.com/BIDMCDigitalPsychiatry/LAMP-platform/tree/master/docs/09-data_science/06-cortex. Please follow the example structure of other files in the documentation.
- Create a PR for your documentation. A Github action will run when new docs are edited to publish to https://docs.lamp.digital/.
-
Once the PR is merged, make sure you switch back to master and pull your changes. You can also delete the local copy of your branch if you wish.
Github commands
git checkout master git pull git branch -d my_new_feature