Skip to content

Commit

Permalink
Merge pull request #62 from MStarmans91/development
Browse files Browse the repository at this point in the history
Release version 3.4.5
  • Loading branch information
MStarmans91 authored Jul 9, 2021
2 parents 37197ce + e024e78 commit c0878f5
Show file tree
Hide file tree
Showing 108 changed files with 834 additions and 2,058 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Unit test

on:
push:
branches: [master, development]
pull_request:
branches: [master]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.7]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r requirements.txt
- name: Additional dependency for MaxOSX for XGBoost
run: |
brew install libomp
if: matrix.os == 'macos-latest'
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=WORC_config.py
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --statistics --max-line-length=1000 --exclude=WORC_config.py,*elastixtools*
- name: Install WORC package itself
run: python setup.py -q install
- name: Clone the WORC Tutorial and run as test
run: |
git clone --single-branch --branch develop https://github.com/MStarmans91/WORCTutorial
python WORCTutorial/WORCTutorialSimple.py
env:
WORCDEBUG: true
- name: Debugging on Linux
run: |
fastr trace /tmp/WORC_Example_STWStrategyHN/__sink_data__.json --sinks features_train_CT_0_predict --samples HN1331
fastr trace /tmp/WORC_Example_STWStrategyHN/__sink_data__.json --sinks classification --samples all
fastr trace /tmp/WORC_Example_STWStrategyHN/__sink_data__.json --sinks performance --samples all
fastr trace /tmp/GS/DEBUG_0/tmp/__sink_data__.json --sinks output --samples id_0__0000__0000
if: matrix.os == 'ubuntu-latest'
- name: Debugging on Windows
run: |
fastr trace "C:\Users\RUNNER~1\AppData\Local\Temp\WORC_Example_STWStrategyHN\__sink_data__.json" --sinks features_train_CT_0_predict --samples HN1331
fastr trace "C:\Users\RUNNER~1\AppData\Local\Temp\WORC_Example_STWStrategyHN\__sink_data__.json" --sinks classification --samples all
fastr trace "C:\Users\RUNNER~1\AppData\Local\Temp\WORC_Example_STWStrategyHN\__sink_data__.json" --sinks performance --samples all
fastr trace "C:\Users\RUNNER~1\AppData\Local\Temp\GS\DEBUG_0\tmp\__sink_data__.json" --sinks output --samples id_0__0000__0000
if: matrix.os == 'windows-latest'
- name: Debugging on MaxOSX
run: |
fastr trace WORCTutorial/WORC_Example_STWStrategyHN/__sink_data__.json --sinks features_train_CT_0_predict --samples HN1331
fastr trace WORCTutorial/WORC_Example_STWStrategyHN/__sink_data__.json --sinks classification --samples all
fastr trace WORCTutorial/WORC_Example_STWStrategyHN/__sink_data__.json --sinks performance --samples all
fastr trace WORCTutorial/GS/DEBUG_0/tmp/__sink_data__.json --sinks output --samples id_0__0000__0000
if: matrix.os == 'macos-latest'
- name: Run additional test for regression on Linux
run: |
rm -r /tmp/GS/DEBUG_0
python WORC/tests/WORCTutorialSimple_unittest_regression.py
fastr trace /tmp/WORC_Example_STWStrategyHN_Regression/__sink_data__.json --sinks classification --samples all
fastr trace /tmp/WORC_Example_STWStrategyHN_Regression/__sink_data__.json --sinks performance --samples all
fastr trace /tmp/GS/DEBUG_0/tmp/__sink_data__.json --sinks output --samples id_0__0000__0000
env:
WORCDEBUG: true
if: matrix.os == 'ubuntu-latest'
- name: Run additional tests for multiclass on Linux
run: |
rm -r /tmp/GS/DEBUG_0
python WORC/tests/WORCTutorialSimple_unittest_multiclass.py
fastr trace /tmp/WORC_Example_STWStrategyHN_Multiclass/__sink_data__.json --sinks classification --samples all
fastr trace /tmp/WORC_Example_STWStrategyHN_Multiclass/__sink_data__.json --sinks performance --samples all
fastr trace /tmp/GS/DEBUG_0/tmp/__sink_data__.json --sinks output --samples id_0__0000__0000
env:
WORCDEBUG: true
if: matrix.os == 'ubuntu-latest'
69 changes: 0 additions & 69 deletions .travis.yml

