Skip to content

Commit c14ea09

Browse files
committed
Merge branch 'master' into Multicompartment_Connection
# Conflicts: # bindsnet/datasets/collate.py # bindsnet/network/monitors.py # bindsnet/network/topology.py # bindsnet/pipeline/base_pipeline.py # requirements.txt # setup.py
2 parents 88cf538 + d34d9d1 commit c14ea09

File tree

97 files changed

+9944
-1324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+9944
-1324
lines changed

.github/workflows/python-app.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: BindsNET build status
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up Python 3.9
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: 3.9
23+
- name: Install Poetry
24+
env:
25+
POETRY_VERSION: 1.5.1
26+
run: |
27+
curl -sSL https://install.python-poetry.org | python - -y &&\
28+
poetry config virtualenvs.create false
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install flake8 pytest
33+
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
34+
poetry install
35+
- name: Lint with flake8
36+
run: |
37+
# stop the build if there are Python syntax errors or undefined names
38+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
39+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
40+
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41+
- name: Test with pytest
42+
run: |
43+
pytest

.github/workflows/pythonpackage.yml

+10-8
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,26 @@ jobs:
99
strategy:
1010
max-parallel: 4
1111
matrix:
12-
python-version: [3.6, 3.7, 3.8]
12+
python-version: ["3.9", "3.10", "3.11"]
1313

1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
- name: Set up Python ${{ matrix.python-version }}
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v4
1818
with:
1919
python-version: ${{ matrix.python-version }}
20+
- name: Install Poetry
21+
env:
22+
POETRY_VERSION: 1.5.1
23+
run: |
24+
curl -sSL https://install.python-poetry.org | python - -y &&\
25+
poetry config virtualenvs.create false
2026
- name: Install dependencies
2127
run: |
22-
python -m pip install --upgrade pip
23-
pip install -r requirements.txt
24-
pip install . --progress-bar off
28+
poetry install
2529
- name: Format with black
2630
run: |
27-
pip install black
2831
black .
2932
- name: Test with pytest
3033
run: |
31-
pip install pytest
3234
pytest

.gitignore

