Skip to content

Commit 957e01e

Browse files
authored
Merge pull request #10 from Remi-Gau/lint
[ENH] package and container
2 parents 2e6aac7 + c097a86 commit 957e01e

File tree

14 files changed

+582
-256
lines changed

14 files changed

+582
-256
lines changed

.dockerignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ignoring this might speed up build
2+
# by preventing passing extra content to the docker daemon
3+
4+
5+
# General
6+
.DS_Store
7+
8+
.github
9+
.vscode
10+
11+
**/data
12+
**/docs
13+
**/tests
14+
**/*.zip
15+
**/*.asc
16+
**/*.edf
17+
**/*.EDF
18+
19+
**/build
20+
.pytest_cache
21+
.mypy_cache
22+
coverage_html
23+
.coverage

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ docstring-convention = numpy
1111
max-line-length = 90
1212
max_complexity = 15
1313
max_function_length = 100
14+
per-file-ignores =
15+
**/__init__.py: D104
1416
# for compatibility with black
1517
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
1618
extend-ignore = E203

.github/workflows/docker.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: docker
3+
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.ref }}
6+
cancel-in-progress: true
7+
8+
on:
9+
push:
10+
branches: [main]
11+
pull_request:
12+
branches: [main]
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Clone
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
- name: Build docker image
23+
run: docker build -t eye2bids:latest .

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ tests/data/test_data.zip
22
**/*.asc
33
**/*.edf
44
**/*.EDF
5+
eye2bids/_version.py
6+
7+
# General
8+
.DS_Store
59

610
# Byte-compiled / optimized / DLL files
711
__pycache__/

Dockerfile

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Generated by Neurodocker and Reproenv.
2+
3+
FROM ubuntu:22.04
4+
RUN apt-get update -qq \
5+
&& apt-get install -y -q --no-install-recommends \
6+
ca-certificates \
7+
curl \
8+
gcc \
9+
gnupg2 \
10+
pip \
11+
python3 \
12+
software-properties-common \
13+
&& rm -rf /var/lib/apt/lists/*
14+
RUN apt-key adv --fetch-keys https://apt.sr-research.com/SRResearch_key && add-apt-repository 'deb [arch=amd64] https://apt.sr-research.com SRResearch main'
15+
RUN apt-get update -qq \
16+
&& apt-get install -y -q --no-install-recommends \
17+
eyelink-display-software \
18+
&& rm -rf /var/lib/apt/lists/*
19+
RUN mkdir /eye2bids
20+
COPY [".", \
21+
"/eye2bids"]
22+
WORKDIR /eye2bids
23+
RUN pip install .[dev]
24+
25+
# Save specification to JSON.
26+
RUN printf '{ \
27+
"pkg_manager": "apt", \
28+
"existing_users": [ \
29+
"root" \
30+
], \
31+
"instructions": [ \
32+
{ \
33+
"name": "from_", \
34+
"kwds": { \
35+
"base_image": "ubuntu:22.04" \
36+
} \
37+
}, \
38+
{ \
39+
"name": "install", \
40+
"kwds": { \
41+
"pkgs": [ \
42+
"gnupg2", \
43+
"curl", \
44+
"gcc", \
45+
"ca-certificates", \
46+
"software-properties-common", \
47+
"python3", \
48+
"pip" \
49+
], \
50+
"opts": null \
51+
} \
52+
}, \
53+
{ \
54+
"name": "run", \
55+
"kwds": { \
56+
"command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n ca-certificates \\\\\\n curl \\\\\\n gcc \\\\\\n gnupg2 \\\\\\n pip \\\\\\n python3 \\\\\\n software-properties-common \\\\\\n && rm -rf /var/lib/apt/lists/*" \
57+
} \
58+
}, \
59+
{ \
60+
"name": "run", \
61+
"kwds": { \
62+
"command": "apt-key adv --fetch-keys https://apt.sr-research.com/SRResearch_key && add-apt-repository '"'"'deb [arch=amd64] https://apt.sr-research.com SRResearch main'"'"'" \
63+
} \
64+
}, \
65+
{ \
66+
"name": "install", \
67+
"kwds": { \
68+
"pkgs": [ \
69+
"eyelink-display-software" \
70+
], \
71+
"opts": null \
72+
} \
73+
}, \
74+
{ \
75+
"name": "run", \
76+
"kwds": { \
77+
"command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n eyelink-display-software \\\\\\n && rm -rf /var/lib/apt/lists/*" \
78+
} \
79+
}, \
80+
{ \
81+
"name": "run", \
82+
"kwds": { \
83+
"command": "mkdir /eye2bids" \
84+
} \
85+
}, \
86+
{ \
87+
"name": "copy", \
88+
"kwds": { \
89+
"source": [ \
90+
".", \
91+
"/eye2bids" \
92+
], \
93+
"destination": "/eye2bids" \
94+
} \
95+
}, \
96+
{ \
97+
"name": "workdir", \
98+
"kwds": { \
99+
"path": "/eye2bids" \
100+
} \
101+
}, \
102+
{ \
103+
"name": "run", \
104+
"kwds": { \
105+
"command": "pip install .[dev]" \
106+
} \
107+
} \
108+
] \
109+
}' > /.reproenv.json
110+
# End saving to specification to JSON.

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.PHONY: Dockerfile
2+
3+
Dockerfile:
4+
docker run --rm repronim/neurodocker:0.9.5 generate docker \
5+
--pkg-manager apt \
6+
--base-image ubuntu:22.04 \
7+
--install gnupg2 curl gcc ca-certificates software-properties-common python3 pip \
8+
--run "apt-key adv --fetch-keys https://apt.sr-research.com/SRResearch_key && add-apt-repository 'deb [arch=amd64] https://apt.sr-research.com SRResearch main'" \
9+
--install eyelink-display-software \
10+
--run "mkdir /eye2bids" \
11+
--copy "." "/eye2bids" \
12+
--workdir "/eye2bids" \
13+
--run "pip install .[dev]" \
14+
> Dockerfile
15+
16+
docker_build:
17+
docker build -t eye2bids .
18+
19+
test_data:
20+
python tools/download_test_data.py

README.md

Lines changed: 68 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,80 @@
11
# eye2bids
22

3-
## Instructions for testing conversion_json
3+
## Installation
44

55
### Requirements
66

7-
- edf file by EyeLink Eye Tracker
8-
- Python3
9-
- EyeLink Developers Kit. Download from [SR-Research support forum] (forum registration required)
7+
- Python >= 3.8
8+
9+
If you want to use eye2bids to convert EyeLink data,
10+
you will need to install the EyeLink Developers Kit.
11+
It can be downloaded from SR-Research support forum (forum registration required).
12+
13+
The installation on Ubuntu can also be done with the following commands:
14+
15+
Taken from: https://www.sr-research.com/support/docs.php?topic=linuxsoftware
16+
17+
```bash
18+
sudo add-apt-repository universe
19+
sudo apt update
20+
sudo apt install ca-certificates
21+
sudo apt-key adv --fetch-keys https://apt.sr-research.com/SRResearch_key
22+
sudo add-apt-repository 'deb [arch=amd64] https://apt.sr-research.com SRResearch main'
23+
sudo apt update
24+
sudo apt install eyelink-display-software
25+
```
26+
27+
### Install eye2bids
28+
29+
- Clone the repository
30+
31+
```bash
32+
git clone https://github.com/bids-standard/eye2bids.git
33+
```
34+
35+
- Install the package in editatble mode
36+
37+
```bash
38+
cd eye2bids
39+
pip install .
40+
```
41+
42+
## Using eye2bids
43+
44+
- Supporeted Input data:
45+
46+
- edf file by EyeLink Eye Tracker
47+
48+
To try it, you can install our test data from OSF by running the following command:
49+
50+
```bash
51+
python tools/download_test_data.py
52+
```
53+
1054
- manual_metadata.yml file (find template and an example in conversion_json folder)
1155

1256
### Run code
1357

14-
```
15-
python3 edf2bids_json.py
58+
```bash
59+
python edf2bids_json.py
1660
```
1761

1862
[SR-Research support forum]: https://www.sr-research.com/support/forum-9.html
63+
64+
## Docker
65+
66+
You can build the docker image with the following command:
67+
68+
```bash
69+
docker build -t eye2bids:latest .
70+
```
71+
72+
## Contributing
73+
74+
Make sure you install eye2bids in editable mode (see above) and install the development dependencies:
75+
76+
```bash
77+
pip install --editable .[dev]
78+
```
79+
80+
## Related projects

0 commit comments

Comments
 (0)