Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python3 support #196

Merged
merged 19 commits into from Feb 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2b7df58
ENH: Add dependency to "six" project to facilitate support of both py…
jcfr Feb 14, 2017
62c511d
ENH: py3: Use "six.string_types" instead of "basestring"
jcfr Feb 14, 2017
d1862d1
ENH: py3: Update code to use "print" function.
jcfr Feb 14, 2017
62e367e
ENH: py3: Use "six.next()" instead of "it.next()
jcfr Feb 14, 2017
bac8af1
ENH: py3: Use "six.iteritems()" instead of "dict.iteritems()"
jcfr Feb 14, 2017
3890702
ENH: py3: Use "six.moves.range()" instead of "xrange()"
jcfr Feb 14, 2017
f8ab5da
ENH: py3: Use "except Exception as exc" syntax
jcfr Feb 14, 2017
6317a52
ENH: py3: Directly compare test settings instead of using "cmp" funct…
jcfr Feb 14, 2017
a7a6d60
STYL: py3: Use "print" function in notebooks and documentation.
jcfr Feb 14, 2017
76fb4ee
ENH: py3: Convert output of dict.keys() from dict_keys to a list
jcfr Feb 14, 2017
a1c2cc6
BUG: py3: testUtils: Fix opening of baselineFile
jcfr Feb 14, 2017
a572427
BUG: Fix use of updated SimpleITK ConstantPadImage and CropImage filters
JoostJM Feb 14, 2017
13ba365
BUG: py3: Fix iteration error in GLRLM
JoostJM Feb 14, 2017
8a950d9
BUG: py3: Update testUtils function to work with nose by casting to "…
jcfr Feb 14, 2017
9f9f9e3
BUG: py3: Fix RadiomicsShape._getMaximum2Ddiameter
JoostJM Feb 14, 2017
346b4fc
ci: Enable py3 testing on Appveyor (Windows) and CircleCI (Linux)
jcfr Feb 14, 2017
2a25157
ci: Do not test for Python 3.3. Numpy packages are not available.
jcfr Feb 14, 2017
41e4791
STYL: Remove unused and obsolete radiomics.in_py3 variable
jcfr Feb 14, 2017
de8ee88
ci: manylinux: Avoid sdist failure with workaround for distutils/setu…
jcfr Feb 14, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 4 additions & 6 deletions .circleci-matrix.yml
Expand Up @@ -3,12 +3,10 @@ env:
- MANYLINUX_IMAGE=manylinux-x86 MANYLINUX_PYTHON=cp27-cp27m
- MANYLINUX_IMAGE=manylinux-x64 MANYLINUX_PYTHON=cp27-cp27mu
- MANYLINUX_IMAGE=manylinux-x86 MANYLINUX_PYTHON=cp27-cp27mu
# - MANYLINUX_IMAGE=manylinux-x64 MANYLINUX_PYTHON=cp33-cp33m
# - MANYLINUX_IMAGE=manylinux-x86 MANYLINUX_PYTHON=cp33-cp33m
# - MANYLINUX_IMAGE=manylinux-x64 MANYLINUX_PYTHON=cp34-cp34m
# - MANYLINUX_IMAGE=manylinux-x86 MANYLINUX_PYTHON=cp34-cp34m
# - MANYLINUX_IMAGE=manylinux-x64 MANYLINUX_PYTHON=cp35-cp35m
# - MANYLINUX_IMAGE=manylinux-x86 MANYLINUX_PYTHON=cp35-cp35m
- MANYLINUX_IMAGE=manylinux-x64 MANYLINUX_PYTHON=cp34-cp34m
- MANYLINUX_IMAGE=manylinux-x86 MANYLINUX_PYTHON=cp34-cp34m
- MANYLINUX_IMAGE=manylinux-x64 MANYLINUX_PYTHON=cp35-cp35m
- MANYLINUX_IMAGE=manylinux-x86 MANYLINUX_PYTHON=cp35-cp35m
command:
- docker run dockcross/$MANYLINUX_IMAGE > ~/bin/dockcross && chmod +x ~/bin/dockcross
- |
Expand Down
6 changes: 0 additions & 6 deletions .travis.yml
Expand Up @@ -19,11 +19,6 @@ matrix:
# env:
# - PYTHON_VERSION=3.4.5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this mean that python 3.x testing for Mac is still disabled?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python 3.x testing for Mac is still disabled?

