Skip to content

Commit a411815

Browse files
committed
Merge remote-tracking branch 'origin/main' into test_edfapi_not_installed
I had to resolve the new directory structure on main ( src/eyelinkio ) with my renaming of modules in this PR (i.e. eyelinkio/read.py )
2 parents 1be85d2 + 7f5e2e5 commit a411815

35 files changed

+312
-135
lines changed

.circleci/config.yml

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
version: 2.1
22

3+
4+
orbs:
5+
win: circleci/[email protected] # The Windows orb gives you everything you need to start using the Windows executor
6+
37
jobs:
4-
test:
8+
Test-Installed-SDK:
59
docker:
610
- image: circleci/python:3.10
711

@@ -21,12 +25,54 @@ jobs:
2125
sudo ldconfig
2226
python -m pip install --upgrade pip
2327
pip install -e ".[dev]"
28+
- run:
29+
name: Set environment variables
30+
command: |
31+
export EYELINKIO_USE_INSTALLED_EDFAPI=true
2432
2533
- run:
2634
name: Run tests
2735
command: |
2836
pytest
2937
38+
test-macos:
39+
macos:
40+
xcode: 14.2.0
41+
steps:
42+
- checkout
43+
44+
- run:
45+
name: Install dependencies
46+
command: |
47+
python -m pip install --upgrade pip
48+
pip install -e ".[dev]"
49+
- run:
50+
name: Set environment variables
51+
command: |
52+
export EYELINKIO_USE_INSTALLED_EDFAPI=false
53+
- run:
54+
name: Run tests
55+
command: |
56+
pytest
57+
58+
test-windows:
59+
executor: win/server-2022
60+
steps:
61+
- checkout
62+
- run:
63+
name: Install dependencies
64+
command: |
65+
python -m pip install --upgrade pip
66+
pip install -e ".[dev]"
67+
- run:
68+
name: Set environment variables
69+
command: |
70+
set EYELINKIO_USE_INSTALLED_EDFAPI=false
71+
- run:
72+
name: Run tests
73+
command: |
74+
pytest
75+
3076
build-docs:
3177
docker:
3278
- image: circleci/python:3.10
@@ -35,14 +81,6 @@ jobs:
3581
- run:
3682
name: Install dependencies
3783
command: |
38-
sudo apt-get update
39-
sudo apt install software-properties-common
40-
sudo apt-get update
41-
sudo add-apt-repository "deb http://download.sr-support.com/software SRResearch main"
42-
wget -O - "http://download.sr-support.com/software/SRResearch_key" | sudo apt-key add -
43-
sudo apt-get update
44-
sudo apt-get install eyelink-edfapi
45-
sudo ldconfig
4684
python -m pip install --upgrade pip
4785
pip install -e ".[dev]"
4886
- run:
@@ -79,11 +117,13 @@ workflows:
79117
version: 2
80118
test:
81119
jobs:
82-
- test
120+
- Test-Installed-SDK
83121
- build-docs
122+
- test-macos
123+
- test-windows
84124
- docs-deploy:
85125
requires:
86-
- test
126+
- Test-Installed-SDK
87127
- build-docs
88128
filters:
89129
branches:

.github/workflows/tests.yaml renamed to .github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
with:
2222
python-version: '3.11'
2323
- run: pip install -e ".[dev]"
24-
- run: ruff check eyelinkio
24+
- run: ruff check src/eyelinkio

.github/workflows/test.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Run Tests (No SDK)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os:
17+
- ubuntu-latest
18+
- macos-latest # Latest Apple Silicon macOS
19+
- macos-13 # Latest Intel-based macOS
20+
- windows-latest
21+
python-version: ['3.10']
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
python -m pip install -e ".[dev]"
35+
36+
- name: Set environment variables On macOS and Linux
37+
if: runner.os != 'Windows'
38+
run: |
39+
export EYELINKIO_USE_INSTALLED_EDFAPI=false
40+
41+
- name: Run tests
42+
run: pytest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ __pycache__/
88

99
# C extensions
1010
*.so
11+
# Except for the following files
12+
!libedfapi/linux/libedfapi.so
1113

1214
# Distribution / packaging
1315
.Python

LICENSE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
This license applies only to the code in `src/eyelinkio`. Files, code, and assets in `src/libedfapi` are explicitly excluded. All Files, code, and assets in `src/libedfapi` belong to SR Research Ltd. Copyright (c) 1996-2023, All Rights Reserved.
2+
13
BSD 3-Clause License
24

35
Copyright (c) 2024, Scott Huberty

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
recursive-include src *
2+
recursive-exclude tests *

