diff --git a/.gitignore.txt b/.gitignore.txt new file mode 100644 index 0000000..ba95694 --- /dev/null +++ b/.gitignore.txt @@ -0,0 +1,153 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/python,vscode +# Edit at https://www.toptal.com/developers/gitignore?templates=python,vscode + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# 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/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +pytestdebug.log + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ +doc/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +pythonenv* + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# profiling data +.prof + +### vscode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# End of https://www.toptal.com/developers/gitignore/api/python,vscode \ No newline at end of file diff --git a/sagital_brain/__init__.py b/sagital_brain/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/sagital_brain.py b/sagital_brain/sagital_brain.py similarity index 100% rename from sagital_brain.py rename to sagital_brain/sagital_brain.py diff --git a/sagital_brain/tests/__init__.py b/sagital_brain/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/sagital_brain/tests/tests_sagital_brain.py b/sagital_brain/tests/tests_sagital_brain.py new file mode 100644 index 0000000..da8bf5e --- /dev/null +++ b/sagital_brain/tests/tests_sagital_brain.py @@ -0,0 +1,13 @@ +import numpy as np +import subprocess + +data_input = np.zeros((20, 20)) +data_input[-1, :] = 1 +np.savetxt("brain_sample.csv", data_input, fmt='%d', delimiter=',') +subprocess.run(["python3", "sagital_brain.py"]) + +result = np.loadtxt("brain_average.csv", delimiter=',') +expected = np.zeros(20) +expected[-1] = 1 + +np.testing.assert_array_equal(result,expected) \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..0ccf835 --- /dev/null +++ b/setup.py @@ -0,0 +1,7 @@ +from setuptools import setup, find_packages + +setup( + name="Sagital_brains", + version="0.1.0", + packages=find_packages(), +) \ No newline at end of file