Skip to content

Commit

Permalink
Merge pull request #10 from Remi-Gau/lint
Browse files Browse the repository at this point in the history
[ENH] package and container
  • Loading branch information
Remi-Gau authored Sep 6, 2023
2 parents 2e6aac7 + c097a86 commit 957e01e
Show file tree
Hide file tree
Showing 14 changed files with 582 additions and 256 deletions.
23 changes: 23 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ignoring this might speed up build
# by preventing passing extra content to the docker daemon


# General
.DS_Store

.github
.vscode

**/data
**/docs
**/tests
**/*.zip
**/*.asc
**/*.edf
**/*.EDF

**/build
.pytest_cache
.mypy_cache
coverage_html
.coverage
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ docstring-convention = numpy
max-line-length = 90
max_complexity = 15
max_function_length = 100
per-file-ignores =
**/__init__.py: D104
# for compatibility with black
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
extend-ignore = E203
23 changes: 23 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: docker

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build docker image
run: docker build -t eye2bids:latest .
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ tests/data/test_data.zip
**/*.asc
**/*.edf
**/*.EDF
eye2bids/_version.py

# General
.DS_Store

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
110 changes: 110 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Generated by Neurodocker and Reproenv.

FROM ubuntu:22.04
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
curl \
gcc \
gnupg2 \
pip \
python3 \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*
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'
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
eyelink-display-software \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /eye2bids
COPY [".", \
"/eye2bids"]
WORKDIR /eye2bids
RUN pip install .[dev]

# Save specification to JSON.
RUN printf '{ \
"pkg_manager": "apt", \
"existing_users": [ \
"root" \
], \
"instructions": [ \
{ \
"name": "from_", \
"kwds": { \
"base_image": "ubuntu:22.04" \
} \
}, \
{ \
"name": "install", \
"kwds": { \
"pkgs": [ \
"gnupg2", \
"curl", \
"gcc", \
"ca-certificates", \
"software-properties-common", \
"python3", \
"pip" \
], \
"opts": null \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"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/*" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"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'"'"'" \
} \
}, \
{ \
"name": "install", \
"kwds": { \
"pkgs": [ \
"eyelink-display-software" \
], \
"opts": null \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"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/*" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "mkdir /eye2bids" \
} \
}, \
{ \
"name": "copy", \
"kwds": { \
"source": [ \
".", \
"/eye2bids" \
], \
"destination": "/eye2bids" \
} \
}, \
{ \
"name": "workdir", \
"kwds": { \
"path": "/eye2bids" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "pip install .[dev]" \
} \
} \
] \
}' > /.reproenv.json
# End saving to specification to JSON.
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.PHONY: Dockerfile

Dockerfile:
docker run --rm repronim/neurodocker:0.9.5 generate docker \
--pkg-manager apt \
--base-image ubuntu:22.04 \
--install gnupg2 curl gcc ca-certificates software-properties-common python3 pip \
--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'" \
--install eyelink-display-software \
--run "mkdir /eye2bids" \
--copy "." "/eye2bids" \
--workdir "/eye2bids" \
--run "pip install .[dev]" \
> Dockerfile

docker_build:
docker build -t eye2bids .

test_data:
python tools/download_test_data.py
74 changes: 68 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,80 @@
# eye2bids

## Instructions for testing conversion_json
## Installation

### Requirements

- edf file by EyeLink Eye Tracker
- Python3
- EyeLink Developers Kit. Download from [SR-Research support forum] (forum registration required)
- Python >= 3.8

If you want to use eye2bids to convert EyeLink data,
you will need to install the EyeLink Developers Kit.
It can be downloaded from SR-Research support forum (forum registration required).

The installation on Ubuntu can also be done with the following commands:

Taken from: https://www.sr-research.com/support/docs.php?topic=linuxsoftware

```bash
sudo add-apt-repository universe
sudo apt update
sudo apt install ca-certificates
sudo apt-key adv --fetch-keys https://apt.sr-research.com/SRResearch_key
sudo add-apt-repository 'deb [arch=amd64] https://apt.sr-research.com SRResearch main'
sudo apt update
sudo apt install eyelink-display-software
```

### Install eye2bids

- Clone the repository

```bash
git clone https://github.com/bids-standard/eye2bids.git
```

- Install the package in editatble mode

```bash
cd eye2bids
pip install .
```

## Using eye2bids

- Supporeted Input data:

- edf file by EyeLink Eye Tracker

To try it, you can install our test data from OSF by running the following command:

```bash
python tools/download_test_data.py
```

- manual_metadata.yml file (find template and an example in conversion_json folder)

### Run code

```
python3 edf2bids_json.py
```bash
python edf2bids_json.py
```

[SR-Research support forum]: https://www.sr-research.com/support/forum-9.html

## Docker

You can build the docker image with the following command:

```bash
docker build -t eye2bids:latest .
```

## Contributing

Make sure you install eye2bids in editable mode (see above) and install the development dependencies:

```bash
pip install --editable .[dev]
```

## Related projects
Loading

0 comments on commit 957e01e

Please sign in to comment.