README.md

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
1+
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/scott-huberty/eyelinkio/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/scott-huberty/eyelinkio/tree/main)
2+
[![PyPI version](https://badge.fury.io/py/eyelinkio.svg)](https://badge.fury.io/py/eyelinkio)
3+
[![PyPI Download count](https://static.pepy.tech/badge/eyelinkio)](https://pepy.tech/project/eyelinkio)
4+
15
# EyeLinkIO 👀
26

37
A lightweight library to import SR Research EDF files into Python.
48

5-
**This Software is currenly pre-alpha, meaning it is currently being developed**: Changes to the API (function names, etc.) may occur without warning. This library has been tested with MacOS and Linux, but not Windows.
9+
**This Software is currenly pre-alpha, meaning it is currently being developed**: Changes to the API (function names, etc.) may occur without warning.
610

711
## About the Eyelink Data Format
812

9-
The EyeLink Data Format (EDF; not to be confused with the [European Data Format](<https://www.edfplus.info>)) is used for storing eyetracking data from EyeLink eyetrackers. It was put forward by the company [SR Research](<https://www.sr-research.com>). SR Research EDF files store data in a binary format, and reading these files currently requires the ``eyelink-edfapi`` C library that is included in the EyeLink Software Development Kit.
13+
The EyeLink Data Format (EDF; not to be confused with the
14+
[European Data Format](<https://www.edfplus.info>)) is used for storing eyetracking data
15+
from EyeLink eyetrackers. It was put forward by the company
16+
[SR Research](<https://www.sr-research.com>). SR Research EDF files store data in a
17+
binary format, and reading these files requires interfacing with ``eyelink-edfapi`` C
18+
library that is typically included in the EyeLink Software Development Kit. EyeLinkIO
19+
Includes the necessary binaries to read EDF files, but can also be configured to use the
20+
EDF API library that is installed on your computer.
1021

1122
## Dependencies
1223

1324
Strictly speaking, EyeLinkIO only requires Numpy. For converting data to pandas ``DataFrames`` or MNE-Python ``Raw`` instances, you must have those respective packages installed.
1425

15-
> [!IMPORTANT]
16-
> - You must have the [EyeLink Software Development Kit](<https://www.sr-research.com/support/forum-3.html>) installed on your computer
17-
> - You must register an account on the forum to access the download (registration is free)
26+
> [!NOTE]
27+
>
28+
> - EyeLinkIO includes the Eyelink EDF API binary files that are needed to read EDF files.
29+
> - [See](#using-the-eyelink-developers-kit-edf-api-to-read-edf-files) If you want to use the EyeLink Developers Kit's EDF API library that is installed on your computer.
1830
1931
## Installation
2032

@@ -39,9 +51,11 @@ pip install -e ./eyelinkio
3951
```
4052

4153
> [!IMPORTANT]
54+
> To use the editable installation, you should:
55+
>
4256
>- Fork the repository on GitHub first.
4357
>- Clone your forked repository to your local machine.
44-
>- Make sure you're in the directory *containing* the cloned `eyelinkio` folder when you run the command above
58+
>- Make sure you're in the directory *containing* the cloned `eyelinkio` folder when you run the command provided above
4559
4660
This package is not currently available on Conda.
4761

@@ -108,6 +122,30 @@ raw, calibration = edf_file.to_mne()
108122

109123
See the [documentation](https://scott-huberty.github.io/eyelinkio/) for more.
110124

125+
#### Using The EyeLink Developers Kit (EDF API) to read EDF files
126+
127+
EyeLinkIO includes the Eyelink EDF API binary files that are needed to read EDF files,
128+
and by default it will rely on these files when reading reading your EDF files. However,
129+
if you have the
130+
[Eyelink Developers Kit](https://www.sr-research.com/support/forum-9.html)
131+
installed on your computer, you can explicitly direct
132+
EyeLinkIO to rely on the EDF API library that is included in the EyeLink Developers Kit,
133+
by setting the environment variable `EYELINKIO_USE_INSTALLED_EDFAPI` to `true` *before*
134+
importing the package:
135+
136+
```python
137+
import os
138+
os.environ["EYELINKIO_USE_INSTALLED_EDFAPI"] = "true"
139+
140+
import eyelinkio
141+
edf = eyelinkio.read_edf("path/to/edf/file")
142+
```
143+
144+
> [!NOTE]
145+
>
146+
> - First download the [EyeLink Software Development Kit](<https://www.sr-research.com/support/forum-3.html>)
147+
> - You must register an account on the forum to access the download (registration is free)
148+
111149
## Acknowledgements
112150

113151
This package was originally adapted from the [pyeparse](<https://github.com/pyeparse/pyeparse>) package (created by several of the core developers of [MNE-Python](<https://mne.tools/dev/index.html>)). It copies much of the EDF (Eyelink Data Format) reading code.

docs/changes/devel.rst

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
11
.. _Scott Huberty: https://github.com/scott-huberty
22
.. _Thinh Nguyen: https://github.com/ttngu207
3+
.. _Will Foran: https://github.com/WillForan
4+
5+
6+
0.3 (2024-12-12) 📦
7+
===================
8+
9+
Bugfixes 🐞
10+
-----------
11+
12+
- Improved error message handling in the case that the EyeLink EDF API is not available. By `Will Foran`_ (`#11 <https://github.com/scott-huberty/eyelinkio/pull/11>`__)
13+
14+
15+
New features 🚀
16+
---------------
17+
18+
- You can now load EDF files without needing to install the EyeLink Developers Kit. By `Scott Huberty`_ (`#14 <https://github.com/scott-huberty/eyelinkio/pull/14>`__)
19+
- Added Continuous Integration (CI) testing for Windows and MacOS. By `Scott Huberty`_ (`#14 <https://github.com/scott-huberty/eyelinkio/pull/14>`__)
20+
321

422
0.2.0 (2024-08-01) 📦
523
=====================
624

725
New features 🚀
826
---------------
927

10-
- Added support for reading binocular data by `Scott Huberty`_ and `Thinh Nguyen`_. (`#5 <https://github.com/scott-huberty/eyelinkio/pulls/5>`__)
28+
- Added support for reading binocular data by `Scott Huberty`_ and `Thinh Nguyen`_. (`#5 <https://github.com/scott-huberty/eyelinkio/pull/5>`__)
1129

12-
- Setup a changelog, using `towncrier <https://towncrier.readthedocs.io/en/stable/index.html>`_. by `Scott Huberty`_ (`#6 <https://github.com/scott-huberty/eyelinkio/pulls/6>`__)
30+
- Setup a changelog, using `towncrier <https://towncrier.readthedocs.io/en/stable/index.html>`_. by `Scott Huberty`_ (`#6 <https://github.com/scott-huberty/eyelinkio/pull/6>`__)
1331

1432

1533
Bugfixes 🐞

docs/changes/devel/5.newfeature.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/changes/devel/6.newfeature.rst

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)