This file was deleted.

14 changes: 14 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog <http://keepachangelog.com/>`_
and this project adheres to `Semantic Versioning <http://semver.org/>`_


3.4.5 - 2021-07-09
------------------
Unit tests moved from Travis to Github Workflow from this verion on.

Fixed
~~~~~
- Bug in plotting images when ranking the posteriors or percentages.
- Linting issues.

Changed
~~~~~~~
- Removed deprecated scatterplot, RankedSVM functions.

3.4.4 - 2021-07-01
------------------

Expand Down
23 changes: 8 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# WORC v3.4.4
# WORC v3.4.5
## Workflow for Optimal Radiomics Classification

## Information

| Linux | Windows | Documentation | PyPi |Citing WORC |
|--------------------------------|-------------------------------|-------------------------------|-------------------------------|---------------------|
| [![][tci-linx]][tci-linx-lnk] | [![][tci-wind]][tci-wind-lnk] | [![][doc]][doc-lnk] | [![][pypi]][pypi-lnk] | [![][DOI]][DOI-lnk] |
| Unit test | Documentation | PyPi |Citing WORC |
|--------------------------------|-------------------------------|-------------------------------|---------------------|
| [![][gi-workflow]][gi-workflow-lnk] | [![][doc]][doc-lnk] | [![][pypi]][pypi-lnk] | [![][DOI]][DOI-lnk] |

[tci-linx]: https://travis-ci.com/MStarmans91/WORC.svg?token=qyvaeq7Cpwu7hJGB98Gp&branch=master&job=1
[tci-linx-lnk]: https://travis-ci.com/MStarmans91/WORC

[tci-wind]: https://travis-ci.com/MStarmans91/WORC.svg?token=qyvaeq7Cpwu7hJGB98Gp&branch=master&job=2
[tci-wind-lnk]: https://travis-ci.com/MStarmans91/WORC
[gi-workflow]: https://github.com/MStarmans91/WORC/workflows/Unit%20test/badge.svg
[gi-workflow-lnk]: https://github.com/MStarmans91/WORC/actions?query=workflow%3A%22Unit+test%22

