Skip to content

Commit

Permalink
Merge pull request #43 from deeptools/azure-pipelines
Browse files Browse the repository at this point in the history
Set up CI with Azure Pipelines
  • Loading branch information
joachimwolff authored Jul 20, 2021
2 parents 1131d31 + 158829f commit d26af6c
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 56 deletions.
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.

80 changes: 80 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
pr:
autoCancel: true

jobs:

- job: 'Linux'
timeoutInMinutes: 0
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'

steps:
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
hash -r
displayName: Add conda to PATH
- bash: |
conda config --set always_yes yes --set changeps1 no
conda info -a
conda create -n hicmatrix --yes -c conda-forge -c bioconda python=$(python.version) --file requirements.txt
source activate hicmatrix
conda install --yes -c conda-forge -c bioconda pytest flake8 pytest-xdist pytest-forked
conda install --yes -c conda-forge -c bioconda nose
conda install --yes pathlib
conda install --yes -c defaults -c conda-forge -c bioconda configparser
python setup.py install
displayName: installing dependencies
- script: |
source activate hicmatrix
flake8 . --exclude=.venv,.build,planemo_test_env,build --ignore=E501,F401,F403,E402,F999,F405,E712
displayName: linting
- script: |
source activate hicmatrix
py.test hicmatrix/test/ --capture=sys
displayName: pytest
- job: 'OSX'
timeoutInMinutes: 0
pool:
vmImage: 'macOS-10.14'
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'

steps:
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
hash -r
displayName: Add conda to PATH
- bash: |
conda config --set always_yes yes --set changeps1 no
conda info -a
conda create -n hicmatrix --yes -c conda-forge -c bioconda python=$(python.version) --file requirements.txt
source activate hicmatrix
conda install --yes -c conda-forge -c bioconda pytest flake8 pytest-xdist pytest-forked
conda install --yes -c conda-forge -c bioconda nose
conda install --yes pathlib
conda install --yes -c defaults -c conda-forge -c bioconda configparser
python setup.py install
displayName: installing dependencies
- script: |
source activate hicmatrix
flake8 . --exclude=.venv,.build,planemo_test_env,build --ignore=E501,F401,F403,E402,F999,F405,E712
displayName: linting
- script: |
source activate hicmatrix
py.test hicmatrix/test/ --capture=sys
displayName: pytest
5 changes: 2 additions & 3 deletions hicmatrix/HiCMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from intervaltree import IntervalTree, Interval
import cooler
import time
from collections import Counter

from .utilities import toBytes
from .utilities import toString
Expand Down Expand Up @@ -170,7 +169,7 @@ def getBinSize(self):
return self.bin_size
# If there are more bins, the diff will be compared
# to the median of the differences between starts
median = int(np.median(np.concatenate([np.diff([start for chro, start, end, extra in self.cut_intervals if chro == cur_chrom]) for cur_chrom, nb in Counter(chrom).items() if nb > 1])))
median = int(np.median(np.diff(start)))

# check if the bin size is
# homogeneous
Expand Down Expand Up @@ -335,7 +334,7 @@ def fit_cut_intervals(cut_intervals):
return cut_intervals
chrom, start, end, extra = zip(*cut_intervals)

median = int(np.median(np.concatenate([np.diff([start for chro, start, end, extra in cut_intervals if chro == cur_chrom]) for cur_chrom, nb in Counter(chrom).items() if nb > 1])))
median = int(np.median(np.diff(start)))
diff = np.array(end) - np.array(start)
# check if the bin size is homogeneous
if len(np.flatnonzero(diff != median)) > (len(diff) * 0.01):
Expand Down

0 comments on commit d26af6c

Please sign in to comment.