Indeed. Waiting for SimpleITK wheels, we do not have a choice. See https://itk.org/SimpleITKDoxygen/html/PyDownloadPage.html

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are however conda packages for SimpleITK, would it make sense to get the mac tests working on miniconda/anaconda (https://anaconda.org/simpleitk/simpleitk) instead of standard python?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jcfr ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would make sense, the idea would be to submit a recipe to conda-forge. With that in place, the package would be available on conda on linux, macosx and windows.

That said, conda-forge recipe are updated only when there is a release of the package. If you would like to setup continuous integration using miniconda, you would have to set it up on your own.

I currently do not have the bandwidth to set miniconda CI up for pyradiomics, in the mean time I would be happy to review PR.

@blowekamp Do we know when macosx wheels will be available for python 35 ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just working on some scripts for the 1.0 release... I'll see if I can run them on the release branch too like the recent x86_64 0.10.0.post3 wheel.


# - os: osx
# language: generic
# env:
# - PYTHON_VERSION=3.3.6

- os: osx
language: generic
env:
Expand All @@ -33,7 +28,6 @@ cache:
directories:
- $HOME/.pyenv/versions/3.5.2
- $HOME/.pyenv/versions/3.4.5
- $HOME/.pyenv/versions/3.3.6
- $HOME/.pyenv/versions/2.7.12
- $HOME/downloads

Expand Down
48 changes: 19 additions & 29 deletions appveyor.yml
Expand Up @@ -18,35 +18,25 @@ environment:
PYTHON_ARCH: "64"
BLOCK: "0"

# - PYTHON_DIR: "C:\\Python33"
# PYTHON_VERSION: "3.3.x"
# PYTHON_ARCH: "32"
# BLOCK: "0"

# - PYTHON_DIR: "C:\\Python33-x64"
# PYTHON_VERSION: "3.3.x"
# PYTHON_ARCH: "64"
# BLOCK: "0"

# - PYTHON_DIR: "C:\\Python34"
# PYTHON_VERSION: "3.4.x"
# PYTHON_ARCH: "32"
# BLOCK: "0"

# - PYTHON_DIR: "C:\\Python34-x64"
# PYTHON_VERSION: "3.4.x"
# PYTHON_ARCH: "64"
# BLOCK: "0"

# - PYTHON_DIR: "C:\\Python35"
# PYTHON_VERSION: "3.5.x"
# PYTHON_ARCH: "32"
# BLOCK: "0"

# - PYTHON_DIR: "C:\\Python35-x64"
# PYTHON_VERSION: "3.5.x"
# PYTHON_ARCH: "64"
# BLOCK: "0"
- PYTHON_DIR: "C:\\Python34"
PYTHON_VERSION: "3.4.x"
PYTHON_ARCH: "32"
BLOCK: "0"

- PYTHON_DIR: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.x"
PYTHON_ARCH: "64"
BLOCK: "0"

- PYTHON_DIR: "C:\\Python35"
PYTHON_VERSION: "3.5.x"
PYTHON_ARCH: "32"
BLOCK: "0"

- PYTHON_DIR: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.x"
PYTHON_ARCH: "64"
BLOCK: "0"

init:
- python -m pip install scikit-ci==0.13.0 scikit-ci-addons==0.11.0
Expand Down
51 changes: 26 additions & 25 deletions bin/Notebooks/PyRadiomics Example.ipynb
Expand Up @@ -23,6 +23,7 @@
},
"outputs": [],
"source": [
"from __future__ import print_function\n",
"import os # needed navigate the system to get the input data\n",
"\n",
"from radiomics import featureextractor # This module is used for interaction with pyradiomics"
Expand Down Expand Up @@ -70,16 +71,16 @@
"# \"..\" points to the parent directory: \\pyradiomics\\bin\\Notebooks\\..\\ is equal to \\pyradiomics\\bin\\\n",
"# Move up 2 directories (i.e. go to \\pyradiomics\\) and then move into \\pyradiomics\\data\n",
"dataDir = os.path.join(os.getcwd(), \"..\", \"..\", \"data\")\n",
"print \"dataDir, relative path:\", dataDir\n",
"print \"dataDir, absolute path:\", os.path.abspath(dataDir)\n",
"print(\"dataDir, relative path:\", dataDir)\n",
"print(\"dataDir, absolute path:\", os.path.abspath(dataDir))\n",
"\n",
"# Store the file paths of our testing image and label map into two variables\n",
"imagePath = os.path.join(dataDir, testCase + \"_image.nrrd\")\n",
"labelPath = os.path.join(dataDir, testCase + \"_label.nrrd\")\n",
"\n",
"# Additonally, store the location of the example parameter file, stored in \\pyradiomics\\bin\n",
"paramPath = os.path.join(os.getcwd(), \"..\", \"Params.yaml\")\n",
"print \"Parameter file, absolute path:\", os.path.abspath(paramPath)"
"print(\"Parameter file, absolute path:\", os.path.abspath(paramPath))"
]
},
{
Expand Down Expand Up @@ -134,9 +135,9 @@
"# Instantiate the extractor\n",
"extractor = featureextractor.RadiomicsFeaturesExtractor()\n",
"\n",
"print \"Extraction parameters:\\n\\t\", extractor.kwargs\n",
"print \"Enabled filters:\\n\\t\", extractor.inputImages\n",
"print \"Enabled features:\\n\\t\", extractor.enabledFeatures"
"print(\"Extraction parameters:\\n\\t\", extractor.kwargs)\n",
"print(\"Enabled filters:\\n\\t\", extractor.inputImages)\n",
"print(\"Enabled features:\\n\\t\", extractor.enabledFeatures)"
]
},
{
Expand Down Expand Up @@ -176,9 +177,9 @@
"# Instantiate the extractor\n",
"extractor = featureextractor.RadiomicsFeaturesExtractor(**params) # ** 'unpacks' the dictionary in the function call\n",
"\n",
"print \"Extraction parameters:\\n\\t\", extractor.kwargs\n",
"print \"Enabled filters:\\n\\t\", extractor.inputImages # Still the default settings\n",
"print \"Enabled features:\\n\\t\", extractor.enabledFeatures # Still the default settings"
"print(\"Extraction parameters:\\n\\t\", extractor.kwargs)\n",
"print(\"Enabled filters:\\n\\t\", extractor.inputImages # Still the default settings)\n",
"print(\"Enabled features:\\n\\t\", extractor.enabledFeatures # Still the default settings)"
]
},
{
Expand All @@ -205,9 +206,9 @@
"# This cell is equivalent to the previous cell\n",
"extractor = featureextractor.RadiomicsFeaturesExtractor(binWidth=20, sigma=[1, 2, 3], verbose=True) # Equivalent of code above\n",
"\n",
"print \"Extraction parameters:\\n\\t\", extractor.kwargs\n",
"print \"Enabled filters:\\n\\t\", extractor.inputImages # Still the default settings\n",
"print \"Enabled features:\\n\\t\", extractor.enabledFeatures # Still the default settings"
"print(\"Extraction parameters:\\n\\t\", extractor.kwargs)\n",
"print(\"Enabled filters:\\n\\t\", extractor.inputImages # Still the default settings)\n",
"print(\"Enabled features:\\n\\t\", extractor.enabledFeatures # Still the default settings)"
]
},
{
Expand Down Expand Up @@ -236,19 +237,19 @@
"source": [
"# Enable a filter (in addition to the 'Original' filter already enabled)\n",
"extractor.enableInputImageByName('LoG')\n",
"print \"\"\n",
"print \"Enabled filters:\\n\\t\", extractor.inputImages\n",
"print(\"\")\n",
"print(\"Enabled filters:\\n\\t\", extractor.inputImages)\n",
"\n",
"# Disable all feature classes, save firstorder\n",
"extractor.disableAllFeatures()\n",
"extractor.enableFeatureClassByName('firstorder')\n",
"print \"\"\n",
"print \"Enabled features:\\n\\t\", extractor.enabledFeatures\n",
"print(\"\")\n",
"print(\"Enabled features:\\n\\t\", extractor.enabledFeatures)\n",
"\n",
"# Specify some additional features in the GLCM feature class\n",
"extractor.enableFeaturesByName(glcm=['Autocorrelation', 'Homogeneity1', 'SumSquares'])\n",
"print \"\"\n",
"print \"Enabled features:\\n\\t\", extractor.enabledFeatures"
"print(\"\")\n",
"print(\"Enabled features:\\n\\t\", extractor.enabledFeatures)"
]
},
{
Expand Down Expand Up @@ -282,9 +283,9 @@
"# Instantiate the extractor\n",
"extractor = featureextractor.RadiomicsFeaturesExtractor(paramPath)\n",
"\n",
"print \"Extraction parameters:\\n\\t\", extractor.kwargs\n",
"print \"Enabled filters:\\n\\t\", extractor.inputImages\n",
"print \"Enabled features:\\n\\t\", extractor.enabledFeatures"
"print(\"Extraction parameters:\\n\\t\", extractor.kwargs)\n",
"print(\"Enabled filters:\\n\\t\", extractor.inputImages)\n",
"print(\"Enabled features:\\n\\t\", extractor.enabledFeatures)"
]
},
{
Expand Down Expand Up @@ -473,11 +474,11 @@
}
],
"source": [
"print \"Result type:\", type(result) # result is returned in a Python ordered dictionary\n",
"print \"\"\n",
"print \"Calculated features\"\n",
"print(\"Result type:\", type(result) # result is returned in a Python ordered dictionary)\n",
"print(\"\")\n",
"print(\"Calculated features\")\n",
"for key, value in result.iteritems():\n",
" print \"\\t\", key, \":\", value"
" print(\"\\t\", key, \":\", value)"
]
}
],
Expand Down