Skip to content

Commit

Permalink
Merge branch 'BrkRaw:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
dvm-shlee authored Jan 31, 2024
2 parents fe50790 + 3369ca6 commit f69dc88
Show file tree
Hide file tree
Showing 18 changed files with 313 additions and 128 deletions.
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.github

*.pyc

env

**/__pycache__
**/.pytest_cache

.idea/**

**/dist
**/build
**/*.egg-info*

tests/*
paper

.DS_Store
10 changes: 10 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[flake8]
exclude =
.git,
__pycache__,
build,
dist,
env,
venv,
max-line-length = 127
max-complexity=10
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# Documentation
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
25 changes: 13 additions & 12 deletions .github/workflows/autotest.yml → .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
name: CI workflow
name: flake8

on:
# this workflow triggered on below condition [push, pull_request]
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ '*' ]

# cancel previous similar workflow runs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install flake8
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/main.yml

This file was deleted.

81 changes: 81 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: test

on:
# this workflow triggered on below condition [push, pull_request]
push:
branches: [ main ]
pull_request:
branches: [ "*" ]

# cancel previous similar workflow runs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test_cli:

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

runs-on: ${{ matrix.os }}

steps:

- uses: actions/checkout@v4

- name: Set up python ${{ matrix.python-version }}

uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install package
run: |
python -m pip install --upgrade pip
pip install .
- name: Version and help
run: |
brkraw --version
brkraw --help
- name: "smoke end-to-end test: use CLI on tutorial data"
run: make demo


test_tutorial:

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

runs-on: ${{ matrix.os }}

steps:

- uses: actions/checkout@v4

- name: Set up python ${{ matrix.python-version }}

uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Install tutorial
run: make tests/tutorials

- name: Test tutorial notebook
run: |
python -m pytest --nbmake tests/tutorials/JupyterNotebooks/01_GettingStarted.ipynb
tree tests/tutorials/raw
24 changes: 24 additions & 0 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: validation

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

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

jobs:

validate_cff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check whether the citation metadata from CITATION.cff is valid
uses: citation-file-format/cffconvert-github-action@2.0.0
with:
args: --validate

5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ ui/styles/*.css
dist
build
*.pid
test
test/*
*.egg-info
*.egg-info/*
.DS_Store
.DS_Store
tests/tutorials
49 changes: 49 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cff-version: 1.2.0

title: "brkraw"

version: "0.3.10"

abstract: Bruker PvDataset Loader

message: "If you use this software, please cite it as below."

repository-code: "https://github.com/BrkRaw/brkraw"

identifiers:
- description: This is the collection of archived snapshots of all releases
type: doi
value: "10.5281/zenodo.245546149"

contact:
- email: shlee@unc.edu
family-names: SungHo
given-names: Lee

authors:
- email: shlee@unc.edu
family-names: SungHo
given-names: Lee

- email: banwoomi@unc.edu
family-names: Woomi
given-names: Ban

- family-names: Dumas
given-names: Jaiden

- family-names: Devenyi
given-names: Gabriel A.

- email: shihy@neurology.unc.edu
family-names: Yen-Yu
given-names: Ian Shih

license: GPL-3.0

keywords:
- bruker
- data_handler
- converter
- administrator_tool
- brain imaging data structure
File renamed without changes.
17 changes: 0 additions & 17 deletions CONTRIBUTING

This file was deleted.

18 changes: 16 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
Here is how to contribute.
# Contributing

TODO:
When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Pull Request Process

1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Update the README.md with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
3. Increase the version numbers in any examples files and the README.md to the new version that this
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
do not have permission to do that, you may request the second reviewer to merge it for you.
4 changes: 2 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# This docker file build a editable image.
# You could directly edit the source code at `/home/brkraw to make changes. Or you could mount your brkraw code folder to /home/brkraw

FROM python:3.7
FROM python:3.11
WORKDIR /home
RUN mkdir ./brkraw
WORKDIR /home/brkraw
COPY . .
RUN python -m pip install -e /home/brkraw
RUN python -m pip install --editable /home/brkraw
RUN mkdir /data
WORKDIR /data

Expand Down
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
clean:
rm -rf tests/tutorials

tests/tutorials:
git clone https://github.com/BrkRaw/tutorials.git tests/tutorials

tests/tutorials/SampleData/20190724_114946_BRKRAW_1_1: tests/tutorials
unzip -uq tests/tutorials/SampleData/20190724_114946_BRKRAW_1_1.zip -d tests/tutorials/SampleData/

tests/tutorials/bids_map.csv: tests/tutorials/SampleData/20190724_114946_BRKRAW_1_1
brkraw bids_helper tests/tutorials/SampleData/20190724_114946_BRKRAW_1_1 \
tests/tutorials/bids_map

tests/tutorials/raw: tests/tutorials/bids_map.csv
brkraw bids_convert tests/tutorials/SampleData/20190724_114946_BRKRAW_1_1 \
tests/tutorials/bids_map.csv \
--output tests/tutorials/raw

demo: tests/tutorials
brkraw info tests/tutorials/SampleData/20190724_114946_BRKRAW_1_1.zip
make tests/tutorials/raw
4 changes: 2 additions & 2 deletions brkraw/lib/pvobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def _update_studyinfo(self):
subject = self._subject
self.user_account = subject.headers['OWNER']
self.subj_id = get_value(subject, 'SUBJECT_id')
self.study_id = get_value(subject, 'SUBJECT_study_nr')
self.session_id = get_value(subject, 'SUBJECT_study_name')
self.study_id = get_value(subject, 'SUBJECT_study_name')
self.session_id = get_value(subject, 'SUBJECT_study_nr')

# [20210820] Add-paravision 360 related.
title = subject.headers['TITLE']
Expand Down
Loading

0 comments on commit f69dc88

Please sign in to comment.