Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
* drop Shippable
* try git LFS
* update init info
* fix pkg setup
* fix yaml load
  • Loading branch information
Borda committed Dec 8, 2019
1 parent e6fe7b3 commit db6904b
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 100 deletions.
8 changes: 7 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
*.ipynb linguist-vendored
*.ipynb linguist-vendored
# Used by Git-LFS
# *.png filter=lfs diff=lfs merge=lfs -text
# *.jpg filter=lfs diff=lfs merge=lfs -text
# *.jpeg filter=lfs diff=lfs merge=lfs -text
# *.tif filter=lfs diff=lfs merge=lfs -text
# *.tiff filter=lfs diff=lfs merge=lfs -text
64 changes: 0 additions & 64 deletions .shippable.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ after_success:
- python-codacy-coverage -r coverage.xml
- coverage report
# ANNOTATION section
- bash handling_annotations/test_annotations.sh
#- bash handling_annotations/test_annotations.sh
# SEGMENTATION section
- bash experiments_segmentation/test_segmentations.sh
#- bash experiments_segmentation/test_segmentations.sh
# CENTER DETECT. section
- bash experiments_ovary_centres/test_ovary_centers.sh
#- bash experiments_ovary_centres/test_ovary_centers.sh
# REGION GROWING section
- bash experiments_ovary_detect/test_ovary_detect.sh
#- bash experiments_ovary_detect/test_ovary_detect.sh
# test installed package
- cd .. && python -c "import imsegm.descriptors"
#- cd .. && python -c "import imsegm.descriptors"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
[![codecov](https://codecov.io/gh/Borda/pyImSegm/branch/master/graph/badge.svg?token=BCvf6F5sFP)](https://codecov.io/gh/Borda/pyImSegm)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/48b7976bbe9d42bc8452f6f9e573ee70)](https://www.codacy.com/app/Borda/pyImSegm?utm_source=github.com&utm_medium=referral&utm_content=Borda/pyImSegm&utm_campaign=Badge_Grade)
[![CircleCI](https://circleci.com/gh/Borda/pyImSegm.svg?style=svg&circle-token=a30180a28ae7e490c0c0829d1549fcec9a5c59d0)](https://circleci.com/gh/Borda/pyImSegm)
[![Run Status](https://api.shippable.com/projects/5962ea48a125960700c197f8/badge?branch=master)](https://app.shippable.com/github/Borda/pyImSegm)
[![CodeFactor](https://www.codefactor.io/repository/github/borda/pyimsegm/badge)](https://www.codefactor.io/repository/github/borda/pyimsegm)
[![Documentation Status](https://readthedocs.org/projects/pyimsegm/badge/?version=latest)](https://pyimsegm.readthedocs.io/en/latest/?badge=latest)
[![Gitter](https://badges.gitter.im/pyImSegm/community.svg)](https://gitter.im/pyImSegm/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
<!--
[![Run Status](https://api.shippable.com/projects/5962ea48a125960700c197f8/badge?branch=master)](https://app.shippable.com/github/Borda/pyImSegm)
[![Coverage Badge](https://api.shippable.com/projects/5962ea48a125960700c197f8/coverageBadge?branch=master)](https://app.shippable.com/github/Borda/pyImSegm)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Borda/pyImSegm/master?filepath=notebooks)
-->
Expand Down
68 changes: 47 additions & 21 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ references:
run:
name: Install PyPI dependences
command: |
sudo apt-get update
sudo apt-get update -qq
sudo apt-get install git-lfs
sudo apt-get install tk-dev pkg-config python-dev python-tk
sudo pip install --upgrade pip setuptools
sudo pip install -r ./tests/requirements.txt
sudo pip install -U backports.functools_lru_cache # required for matplotlib @py2
pip install -r requirements.txt --user
pip list
pip --version ; pip list
test_coverage: &test_coverage
run:
name: Testing and Formating
command: |
unset DISPLAY
mkdir output && mkdir results && mkdir test-reports
coverage run --source imsegm -m py.test imsegm tests -v --doctest-modules --junitxml=test-reports/pytest_junit.xml
python setup.py check -m -s
flake8 . --ignore=E402,E731 --max-line-length=100
Expand All @@ -27,11 +29,16 @@ references:
run:
name: Building project
command: |
mkdir libs && mkdir output && mkdir results && mkdir test-reports
gcc --version ; python --version ; pwd ; ls -l
pip --version ; pip freeze
python setup.py build_ext --inplace
install_project: &install_project
run:
name: Insatlling project
command: |
python setup.py install --user
rm -rf imsegm
make_docs: &make_docs
run:
name: Make Documentation
Expand All @@ -42,29 +49,21 @@ references:
cd docs; make html
jobs:
Py2:
Py3-Tests:
docker:
- image: circleci/python:2.7
steps: &steps
- image: circleci/python:3.6
steps: &steps_test
- checkout
# INSTALLATION
- *install_pips
#- run: git lfs pull
# BUILDING
- *build_project
# TESTING
- *test_coverage
# DOCUMENTATION
- *make_docs

# ANNOTATION section
- run: bash handling_annotations/test_annotations.sh
# SEGMENTATION section
- run: bash experiments_segmentation/test_segmentations.sh
# CENTER DETECT. section
- run: bash experiments_ovary_centres/test_ovary_centers.sh
# REGION GROWING section
- run: bash experiments_ovary_detect/test_ovary_detect.sh

# PASSING
- run:
name: Finalise
Expand All @@ -77,14 +76,41 @@ jobs:
- store_artifacts:
path: test-reports

Py3:
Py3-Experiments:
docker:
- image: circleci/python:3.6
steps: *steps
- image: circleci/python:3.6
steps: &steps_expt
- checkout
# INSTALLATION
- *install_pips
#- run: git lfs pull
- *install_project

- run: mkdir libs && mkdir output && mkdir results
# ANNOTATION section
- run: bash handling_annotations/test_annotations.sh
# SEGMENTATION section
- run: bash experiments_segmentation/test_segmentations.sh
# CENTER DETECT. section
- run: bash experiments_ovary_centres/test_ovary_centers.sh
# REGION GROWING section
- run: bash experiments_ovary_detect/test_ovary_detect.sh

Py2-Tests:
docker:
- image: circleci/python:2.7
steps: *steps_test

Py2-Experiments:
docker:
- image: circleci/python:2.7
steps: *steps_expt

workflows:
version: 2
build:
jobs:
- Py2
- Py3
- Py2-Tests
- Py3-Tests
- Py2-Experiments
- Py3-Experiments
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# export the documentation
with open('intro.rst', 'w') as fp:
intro = imsegm.__doc__.replace(os.linesep + ' ', '')
intro = imsegm.__long_doc__.replace(os.linesep + ' ', '')
fp.write(m2r.convert(intro))
# fp.write(imsegm.__doc__)

Expand Down
5 changes: 3 additions & 2 deletions imsegm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
__author_email__ = 'jiri.borovec@fel.cvut.cz'
__license__ = 'BSD 3-clause'
__homepage__ = 'https://borda.github.io/pyImSegm'
__copyright__ = 'Copyright (c) 2014-2019, Jiri Borovec.'
__doc__ = """# Image segmentation - general superpixel segmentation & region growing
__copyright__ = 'Copyright (c) 2014-2019, %s.' % __author__
__doc__ = 'Image segmentation - general superpixel segmentation & region growing'
__long_doc__ = "# %s" % __doc__ + """
This package is aiming at (un/semi)supervised segmentation on superpixels with
computing some basic colour and texture features. This general segmentation
Expand Down
11 changes: 7 additions & 4 deletions imsegm/utilities/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ def create_experiment_folder(params, dir_name, stamp_unique=True, skip_load=True
>>> p = {'path_out': '.'}
>>> p = create_experiment_folder(p, 'my_test', False, skip_load=True)
>>> pd.Series(p).sort_index() #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
computer (...
computer [...
path_exp ./my_test_EXAMPLE
path_out .
dtype: object
>>> p = create_experiment_folder(p, 'my_test', False, skip_load=False)
>>> shutil.rmtree(p['path_exp'], ignore_errors=True)
>>> p = create_experiment_folder(p, 'my_test', stamp_unique=True)
>>> pd.Series(p).sort_index() #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
computer (...
computer [...
path_exp ./my_test_EXAMPLE_...-...
path_out .
dtype: object
Expand All @@ -175,9 +175,11 @@ def create_experiment_folder(params, dir_name, stamp_unique=True, skip_load=True
if os.path.isdir(path_expt):
logging.warning('particular out folder already exists')
path_expt += ':' + str(uuid.uuid4().hex)

logging.info('creating experiment folder "{}"'.format(path_expt))
if not os.path.exists(path_expt):
os.mkdir(path_expt)

# loading confing if it exists
path_config = os.path.join(path_expt, CONFIG_YAML)
if os.path.exists(path_config) and not skip_load:
Expand All @@ -186,8 +188,9 @@ def create_experiment_folder(params, dir_name, stamp_unique=True, skip_load=True
params = load_config_yaml(path_config)
params.update({k: params_in[k] for k in params_in if 'path' in k})
logging.info('loaded following PARAMETERS: %s', string_dict(params))

# extending parameters bu this run
params.update({'computer': os.uname(), 'path_exp': path_expt})
params.update({'computer': list(os.uname()), 'path_exp': path_expt})
# export experiment config
logging.debug('saving params to file "%s"', CONFIG_YAML)
save_config_yaml(path_config, params)
Expand Down Expand Up @@ -456,7 +459,7 @@ def load_config_yaml(path_config):
>>> os.remove(p_conf)
"""
with open(path_config, 'r') as fp:
config = yaml.load(fp)
config = yaml.safe_load(fp)
return config


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _parse_requirements(file_path):
long_description=imsegm.__doc__,
long_description_content_type='text/markdown',

packages=['imsegm'],
packages=['imsegm', 'imsegm.utilities'],
cmdclass={'build_ext': BuildExt},
ext_modules=[
Extension('imsegm.features_cython',
Expand Down

0 comments on commit db6904b

Please sign in to comment.