+24-131
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,24 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
3-
*.py[cod]
4-
*$py.class
5-
6-
# C extensions
7-
*.so
8-
9-
# Distribution / packaging
10-
.Python
11-
env/
12-
build/
13-
develop-eggs/
14-
dist/
15-
downloads/
16-
eggs/
17-
.eggs/
18-
lib/
19-
lib64/
20-
parts/
21-
sdist/
22-
var/
23-
wheels/
24-
*.egg-info/
25-
.installed.cfg
26-
*.egg
27-
28-
# PyInstaller
29-
# Usually these files are written by a python script from a template
30-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31-
*.manifest
32-
*.spec
33-
34-
# Installer logs
35-
pip-log.txt
36-
pip-delete-this-directory.txt
37-
38-
# Unit test / coverage reports
39-
htmlcov/
40-
.tox/
41-
.coverage
42-
.coverage.*
43-
.cache
44-
nosetests.xml
45-
coverage.xml
46-
*.cover
47-
.hypothesis/
48-
49-
# Translations
50-
*.mo
51-
*.pot
52-
53-
# Django stuff:
54-
*.log
55-
local_settings.py
56-
57-
# Flask stuff:
58-
instance/
59-
.webassets-cache
60-
61-
# Scrapy stuff:
62-
.scrapy
63-
64-
# Sphinx documentation
65-
docs/_build/
66-
67-
# PyBuilder
68-
target/
69-
70-
# Jupyter Notebook
71-
.ipynb_checkpoints
72-
73-
# pyenv
74-
.python-version
75-
76-
# celery beat schedule file
77-
celerybeat-schedule
78-
79-
# SageMath parsed files
80-
*.sage.py
81-
82-
# dotenv
83-
.env
84-
85-
# virtualenv
86-
.venv
87-
venv/
88-
ENV/
89-
90-
# Spyder project settings
91-
.spyderproject
92-
.spyproject
93-
94-
# Rope project settings
95-
.ropeproject
96-
97-
# mkdocs documentation
98-
/site
99-
100-
# mypy
101-
.mypy_cache/
102-
103-
# Datasets.
104-
data/
105-
!data/get_MNIST.sh
106-
107-
# LSM data.
108-
lsm/
109-
110-
# Results from network monitoring test.
111-
results/
112-
113-
# Results from network monitoring test.
114-
examples/saved_checkpoints
115-
116-
# pytest cache
117-
.pytest_cache/
118-
119-
# Swap files.
120-
*.swp
121-
122-
# PyCharm project folder.
123-
.idea/
124-
125-
# macOS
126-
.DS_Store
127-
128-
figures/
129-
130-
# Analyzer log default directory.
131-
logs/
1+
bindsnet/__pycache__/*
2+
bindsnet/analysis/__pycache__/*
3+
bindsnet/conversion/__pycache__/*
4+
bindsnet/datasets/__pycache__/*
5+
bindsnet/environment/__pycache__/*
6+
bindsnet/evaluation/__pycache__/*
7+
bindsnet/learning/__pycache__/*
8+
bindsnet/encoding/__pycache__/*
9+
bindsnet/models/__pycache__/*
10+
bindsnet/network/__pycache__/*
11+
bindsnet/pipeline/__pycache__/*
12+
bindsnet/preprocessing/__pycache__/*
13+
test/analysis/__pycache__/*
14+
test/conversion/__pycache__/*
15+
test/encoding/__pycache__/*
16+
test/import/__pycache__/*
17+
test/models/__pycache__/*
18+
test/network/__pycache__/*
19+
test/analysis/__pycache__/*
20+
dist/*
21+
logs/*
22+
.pytest_cache/*
23+
.vscode/*
24+
data/*

.pre-commit-config.yaml

-6
This file was deleted.

.readthedocs.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Set the version of Python and other tools you might need
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.11"
13+
14+
# Build documentation in the docs/ directory with Sphinx
15+
sphinx:
16+
builder: html
17+
configuration: docs/source/conf.py
18+
19+
formats:
20+
- epub
21+
- pdf
22+
23+
# We recommend specifying your dependencies to enable reproducible builds:
24+
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
25+
python:
26+
install:
27+
- requirements: docs/requirements.txt
28+
- method: pip
29+
path: docs/
30+
# extra_requirements:
31+
# - docs
32+
33+
# python:
34+
# version: 3.8
35+
# install:
36+
# - method: pip
37+
# path: .
38+
# - requirements: docs/requirements.txt
39+
# system_packages: False

.travis.yml

-10
This file was deleted.

CONTRIBUTING.md

+33-9
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,45 @@
22

33
To clone this project locally, issue
44

5-
```
5+
```shell
66
git clone https://github.com/Hananel-Hazan/bindsnet.git # clones bindsnet repository
77
```
88

99
in the directory of your choice. This will place the repository's code in a directory titled `bindsnet`.
1010

11-
All development should take place on a branch separate from master. To create a branch, issue
11+
Install the project with [Poetry](https://python-poetry.org/) (current supported version - 1.1.8)
12+
13+
```shell
14+
poetry install
15+
poetry run pre-commit install
16+
```
17+
1218

19+
Now you can access the project environment with `poetry shell` or run commands with `poetry run <command>`. For example, `poetry run python examples/mnist/conv_mnist.py`.
20+
21+
Please make sure the `Poetry` environment is activated when you commit your files! The `git commit` command will invoke `pre-commit`, which is installed with Poetry too. IDEs like PyCharm have plugins for `Poetry` and will activate the environment automatically.
22+
23+
Run the tests, they all should pass
24+
25+
```shell
26+
poetry run pytest
1327
```
28+
29+
All development should take place on a branch separate from master. To create a branch, issue
30+
31+
```shell
1432
git branch [branch-name] # create new branch
1533
```
1634

1735
replacing `[branch-name]` with a simple and memorable name of choice; e.g., `git branch dan`. Switch to the newly created branch using
1836

19-
```
37+
```shell
2038
git checkout [branch-name] # switch to a different branch of the repository
2139
```
2240

2341
__Note__: Issue `git branch` with no arguments to list all branches currently being tracked, with an asterisk next to the currently used branch; e.g.,
2442

25-
```
43+
```shell
2644
$ git branch # list all branches and indicate current branch
2745
* dan
2846
devel
@@ -34,40 +52,46 @@ If new branches have been created on the remote repository, you may start tracki
3452

3553
After making changes to the repository, issue a `git status` command to see which files have been modified. Then, use
3654

37-
```
55+
```shell
3856
git add [file-name(s) | -A] # add modified or newly created files
3957
```
4058

4159
to add one or more modified files (`file-name(s)`), or all modified files (`-A` or `--all`). These include newly created files. Issue
4260

61+
```shell
62+
pre-commit run -a
4363
```
64+
65+
to run the `pre-commit` tool that will automatically format your code with `black`. Issue
66+
67+
```shell
4468
git commit -m "[commit-message]" # Useful messages help when reverting / searching through history
4569
```
4670

4771
to "commit" your changes to your local repository, where `[commit-message]` is a _short yet descriptive_ note about what changes have been made.
4872

4973
Before pushing your changes to the remote repository, you must make sure that you have an up-to-date version of the `master` code. That is, if master has been updated while you have been making your changes, your code will be out of date with respect to the master branch. Issue
5074

51-
```
75+
```shell
5276
git pull # gets all changes from remote repository
5377
git merge master # merges changes made in master branch with those made in your branch
5478
```
5579

5680
and fix any merge conflicts that may have resulted, and re-commit after the fix with
5781

58-
```
82+
```shell
5983
git commit # no -m message needed; merge messages are auto-generated
6084
```
6185

6286
Push your changes back to the repository onto the same branch you are developing on. Issue
6387

64-
```
88+
```shell
6589
git push [origin] [branch-name] # verbose; depends on push.default behavior settings
6690
```
6791

6892
or,
6993

70-
```
94+
```shell
7195
git push # concise; again, depends on push.default behavior
7296
```
7397

0 commit comments

Comments
 (0)