Skip to content

Commit

Permalink
Merge pull request #63 from MStarmans91/development
Browse files Browse the repository at this point in the history
Release v3.5.0
  • Loading branch information
MStarmans91 committed Aug 19, 2021
2 parents c0878f5 + 8011d88 commit 61abd96
Show file tree
Hide file tree
Showing 106 changed files with 839 additions and 633 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ The format is based on `Keep a Changelog <http://keepachangelog.com/>`_
and this project adheres to `Semantic Versioning <http://semver.org/>`_


3.5.0 - 2021-08-18
------------

Fixed
~~~~~
- Bug in plotting 2D images when ranking the posteriors or percentages.
- Bug in Evaluate for Regression.
- Bug in BasicWORC for supplying label files.
- There is a bug in SimpleITK 2.1.0, which leads it to not be able
to read certain NIFTI files. See: https://github.com/InsightSoftwareConsortium/ITK/issues/2674
Reverting to SimpleITK 2.0.2 for now

Changed
~~~~~~~
- Defaults for splitting jobs in hyperoptimization: now more parallelized.

Added
~~~~~~~
- Documentation on additional functionality.

3.4.5 - 2021-07-09
------------------
Unit tests moved from Travis to Github Workflow from this verion on.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# WORC v3.4.5
# WORC v3.5.0
## Workflow for Optimal Radiomics Classification

## Information
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WORC v3.4.5
WORC v3.5.0
===========

Workflow for Optimal Radiomics Classification
Expand Down
11 changes: 10 additions & 1 deletion WORC/WORC.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
import WORC.addexceptions as WORCexceptions
import WORC.IOparser.config_WORC as config_io
from WORC.detectors.detectors import DebugDetector
from WORC.export.hyper_params_exporter import export_hyper_params_to_latex
from urllib.parse import urlparse
from urllib.request import url2pathname


class WORC(object):
Expand Down Expand Up @@ -471,7 +474,7 @@ def defaultconfig(self):
config['HyperOptimization']['test_size'] = '0.2'
config['HyperOptimization']['n_splits'] = '5'
config['HyperOptimization']['N_iterations'] = '1000'
config['HyperOptimization']['n_jobspercore'] = '500' # only relevant when using fastr in classification
config['HyperOptimization']['n_jobspercore'] = '200' # only relevant when using fastr in classification
config['HyperOptimization']['maxlen'] = '100'
config['HyperOptimization']['ranking_score'] = 'test_score'
config['HyperOptimization']['memory'] = '3G'
Expand Down Expand Up @@ -1752,6 +1755,12 @@ def execute(self):
except graphviz.backend.CalledProcessError as e:
print(f'[WORC WARNING] Graphviz executable gave an error: not drawing network diagram. Original error: {e}')

# export hyper param. search space to LaTeX table
for config in self.fastrconfigs:
config_path = Path(url2pathname(urlparse(config).path))
tex_path = f'{config_path.parent.absolute() / config_path.stem}_hyperparams_space.tex'
export_hyper_params_to_latex(config_path, tex_path)

if DebugDetector().do_detection():
print("Source Data:")
for k in self.source_data.keys():
Expand Down
Binary file modified WORC/doc/_build/doctrees/autogen/WORC.doctree
Binary file not shown.
Binary file modified WORC/doc/_build/doctrees/autogen/WORC.plotting.doctree
Binary file not shown.
Binary file modified WORC/doc/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified WORC/doc/_build/doctrees/index.doctree
Binary file not shown.
Binary file modified WORC/doc/_build/doctrees/static/changelog.doctree
Binary file not shown.
Binary file modified WORC/doc/_build/doctrees/static/configuration.doctree
Binary file not shown.
Binary file modified WORC/doc/_build/doctrees/static/user_manual.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion WORC/doc/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 90b87bcebef0f13f3ee4eda0aa38d0c3
config: 200f1b705b4d367101e0261a187b00d0
tags: 645f666f9bcd5a90fca523b33c5a78b7
4 changes: 2 additions & 2 deletions WORC/doc/_build/html/_modules/WORC/IOparser/config_WORC.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.IOparser.config_WORC &mdash; WORC 3.4.5 documentation</title>
<title>WORC.IOparser.config_WORC &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.IOparser.config_io_classifier &mdash; WORC 3.4.5 documentation</title>
<title>WORC.IOparser.config_io_classifier &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.IOparser.config_preprocessing &mdash; WORC 3.4.5 documentation</title>
<title>WORC.IOparser.config_preprocessing &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.IOparser.config_segmentix &mdash; WORC 3.4.5 documentation</title>
<title>WORC.IOparser.config_segmentix &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
4 changes: 2 additions & 2 deletions WORC/doc/_build/html/_modules/WORC/IOparser/file_io.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.IOparser.file_io &mdash; WORC 3.4.5 documentation</title>
<title>WORC.IOparser.file_io &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
15 changes: 12 additions & 3 deletions WORC/doc/_build/html/_modules/WORC/WORC.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.WORC &mdash; WORC 3.4.5 documentation</title>
<title>WORC.WORC &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down Expand Up @@ -195,6 +195,9 @@ <h1>Source code for WORC.WORC</h1><div class="highlight"><pre>
<span class="kn">import</span> <span class="nn">WORC.addexceptions</span> <span class="k">as</span> <span class="nn">WORCexceptions</span>
<span class="kn">import</span> <span class="nn">WORC.IOparser.config_WORC</span> <span class="k">as</span> <span class="nn">config_io</span>
<span class="kn">from</span> <span class="nn">WORC.detectors.detectors</span> <span class="k">import</span> <span class="n">DebugDetector</span>
<span class="kn">from</span> <span class="nn">WORC.export.hyper_params_exporter</span> <span class="k">import</span> <span class="n">export_hyper_params_to_latex</span>
<span class="kn">from</span> <span class="nn">urllib.parse</span> <span class="k">import</span> <span class="n">urlparse</span>
<span class="kn">from</span> <span class="nn">urllib.request</span> <span class="k">import</span> <span class="n">url2pathname</span>


