Skip to content

Commit

Permalink
Merge pull request #1 from Fluorescence-Tools/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
tpeulen authored Feb 17, 2024
2 parents e1e8bf9 + e8b1fa0 commit db8078a
Show file tree
Hide file tree
Showing 21 changed files with 2,013 additions and 86 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/conda-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Conda Build

on:
workflow_dispatch:
push:
branches:
- development
release:
types: ['released', 'prereleased']
schedule:
# Every Monday at 11PM UTC
- cron: "0 11 * * 1"

jobs:
build-linux:
name: CondaBuild (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.10"]
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: "Set SDK on MacOS (if needed)"
if: startsWith(matrix.os, 'macos')
run: tools/install_macos_sdk.sh

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true

- name: Display Conda Settings
shell: bash -el {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Build Conda Package
uses: aganders3/headless-gui@v1
with:
shell: bash -el {0}
run: |
conda config --add channels tpeulen
mamba install conda-build boa
cd conda-recipe
# curl -sLO https://raw.githubusercontent.com/conda-forge/conda-forge-pinning-feedstock/084b098a28a7a66e9a0967d156bc55b9ebfc6726/recipe/conda_build_config.yaml
curl -sLO https://github.com/conda-forge/conda-forge-pinning-feedstock/raw/main/recipe/conda_build_config.yaml
conda mambabuild .
56 changes: 56 additions & 0 deletions .github/workflows/conda-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

name: Build and Upload Conda Packages

on:
workflow_dispatch:
release:
types: ['released', 'prereleased']
schedule:
# At 11:00 AM, every 3 months
- cron: "0 11 * */3 *"

jobs:
build:
name: CondaBuild (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.10"]
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: "Set SDK on MacOS (if needed)"
if: startsWith(matrix.os, 'macos')
run: tools/install_macos_sdk.sh

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true

- name: Display Conda Settings
shell: bash -el {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Build and Upload Conda Package
uses: aganders3/headless-gui@v1
with:
shell: bash -el {0}
run: |
mamba install conda-build boa anaconda-client
cd conda-recipe
curl -sLO https://github.com/conda-forge/conda-forge-pinning-feedstock/raw/main/recipe/conda_build_config.yaml
conda mambabuild . --output-folder conda-bld -c tpeulen
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u tpeulen --force conda-bld/**/*.tar.bz2
22 changes: 22 additions & 0 deletions .github/workflows/gitlab-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: GitlabSync

on:
workflow_dispatch:
push:

jobs:
sync:
runs-on: ubuntu-latest
name: Git Repo Sync
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wangchucheng/[email protected]
with:
# Such as https://github.com/wangchucheng/git-repo-sync.git
target-url: ${{ secrets.TARGET_URL }}
# Such as wangchucheng
target-username: ${{ secrets.TARGET_USERNAME }}
# You can store token in your project's 'Setting > Secrets' and reference the name here. Such as ${{ secrets.ACCESS\_TOKEN }}
target-token: ${{ secrets.TARGET_TOKEN }}
132 changes: 87 additions & 45 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,92 @@
{% set data = load_setup_py_data(setup_file='../setup.py', from_recipe_dir=True) %}
stages:
- build
- test
- deploy

package:
name: {{ data.get('name')|lower }}
version: {{ data.get('version')|lower }}
build:linux:
stage: build
tags:
- linux
image: condaforge/mambaforge:latest
before_script:
- apt update -yq && apt -yq install build-essential
- git submodule update --init --recursive --remote
- cd tools && git pull --force && cd ..
script:
- ./tools/build.sh
artifacts:
paths:
- bld-dir/

source:
path: ..
build:windows:
image: mambaforge:vs16
tags:
- win
stage: build
before_script:
- cd tools && git pull --force && cd ..
- git submodule update --init --recursive --remote
script:
- cmd.exe
- conda activate base
- git submodule update --init --recursive --remote
- .\tools\build.bat
artifacts:
paths:
- bld-dir/

build:
number: 0
string: py{{ python }}
entry_points:
{% for entry_point_type, entry_points in data.get("entry_points", dict()).items() -%}
{% for entry_point in entry_points -%}
- {{ entry_point }}
{% endfor %}
{% endfor %}
requirements:
host:
- python
- numpy
- pyyaml
- setuptools
build:
- python
- numpy
- setuptools
- pyyaml
run:
- python
- numpy
- pyyaml
- qtpy
- pyqt
- pyqtgraph
- tttrlib
- pathlib2 # [py < 3]
build:osx:
stage: build
tags:
- osx
before_script:
- cd tools && git pull --force && cd ..
- git submodule update --init --recursive --remote
script:
- ./tools/build.sh
artifacts:
paths:
- bld-dir/

about:
home: {{ data.get('url') }}
license: {{ data.get('license') }}
license_file: LICENSE
summary: Converter for TTTR files
description: |
{{ data.get('description') }}
test:linux:
stage: test
tags:
- linux
image:
name: condaforge/mambaforge
before_script:
# Issue with OpenGL and X11 display
# See: https://stackoverflow.com/questions/65675765/is-it-possible-to-run-x11-on-gitlab-ci
# See: https://github.com/conda-forge/pygridgen-feedstock/issues/10
# procps is used to grep the process by name to kill it when needed
- apt update -yq
- apt install -yq xorg-dev libglu1-mesa libgl1-mesa-dev xvfb libxinerama1 libxcursor1 libgl1-mesa-glx procps
script:
- source activate
# Disable Numba JIT for correct coverage analysis
- export NUMBA_DISABLE_JIT=1
- cp tools/.condarc ~/.condarc
- conda config --add channels "file://`pwd`/bld-dir"
- mamba create -n test python tttrconvert
- conda activate test
# Run GUI with xvfb - no X11 screen
- |
xvfb-run -a -s "-screen 0 1400x900x24 +extension RANDR" -- tttrconvert &
sleep 10
pgrep -f tttrconvert | awk '{print "kill -9 " $1}' | sh
extra:
recipe-maintainers:
- tpeulen
deploy:conda:
tags:
- linux
image: condaforge/mambaforge:latest
stage: deploy
dependencies:
- build:linux
- build:windows
- build:osx
script:
- ./tools/deploy.sh

#chisurf:
# stage: Trigger-cross-projects
# trigger: chisurf/chisurf
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

37 changes: 15 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# tttrconvert

A ``tttrconvert`` is a tool to convert time-tagged time-resolved files into different formats. ``tttrconvert`` to read
A ``tttrconvert`` is a very basic tool to convert time-tagged time-resolved files into different formats. ``tttrconvert`` to read
and write TTTR files ``tttrconvert`` uses ``tttrlib``. The tool ``tttrconvert`` can be embedded
in other software and is part of ChiSurf.

Currently, the tool has only very basic functions (it is probably not
what you want).

![tttrconvert GUI][1]

## Building and installation
Expand All @@ -15,7 +18,7 @@ To install ``tttrconvert`` from the source code clone the git repository and run
setup script.

```commandline
git clone https://gitlab.peulen.xyz/tpeulen/tttrconvert
git clone https://github.com/fluorescence-tools/tttrconvert
cd tttrconvert
python setup.py install
```
Expand All @@ -26,23 +29,17 @@ tttrconvert
```

### Conda
``tttrconvert`` depends on common python packages such as ``numpy``. Additionally, ``tttrconvert`` depends on
``tttrlib``. Thus, to install ``k2dist`` make sure that conda channels that provide packages for the necessary
dependencies are listed in the ``.condarc`` file

```yaml
channels:
- tpeulen
- tpeulen/label/nightly
- conda-forge
- defaults
```
`tttrconvert` can be installed using conda, best in a separate
environment

To avoid potential conflicts ``tttrconvert`` can be installed in a separate environment.
```bash
conda create tttrconvert
mamba install tttrconvert -c tpeulen
```

```commandline
conda create -n test
conda install tttrconvert
To us the tool activate the tttrconvert environment and start the tool
from the command line.
```bash
conda activate tttrconvert
tttrconvert
```
Expand All @@ -51,11 +48,7 @@ tttrconvert

## Graphical user interface
First, select the input file type. Next, add files to the file list by drag-and-drop. Finally,
select the ouput file format and save/convert the files.

## Note on meta-data
The different TTTR file formats contain and support different meta-data. The meta-data may need to be
edited separately.
select the output file format and save/convert the files.


[1]: doc/gui.png "tttrconvert GUI"
Loading

0 comments on commit db8078a

Please sign in to comment.