-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Yambottle/main
Initial OOP design
- Loading branch information
Showing
17 changed files
with
770 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
classdef CatGT < src.jobs.JobBase | ||
%CatGT Summary of this class goes here | ||
% Detailed explanation goes here | ||
|
||
properties | ||
job_info | ||
input | ||
output | ||
end | ||
|
||
methods | ||
function obj = CatGT(job_info, input) | ||
obj.job_info = job_info; | ||
obj.input = input; | ||
end | ||
|
||
function obj = execute(obj) | ||
disp(obj.job_info); | ||
end | ||
end | ||
end | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
classdef (Abstract) JobBase < handle | ||
%JOBBASE Summary of this class goes here | ||
% Detailed explanation goes here | ||
|
||
properties (Abstract) | ||
job_info | ||
input | ||
output | ||
end | ||
|
||
methods (Abstract) | ||
execute(obj) | ||
end | ||
end | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
classdef KiloSort < src.jobs.JobBase | ||
%KiloSort Summary of this class goes here | ||
% Detailed explanation goes here | ||
|
||
properties | ||
job_info | ||
input | ||
output | ||
end | ||
|
||
methods | ||
function obj = KiloSort(job_info, input) | ||
obj.job_info = job_info; | ||
obj.input = input; | ||
end | ||
|
||
function obj = execute(obj) | ||
disp(obj.job_info); | ||
end | ||
end | ||
end | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
classdef Config < handle | ||
%RunSpec Summary of this class goes here | ||
% Detailed explanation goes here | ||
|
||
properties | ||
run_name | ||
gate_index | ||
concat_trigger | ||
probes | ||
brain_regions | ||
end | ||
|
||
methods | ||
function obj=Config() | ||
end | ||
end | ||
end | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
classdef Pipeline < handle | ||
%Pipeline Summary of this class goes here | ||
% Detailed explanation goes here | ||
|
||
properties | ||
current_stage | ||
stages | ||
end | ||
|
||
methods | ||
function obj = Pipeline() | ||
obj.current_stage = -1; | ||
obj.stages = {}; | ||
end | ||
|
||
function execute(obj) | ||
% stages have to run in sequence, because of result dependency | ||
for stage = obj.stages | ||
curr = stage{:}; | ||
obj.current_stage = curr; | ||
disp(obj.current_stage.stage_info); | ||
curr.execute(); | ||
end | ||
end | ||
end | ||
end | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
classdef Stage < handle | ||
%Stage Summary of this class goes here | ||
% Detailed explanation goes here | ||
|
||
properties | ||
stage_info | ||
current_job | ||
job_queue | ||
end | ||
|
||
methods | ||
function obj = Stage(stage_info) | ||
obj.stage_info = stage_info; | ||
obj.job_queue = {}; | ||
end | ||
function obj = execute(obj) | ||
% TODO - jobs can run in parallel | ||
for job = obj.job_queue | ||
curr = job{:}; | ||
curr.execute(); | ||
end | ||
end | ||
end | ||
end | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
classdef Utils | ||
%Utils Summary of this class goes here | ||
% Detailed explanation goes here | ||
|
||
methods(Static) | ||
function config = load_json(fpath) | ||
fid = fopen(fpath); | ||
raw = fread(fid,inf); | ||
config = char(raw'); | ||
fclose(fid); | ||
disp(config) % debug | ||
config = jsondecode(config); | ||
end | ||
end | ||
end | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Python | ||
# Sphinx gallery temp dir | ||
docs/auto_examples/ | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
test_data/ | ||
cached_data/ | ||
.pytest_cache/ | ||
test-reports/ | ||
.venv/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# pyenv python configuration file | ||
.python-version | ||
|
||
# ide specific | ||
.idea/ | ||
.history/ | ||
.vscode/ | ||
|
||
# matlab | ||
*.mat | ||
*.asv | ||
|
||
# virtual environment | ||
.venv/ | ||
|
||
# macOS | ||
.DS_Store | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
# neuropixels-toolkit | ||
(Under construction) Neuropixel Toolkit is a set of unified Matlab tools for manipulating Neuropixel and Kilosort datasets | ||
|
||
## Usecase Diagram | ||
![Here should be a usecase diagram](docs/usecase_diagram.drawio.png) | ||
|
||
## Class Diagram | ||
![Here should be a class diagram](docs/class_diagram.drawio.png) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": "v0.0.1", | ||
"type": "text/json", | ||
"CatGT": { | ||
"v1": 1, | ||
"v2": 2 | ||
}, | ||
"KiloSort": { | ||
"v1": 123, | ||
"v2": 345, | ||
"v3": 109 | ||
} | ||
} |
Oops, something went wrong.