[doc]:https://readthedocs.org/projects/worc/badge/?version=latest
[doc-lnk]: https://worc.readthedocs.io/en/latest/?badge=latest
Expand Down Expand Up @@ -54,8 +51,8 @@ The official documentation can be found at [https://worc.readthedocs.io](https:/

## Installation

WORC currently only supports Unix with Python 3.6+ (tested on 3.7.2 - 3.7.4) systems and
has been tested on Ubuntu 16.04 and 18.04, and Windows 10. For detailed installation
WORC supports Unix and Windows systems with Python 3.6+: the [unit tests](https://github.com/MStarmans91/WORC/actions?query=workflow%3A%22Unit+test%22)
are performed on the latest Ubuntu and Windows versions with Python 3.7. For detailed installation
instructions, please check [the ReadTheDocs installation guidelines](https://worc.readthedocs.io/en/latest/static/quick_start.html#installation).

The package can be installed through pip:
Expand All @@ -70,10 +67,6 @@ Make sure you install the requirements first:

pip install -r requirements.txt

NOTE: The version of PyRadiomics which WORC currently uses requires numpy to be installed beforehand. Make sure you do so, e.g.

pip install numpy

## 3rd-party packages used in WORC:

- SimpleITK (Image loading and preprocessing)
Expand Down
45 changes: 18 additions & 27 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WORC v3.4.4
WORC v3.4.5
===========

Workflow for Optimal Radiomics Classification
Expand All @@ -7,12 +7,11 @@ Workflow for Optimal Radiomics Classification
Information
-----------

+-----------------+-----------------+-----------------+-----------------+------------+
| Linux | Windows | Documentation | PyPi | Citing |
| | | | | WORC |
+=================+=================+=================+=================+============+
| |image0| | |image1| | |image2| | |image3| | |image4| |
+-----------------+-----------------+-----------------+-----------------+------------+
+---------------------+---------------------+---------------------+---------------+
| Unit test | Documentation | PyPi | Citing WORC |
+=====================+=====================+=====================+===============+
| |image0| | |image1| | |image2| | |image3| |
+---------------------+---------------------+---------------------+---------------+

Introduction
============
Expand All @@ -38,7 +37,7 @@ When using WORC, please cite this repository as following:

``Martijn P.A. Starmans, Sebastian R. van der Voort, Thomas Phil and Stefan Klein. Workflow for Optimal Radiomics Classification (WORC). Zenodo (2018). Available from: https://github.com/MStarmans91/WORC. DOI: http://doi.org/10.5281/zenodo.3840534.``

For the DOI, visit |image5|.
For the DOI, visit |image4|.

Disclaimer
----------
Expand All @@ -60,10 +59,11 @@ The official documentation can be found at https://worc.readthedocs.io.
Installation
------------

WORC currently only supports Unix with Python 3.6+ (tested on 3.7.2 -
3.7.4) systems and has been tested on Ubuntu 16.04 and 18.04, and
Windows 10. For detailed installation instructions, please check `the
ReadTheDocs installation
WORC supports Unix and Windows systems with Python 3.6+: the `unit
tests <https://github.com/MStarmans91/WORC/actions?query=workflow%3A%22Unit+test%22>`__
are performed on the latest Ubuntu and Windows versions with Python 3.7.
For detailed installation instructions, please check `the ReadTheDocs
installation
guidelines <https://worc.readthedocs.io/en/latest/static/quick_start.html#installation>`__.

The package can be installed through pip:
Expand All @@ -84,13 +84,6 @@ Make sure you install the requirements first:

pip install -r requirements.txt

NOTE: The version of PyRadiomics which WORC currently uses requires
numpy to be installed beforehand. Make sure you do so, e.g.

::

pip install numpy

3rd-party packages used in WORC:
--------------------------------

Expand Down Expand Up @@ -182,15 +175,13 @@ to XNAT. We advise you to specify your account settings in a .netrc file
when using this feature for your own datasets, such that you do not need
to input them on every request.

.. |image0| image:: https://travis-ci.com/MStarmans91/WORC.svg?token=qyvaeq7Cpwu7hJGB98Gp&branch=master&job=1
:target: https://travis-ci.com/MStarmans91/WORC
.. |image1| image:: https://travis-ci.com/MStarmans91/WORC.svg?token=qyvaeq7Cpwu7hJGB98Gp&branch=master&job=2
:target: https://travis-ci.com/MStarmans91/WORC
.. |image2| image:: https://readthedocs.org/projects/worc/badge/?version=latest
.. |image0| image:: https://github.com/MStarmans91/WORC/workflows/Unit%20test/badge.svg
:target: https://github.com/MStarmans91/WORC/actions?query=workflow%3A%22Unit+test%22
.. |image1| image:: https://readthedocs.org/projects/worc/badge/?version=latest
:target: https://worc.readthedocs.io/en/latest/?badge=latest
.. |image3| image:: https://badge.fury.io/py/WORC.svg
.. |image2| image:: https://badge.fury.io/py/WORC.svg
:target: https://badge.fury.io/py/WORC
.. |image4| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3840534.svg
.. |image3| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3840534.svg
:target: https://zenodo.org/badge/latestdoi/92295542
.. |image5| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3840534.svg
.. |image4| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3840534.svg
:target: https://zenodo.org/badge/latestdoi/92295542
8 changes: 5 additions & 3 deletions WORC/classification/AdvancedSampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ def __iter__(self):
# Generate the sequence generator
if self.method == 'Halton':
sequence = self.Halton.get(self.n_iter)
elif self.method == 'Sobol':
sequence = Sobol(len(self.param_distributions.keys()), self.n_iter)
# elif self.method == 'Sobol':
# sequence = Sobol(len(self.param_distributions.keys()), self.n_iter)
else:
raise KeyError(f'Methods {self.method} not known!')

# Always sort the keys of a dictionary, for reproducibility
items = sorted(self.param_distributions.items())
Expand Down Expand Up @@ -206,7 +208,7 @@ def __len__(self):

n_iter = 6

method = 'Sobol'
method = 'Halton'
sampled_params = AdvancedSampler(param_distributions,
n_iter,
random_state)
Expand Down
Loading

0 comments on commit c0878f5

Please sign in to comment.