<div class="viewcode-block" id="WORC"><a class="viewcode-back" href="../../autogen/WORC.html#WORC.WORC.WORC">[docs]</a><span class="k">class</span> <span class="nc">WORC</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
Expand Down Expand Up @@ -636,7 +639,7 @@ <h1>Source code for WORC.WORC</h1><div class="highlight"><pre>
<span class="n">config</span><span class="p">[</span><span class="s1">&#39;HyperOptimization&#39;</span><span class="p">][</span><span class="s1">&#39;test_size&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;0.2&#39;</span>
<span class="n">config</span><span class="p">[</span><span class="s1">&#39;HyperOptimization&#39;</span><span class="p">][</span><span class="s1">&#39;n_splits&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;5&#39;</span>
<span class="n">config</span><span class="p">[</span><span class="s1">&#39;HyperOptimization&#39;</span><span class="p">][</span><span class="s1">&#39;N_iterations&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;1000&#39;</span>
<span class="n">config</span><span class="p">[</span><span class="s1">&#39;HyperOptimization&#39;</span><span class="p">][</span><span class="s1">&#39;n_jobspercore&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;500&#39;</span> <span class="c1"># only relevant when using fastr in classification</span>
<span class="n">config</span><span class="p">[</span><span class="s1">&#39;HyperOptimization&#39;</span><span class="p">][</span><span class="s1">&#39;n_jobspercore&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;200&#39;</span> <span class="c1"># only relevant when using fastr in classification</span>
<span class="n">config</span><span class="p">[</span><span class="s1">&#39;HyperOptimization&#39;</span><span class="p">][</span><span class="s1">&#39;maxlen&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;100&#39;</span>
<span class="n">config</span><span class="p">[</span><span class="s1">&#39;HyperOptimization&#39;</span><span class="p">][</span><span class="s1">&#39;ranking_score&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;test_score&#39;</span>
<span class="n">config</span><span class="p">[</span><span class="s1">&#39;HyperOptimization&#39;</span><span class="p">][</span><span class="s1">&#39;memory&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;3G&#39;</span>
Expand Down Expand Up @@ -1917,6 +1920,12 @@ <h1>Source code for WORC.WORC</h1><div class="highlight"><pre>
<span class="k">except</span> <span class="n">graphviz</span><span class="o">.</span><span class="n">backend</span><span class="o">.</span><span class="n">CalledProcessError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="n">f</span><span class="s1">&#39;[WORC WARNING] Graphviz executable gave an error: not drawing network diagram. Original error: </span><span class="si">{e}</span><span class="s1">&#39;</span><span class="p">)</span>

<span class="c1"># export hyper param. search space to LaTeX table</span>
<span class="k">for</span> <span class="n">config</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">fastrconfigs</span><span class="p">:</span>
<span class="n">config_path</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="n">url2pathname</span><span class="p">(</span><span class="n">urlparse</span><span class="p">(</span><span class="n">config</span><span class="p">)</span><span class="o">.</span><span class="n">path</span><span class="p">))</span>
<span class="n">tex_path</span> <span class="o">=</span> <span class="n">f</span><span class="s1">&#39;{config_path.parent.absolute() / config_path.stem}_hyperparams_space.tex&#39;</span>
<span class="n">export_hyper_params_to_latex</span><span class="p">(</span><span class="n">config_path</span><span class="p">,</span> <span class="n">tex_path</span><span class="p">)</span>

<span class="k">if</span> <span class="n">DebugDetector</span><span class="p">()</span><span class="o">.</span><span class="n">do_detection</span><span class="p">():</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Source Data:&quot;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">source_data</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
Expand Down
4 changes: 2 additions & 2 deletions WORC/doc/_build/html/_modules/WORC/addexceptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.addexceptions &mdash; WORC 3.4.5 documentation</title>
<title>WORC.addexceptions &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.classification.AdvancedSampler &mdash; WORC 3.4.5 documentation</title>
<title>WORC.classification.AdvancedSampler &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.classification.ObjectSampler &mdash; WORC 3.4.5 documentation</title>
<title>WORC.classification.ObjectSampler &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.classification.RankedSVM &mdash; WORC 3.4.5 documentation</title>
<title>WORC.classification.RankedSVM &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.classification.SearchCV &mdash; WORC 3.4.5 documentation</title>
<title>WORC.classification.SearchCV &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.classification.construct_classifier &mdash; WORC 3.4.5 documentation</title>
<title>WORC.classification.construct_classifier &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.classification.createfixedsplits &mdash; WORC 3.4.5 documentation</title>
<title>WORC.classification.createfixedsplits &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.classification.crossval &mdash; WORC 3.4.5 documentation</title>
<title>WORC.classification.crossval &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.classification.estimators &mdash; WORC 3.4.5 documentation</title>
<title>WORC.classification.estimators &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>WORC.classification.fitandscore &mdash; WORC 3.4.5 documentation</title>
<title>WORC.classification.fitandscore &mdash; WORC 3.5.0 documentation</title>



Expand Down Expand Up @@ -62,7 +62,7 @@


<div class="version">
3.4.5
3.5.0
</div>


Expand Down
Loading

0 comments on commit 61abd96

Please sign in to comment.