Skip to content

Commit

Permalink
Enable Python 3.5 for zorro only (No PySide==No Automator)
Browse files Browse the repository at this point in the history
  • Loading branch information
robbmcleod committed Dec 22, 2016
1 parent e4ba51c commit ac13e6b
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Expand Up @@ -12,6 +12,8 @@ ZORRO 0.7.3
initial classes.
* ReliablePy was moved to the mrcz package, as it is not really dependant on
Zorro.
* Installing on Python 3.5 is now possible, but it will not install Automator,
only Zorro and Numexprz.


ZORRO 0.7.2
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Expand Up @@ -25,7 +25,7 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISE
OF THE POSSIBILITY OF SUCH DAMAGE.


=====Numexprz is released under the MIT License=====
=====Numexprz is released under the BSD 2-clause License=====

Copyright (c) 2007,2008 David M. Cooke <david.m.cooke@gmail.com>
Copyright (c) 2009,2010 Francesc Alted <faltet@pytables.org>
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -29,7 +29,7 @@ Zorro is MIT license.


Automator
--------
---------

The Automator for Zorro and 2dx is a GUI interface to Zorro.

Expand Down
2 changes: 1 addition & 1 deletion automator/__version__.py
@@ -1 +1 @@
__version__ = '0.7.2b0'
__version__ = '0.7.3b0'
1 change: 1 addition & 0 deletions automator/setup.py
Expand Up @@ -29,6 +29,7 @@ def configuration( parent_package='', top_path=None ):
config.add_data_files( ('', 'automator/*.ini') )
config.add_data_files( ("", "automator/*.ui" ) )
config.add_data_files( ("", "automator/*.txt" ) )

config.make_config_py()
return config

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
@@ -1,6 +1,5 @@
numpy>=1.8
scipy>=0.12.0
pyfftw >= 0.10.4
pyside >= 1.2
matplotlib >= 1.4
mrcz >= 0.0.1
23 changes: 17 additions & 6 deletions setup.py
Expand Up @@ -2,7 +2,7 @@
###################################################################
# Zorro Dose-fractionated Image Registration Software
#
# License: Limited GNU Public License
# License: BSD
# Author: Robert A. McLeod
#
# See LICENSE.txt for details about copyright and
Expand Down Expand Up @@ -80,7 +80,7 @@
major_ver = 0
minor_ver = 7
nano_ver = 3
branch = 'b0'
branch = 'b1'

version = "%d.%d.%d%s" % (major_ver, minor_ver, nano_ver, branch)

Expand All @@ -91,9 +91,13 @@
fh.write( "__version__ = '" + version + "'\n" )


INSTALL_AUTOMATOR = True
if sys.version_info < (2, 7):
raise RuntimeError( "ZorroAutomator requires python 2.7 or greater" )

if sys.version_info > (3, 4):
print( "WARNING: PySide is not compatible with Python > 3.5, Automator will not be installed" )
INSTALL_AUTOMATOR = False

# Always prefer setuptools over distutils
try:
import setuptools
Expand Down Expand Up @@ -126,8 +130,9 @@ def configuration(parent_package=None,top_path=None):
os.chdir( here )
config.add_subpackage('numexprz')
os.chdir( here )
config.add_subpackage('automator')
os.chdir( here )
if INSTALL_AUTOMATOR:
config.add_subpackage('automator')
os.chdir( here )

config.add_data_files( (".", 'README.rst') )
config.add_data_files( (".", "LICENSE.txt") )
Expand All @@ -153,7 +158,7 @@ def setup_zorro():
author='Robert A. McLeod',
author_email='robert.mcleod@unibas.ch',
url='https://github.com/C-CINA/Zorro',
license='MIT',
license='BSD',
packages=[], # DON'T INLCUDE subpackages here in setuptools...
install_requires=requirements,
setup_requires=requirements,
Expand All @@ -164,6 +169,11 @@ def setup_zorro():
"ims = zorro.zorro_plotting:main" ],
},
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
extras_require={
':python_version <= "3.4"': [
'pyside',
],
},
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
Expand All @@ -184,6 +194,7 @@ def setup_zorro():
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',

# OS
'Operating System :: POSIX',
Expand Down
2 changes: 1 addition & 1 deletion zorro/__version__.py
@@ -1 +1 @@
__version__ = '0.7.2b0'
__version__ = '0.7.3b0'
3 changes: 2 additions & 1 deletion zorro/extract.py
Expand Up @@ -9,13 +9,14 @@
from __future__ import division, print_function, absolute_import

import numpy as np
from . import (ReliablePy, zorro_util, zorro)
from . import (zorro_util, zorro)
import time
import os, os.path, glob
import scipy.ndimage
import re
import collections
import mrcz
from mrcz import ReliablePy

# For a multiprocessing, maybe I should use subprocess pool and a master process? That would avoid having to
# any of the Python MPI libraries. Then again maybe I should just learn mpi4py, likely it would be a
Expand Down
5 changes: 3 additions & 2 deletions zorro/zorro.py
Expand Up @@ -138,7 +138,7 @@ def __init__( self ):
# for 'hot' in filterMode
self.hotpixInfo = { u"logisticK":6.0, u"relax":0.925, u"maxSigma":8.0, u"psf": u"K2",
u"guessHotpix":0, u"guessDeadpix":0, u"decorrOutliers":False,
u"cutoffLower":-4.0, u"cutoffUpper":3.25 }
u"cutoffLower":-4.0, u"cutoffUpper":3.25, u"neighborPix":0 }


self.FFTSum = None
Expand Down Expand Up @@ -2633,7 +2633,8 @@ def errorNormCDF( params ):
neighbourlyOutlierMask = nz.evaluate( "neighbourlyOutlierMask > neighbourThres" )
neighbourlyIndices = np.where( nz.evaluate( "neighbourlyOutlierMask > neighbourThres" ) )
bestMean = bestNorm.x[0] / m
print( "Number of neighbourly outlier pixels: %d" % len(neighbourlyIndices[0]) )
print( "Number of neighborly outlier pixels: %d" % len(neighbourlyIndices[0]) )
self.hotpixInfo[u'neighborPix'] = len(neighbourlyIndices[0])
neighbourFilt = np.zeros_like( psfFiltMean )
for (nY, nX) in zip( neighbourlyIndices[0], neighbourlyIndices[1] ):
# We'll use 5x5 here, substituting the bestMean if it's all garbage
Expand Down

0 comments on commit ac13e6b

Please sign in to comment.