Compare commits
31 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1541b002cf | ||
|
|
11d34df738 | ||
|
|
da098906cd | ||
|
|
4c7a8973e4 | ||
|
|
486d632150 | ||
|
|
5290d7a928 | ||
|
|
d2a7b915c0 | ||
|
|
9045c597ed | ||
| c51870c5f8 | |||
|
|
02981d87cd | ||
|
|
088b6e91b7 | ||
|
|
966f1b55f1 | ||
|
|
ea38e6114a | ||
|
|
bf5df5b94c | ||
|
|
4195457438 | ||
|
|
c5dcefb4bf | ||
|
|
4319882a52 | ||
|
|
364ade8e74 | ||
|
|
d285db0d71 | ||
|
|
c6bd733775 | ||
|
|
8df93f53c8 | ||
|
|
1c245457e5 | ||
|
|
7e2dbd9ab8 | ||
|
|
e718beab94 | ||
|
|
96ffe26c7f | ||
|
|
f22213e12a | ||
|
|
b445e8dd07 | ||
|
|
7b0448c8ac | ||
|
|
c0b8a0be59 | ||
|
|
25fc581843 | ||
|
|
9879c3bdb5 |
4 changed files with 663 additions and 34 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -8,3 +8,5 @@ vigra-1.7.0-src.tar.gz
|
|||
/vigra-1.11.0-src-clean.tar.gz
|
||||
/vigra-1.11.1-src.tar.gz
|
||||
/vigra-1.11.1-src-clean.tar.gz
|
||||
/vigra-1.11.2-src-clean.tar.gz
|
||||
/vigra-1.12.1-src-clean.tar.gz
|
||||
|
|
|
|||
2
sources
2
sources
|
|
@ -1,2 +1,2 @@
|
|||
SHA512 (vigra-1.11.1-src-clean.tar.gz) = 38c500dacf7a8b8bba22bd3aabaacd061589f76331f9ccf17c52096fa82ff510e531f2120326970789e0f22c4584c35fcb7bfc0eaffce80bea28e2f545a0e12f
|
||||
SHA512 (vigra-1.12.1-src-clean.tar.gz) = e42c2d5ce46c95ebe43c817b2b25336fc94fe4dc13393be5f78916b8911603c96baf5783b8f39aa87bee85c36c8ba51fe947519349f9cae7d272cf70ed58a445
|
||||
SHA512 (vigra-config.sh) = 03201ad578ff332cb1186bfa9d4871ada509a8322fb07bd38f00e9254b8c7766920621bb617fdebd927714539fe1ca2a56e7a1a8ce91f02bc2e92d3572d47cb9
|
||||
|
|
|
|||
566
vigra-1.11.2-nose-to-pytest.patch
Normal file
566
vigra-1.11.2-nose-to-pytest.patch
Normal file
|
|
@ -0,0 +1,566 @@
|
|||
From 4f801f896a44bcad723a0c253a2a6eb000f50e23 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Harfouche <mark.harfouche@gmail.com>
|
||||
Date: Sat, 30 Sep 2023 15:36:36 -0400
|
||||
Subject: [PATCH 1/3] Migrate to pytest
|
||||
|
||||
---
|
||||
config/FindVIGRANUMPY_DEPENDENCIES.cmake | 14 +++++++-------
|
||||
docsrc/installation.dxx | 2 +-
|
||||
vigranumpy/test/CMakeLists.txt | 10 +++++-----
|
||||
vigranumpy/test/test_arraytypes.py | 21 ++++++++++++++++-----
|
||||
4 files changed, 29 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/config/FindVIGRANUMPY_DEPENDENCIES.cmake b/config/FindVIGRANUMPY_DEPENDENCIES.cmake
|
||||
index 964ae92..c1a6495 100644
|
||||
--- a/config/FindVIGRANUMPY_DEPENDENCIES.cmake
|
||||
+++ b/config/FindVIGRANUMPY_DEPENDENCIES.cmake
|
||||
@@ -99,13 +99,13 @@ IF(Python_Interpreter_FOUND)
|
||||
#
|
||||
######################################################################
|
||||
execute_process(COMMAND ${Python_EXECUTABLE} -c
|
||||
- "import nose"
|
||||
- RESULT_VARIABLE PYTHON_NOSETESTS_NOT_FOUND)
|
||||
+ "import pytest"
|
||||
+ RESULT_VARIABLE PYTHON_PYTEST_NOT_FOUND)
|
||||
|
||||
- IF(NOT PYTHON_NOSETESTS_NOT_FOUND)
|
||||
- MESSAGE(STATUS "Searching for Python nosetests: ok")
|
||||
+ IF(NOT PYTHON_PYTEST_NOT_FOUND)
|
||||
+ MESSAGE(STATUS "Searching for Python pytest: ok")
|
||||
ELSE()
|
||||
- MESSAGE(STATUS "Could NOT find Python nosetests ('import nose' failed)")
|
||||
+ MESSAGE(STATUS "Could NOT find Python pytest ('import pytest' failed)")
|
||||
ENDIF()
|
||||
|
||||
######################################################################
|
||||
@@ -160,8 +160,8 @@ IF(Python_Interpreter_FOUND)
|
||||
if(TEST_VIGRANUMPY AND NOT VIGRANUMPY_DEPENDENCIES_FOUND)
|
||||
MESSAGE(FATAL_ERROR " vigranumpy dependencies NOT found while TEST_VIGRANUMPY=1")
|
||||
endif()
|
||||
- if(TEST_VIGRANUMPY AND PYTHON_NOSETESTS_NOT_FOUND)
|
||||
- MESSAGE(FATAL_ERROR " nosetests NOT found while TEST_VIGRANUMPY=1")
|
||||
+ if(TEST_VIGRANUMPY AND PYTHON_PYTEST_NOT_FOUND)
|
||||
+ MESSAGE(FATAL_ERROR " pytest NOT found while TEST_VIGRANUMPY=1")
|
||||
endif()
|
||||
ELSE()
|
||||
MESSAGE(STATUS "Python not found. Make sure that Python is in your PATH or set the appropriate variables as described in https://cmake.org/cmake/help/latest/module/FindPython.html")
|
||||
diff --git a/docsrc/installation.dxx b/docsrc/installation.dxx
|
||||
index e02e460..b44d21e 100755
|
||||
--- a/docsrc/installation.dxx
|
||||
+++ b/docsrc/installation.dxx
|
||||
@@ -13,7 +13,7 @@
|
||||
<li> <a href="http://www.doxygen.org/">doxygen</a> and <a href="http://www.python.org/">Python</a> to generate C++ documentation.
|
||||
<li> <a href="http://www.python.org/">Python</a>, <a href="http://www.boost.org/">boost_python</a>, and <a href="http://numpy.scipy.org/">numpy</a> to compile and run vigranumpy (the VIGRA Python bindings).
|
||||
<li> <a href="http://sphinx.pocoo.org/">sphinx</a> to generate vigranumpy documentation.
|
||||
- <li> <a href="http://readthedocs.org/docs/nose/en/latest/">nosetests</a> to execute the vigranumpy test suite.
|
||||
+ <li> <a href="https://docs.pytest.org/">pytest</a> to execute the vigranumpy test suite.
|
||||
</ul>
|
||||
|
||||
These dependencies are optional - the functionality will simply be unavailable if the libraries cannot be found.
|
||||
diff --git a/vigranumpy/test/CMakeLists.txt b/vigranumpy/test/CMakeLists.txt
|
||||
index 1c267a5..eca7c5f 100644
|
||||
--- a/vigranumpy/test/CMakeLists.txt
|
||||
+++ b/vigranumpy/test/CMakeLists.txt
|
||||
@@ -84,7 +84,7 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
-IF(NOT PYTHON_NOSETESTS_NOT_FOUND)
|
||||
+IF(NOT PYTHON_PYTEST_NOT_FOUND)
|
||||
# copy the individual test scripts
|
||||
FOREACH(test_script ${TEST_SCRIPTS})
|
||||
ADD_CUSTOM_COMMAND(
|
||||
@@ -122,7 +122,7 @@ IF(NOT PYTHON_NOSETESTS_NOT_FOUND)
|
||||
get_filename_component(PYTHON_PATH ${Python_EXECUTABLE} PATH)
|
||||
get_filename_component(PYTHON_EXE ${Python_EXECUTABLE} NAME)
|
||||
SET(EXTRA_PATH "${PYTHON_PATH}${PATHSEP}${EXTRA_PATH}")
|
||||
- SET(VIGRA_TEST_EXECUTABLE "${PYTHON_EXE} -c \"import nose; nose.main()\" . %CONFIGURATION%")
|
||||
+ SET(VIGRA_TEST_EXECUTABLE "${PYTHON_EXE} -m pytest . %CONFIGURATION%")
|
||||
SET(VIGRA_TEST_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/run_vigranumpytest.bat")
|
||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config/run_test.bat.in
|
||||
${VIGRA_TEST_SCRIPT}.in
|
||||
@@ -130,7 +130,7 @@ IF(NOT PYTHON_NOSETESTS_NOT_FOUND)
|
||||
file(GENERATE OUTPUT "${VIGRA_TEST_SCRIPT}"
|
||||
INPUT "${VIGRA_TEST_SCRIPT}.in")
|
||||
ELSE()
|
||||
- SET(VIGRA_TEST_EXECUTABLE "${Python_EXECUTABLE} -c \"import nose; nose.main()\" .")
|
||||
+ SET(VIGRA_TEST_EXECUTABLE "${Python_EXECUTABLE} -m pytest .")
|
||||
SET(VIGRA_TEST_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/run_vigranumpytest.sh")
|
||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config/run_test.sh.in
|
||||
${VIGRA_TEST_SCRIPT}.in
|
||||
@@ -161,11 +161,11 @@ IF(NOT PYTHON_NOSETESTS_NOT_FOUND)
|
||||
if(MSVC AND NOT (MSVC_VERSION VERSION_LESS "11"))
|
||||
# FIXME: this may not portable between VC versions (works for 11.0 - 14.0)
|
||||
set(VIGRA_TEST_EXE "${Python_EXECUTABLE}")
|
||||
- set(VIGRA_TEST_ARGS "-c \"import nose; nose.main()\" . \$(Configuration)")
|
||||
+ set(VIGRA_TEST_ARGS "-m pytest . \$(Configuration)")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/config/testdebug.vcxproj.user.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/vigranumpytest.vcxproj.user
|
||||
@ONLY)
|
||||
endif()
|
||||
ELSE()
|
||||
- MESSAGE(STATUS " vigranumpy tests will NOT be executed (nosetests missing)")
|
||||
+ MESSAGE(STATUS " vigranumpy tests will NOT be executed (pytest missing)")
|
||||
ENDIF()
|
||||
diff --git a/vigranumpy/test/test_arraytypes.py b/vigranumpy/test/test_arraytypes.py
|
||||
index a0d92be..fb3f7bc 100644
|
||||
--- a/vigranumpy/test/test_arraytypes.py
|
||||
+++ b/vigranumpy/test/test_arraytypes.py
|
||||
@@ -33,21 +33,19 @@
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
-# run with a simple 'nosetests' in this directory
|
||||
-# (and nose installed, i.e. 'easy_install nose')
|
||||
+# run with a simple 'pytest' in this directory
|
||||
+# (and pytest installed, i.e. 'pip install pytest' or 'conda install pytest')
|
||||
|
||||
from __future__ import division, print_function
|
||||
from functools import reduce
|
||||
|
||||
import sys
|
||||
-print("\nexecuting test file", __file__, file=sys.stderr)
|
||||
exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec'))
|
||||
# import vigra # FIXME: without this line, C++ constructors don't find VigraArray
|
||||
import vigra.arraytypes as arraytypes
|
||||
import vigra.ufunc as ufunc
|
||||
import numpy, copy
|
||||
import vigranumpytest as vt
|
||||
-from nose.tools import assert_equal, raises, assert_true
|
||||
|
||||
from vigra.arraytypes import AxisTags, AxisInfo
|
||||
import platform
|
||||
@@ -75,6 +73,19 @@ for n, f in vt.__dict__.items():
|
||||
if n.startswith('test'):
|
||||
allTests.add(n)
|
||||
|
||||
+# 2023/09
|
||||
+# Small compatibility shims with old code that used
|
||||
+# assert_equal and assert_true
|
||||
+# from nosetest. Rewriting the tests to use python's assert statement
|
||||
+# was decided to be too invasive.
|
||||
+def assert_equal(x, y):
|
||||
+ assert x == y
|
||||
+
|
||||
+
|
||||
+def assert_true(x):
|
||||
+ assert x
|
||||
+
|
||||
+
|
||||
def checkShape(shape1, shape2):
|
||||
assert_equal(shape1, shape2)
|
||||
|
||||
@@ -455,7 +466,7 @@ def checkCompatibility(obj, compatible):
|
||||
except Exception:
|
||||
print("exception in %s with shape %s strides %s tags (%s)" % (n, obj.shape, obj.strides,
|
||||
repr(getattr(obj, "axistags", "none"))))
|
||||
- raise
|
||||
+ raise
|
||||
|
||||
def testAxisTags():
|
||||
axistags = AxisTags(AxisInfo.c(description="RGB"),
|
||||
From 980e3b816818cefc7c2ee57e69929126be075c92 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Detiste <alexandre.detiste@gmail.com>
|
||||
Date: Sun, 4 Aug 2024 00:49:32 +0200
|
||||
Subject: [PATCH 2/3] remove more Nose usage
|
||||
|
||||
---
|
||||
vigranumpy/test/test1.py | 36 +++++++++++++++---------------
|
||||
vigranumpy/test/test2.py | 1 -
|
||||
vigranumpy/test/test3.py | 3 +--
|
||||
vigranumpy/test/test4.py | 13 +++++------
|
||||
vigranumpy/test/test_arraytypes.py | 21 ++++++++---------
|
||||
vigranumpy/test/test_color.py | 23 ++++++++-----------
|
||||
vigranumpy/test/test_impex.py | 5 ++---
|
||||
vigranumpy/test/test_multidef.py | 2 +-
|
||||
8 files changed, 46 insertions(+), 58 deletions(-)
|
||||
|
||||
diff --git a/vigranumpy/test/test1.py b/vigranumpy/test/test1.py
|
||||
index bd63937..b341e9c 100644
|
||||
--- a/vigranumpy/test/test1.py
|
||||
+++ b/vigranumpy/test/test1.py
|
||||
@@ -38,7 +38,7 @@ import sys
|
||||
print("\nexecuting test file", __file__, file=sys.stderr)
|
||||
exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec'))
|
||||
|
||||
-from nose.tools import assert_equal, raises, assert_raises
|
||||
+from nose.tools import raises, assert_raises
|
||||
import vigra
|
||||
import numpy as np
|
||||
from vigra.analysis import *
|
||||
@@ -68,10 +68,10 @@ def checkShape(shape1, shape2):
|
||||
shape1 = shape1.shape
|
||||
if isinstance(shape2, np.ndarray):
|
||||
shape2 = shape2.shape
|
||||
- assert_equal(shape1, shape2)
|
||||
+ assert shape1 == shape2
|
||||
|
||||
def checkType(i,type):
|
||||
- assert_equal(i.dtype, type)
|
||||
+ assert i.dtype == type
|
||||
|
||||
def checkAboutSame(i1,i2):
|
||||
compare_shapes(i1.shape, i2.shape)
|
||||
@@ -178,8 +178,8 @@ def test_MinimaMaxima():
|
||||
|
||||
def test_Region2Crack():
|
||||
res = regionImageToCrackEdgeImage(img_scalar_i)
|
||||
- assert_equal(img_scalar_f.shape[0]*2-1, res.shape[0])
|
||||
- assert_equal(img_scalar_f.shape[1]*2-1, res.shape[1])
|
||||
+ assert img_scalar_f.shape[0]*2-1 == res.shape[0]
|
||||
+ assert img_scalar_f.shape[1]*2-1 == res.shape[1]
|
||||
checkType(res,res.dtype)
|
||||
|
||||
regionImageToCrackEdgeImage(img_scalar_i64[0:100,0:100], 1, img_scalar_i64)
|
||||
@@ -232,8 +232,8 @@ def test_edges():
|
||||
checkType(res, np.uint8)
|
||||
|
||||
res = shenCastanCrackEdgeImage(img_scalar_f, 1,128,255)
|
||||
- assert_equal(img_scalar_f.shape[0]*2-1, res.shape[0])
|
||||
- assert_equal(img_scalar_f.shape[1]*2-1, res.shape[1])
|
||||
+ assert img_scalar_f.shape[0]*2-1 == res.shape[0]
|
||||
+ assert img_scalar_f.shape[1]*2-1 == res.shape[1]
|
||||
|
||||
res1 = beautifyCrackEdgeImage(res, 1, 0)
|
||||
checkShape(res1, res)
|
||||
@@ -248,29 +248,29 @@ def test_edges():
|
||||
checkType(res, np.uint8)
|
||||
|
||||
res = boundaryTensor2D(img_scalar_f, 1)
|
||||
- assert_equal(img_scalar_f.shape[0], res.shape[0])
|
||||
- assert_equal(img_scalar_f.shape[1], res.shape[1])
|
||||
- assert_equal(res.shape[2], 3)
|
||||
+ assert img_scalar_f.shape[0] == res.shape[0]
|
||||
+ assert img_scalar_f.shape[1] == res.shape[1]
|
||||
+ assert res.shape[2] == 3
|
||||
checkType(res, np.float32)
|
||||
|
||||
res = hourGlassFilter2D(img_multi_f, 1, 2)
|
||||
- assert_equal(img_multi_f.shape[0], res.shape[0])
|
||||
- assert_equal(img_multi_f.shape[1], res.shape[1])
|
||||
+ assert img_multi_f.shape[0] == res.shape[0]
|
||||
+ assert img_multi_f.shape[1] == res.shape[1]
|
||||
checkType(res, np.float32)
|
||||
|
||||
res = tensorEigenRepresentation2D(img_multi_f)
|
||||
- assert_equal(img_multi_f.shape[0], res.shape[0])
|
||||
- assert_equal(img_multi_f.shape[1], res.shape[1])
|
||||
+ assert img_multi_f.shape[0] == res.shape[0]
|
||||
+ assert img_multi_f.shape[1] == res.shape[1]
|
||||
checkType(res, np.float32)
|
||||
|
||||
res = tensorTrace(img_multi_f)
|
||||
- assert_equal(img_multi_f.shape[0], res.shape[0])
|
||||
- assert_equal(img_multi_f.shape[1], res.shape[1])
|
||||
+ assert img_multi_f.shape[0] == res.shape[0]
|
||||
+ assert img_multi_f.shape[1] == res.shape[1]
|
||||
checkType(res, np.float32)
|
||||
|
||||
res = rieszTransformOfLOG2D(img_scalar_f, 1, 1, 1)
|
||||
- assert_equal(img_multi_f.shape[0], res.shape[0])
|
||||
- assert_equal(img_multi_f.shape[1], res.shape[1])
|
||||
+ assert img_multi_f.shape[0] == res.shape[0]
|
||||
+ assert img_multi_f.shape[1] == res.shape[1]
|
||||
checkType(res, np.float32)
|
||||
|
||||
|
||||
diff --git a/vigranumpy/test/test2.py b/vigranumpy/test/test2.py
|
||||
index dd23543..f5cd64e 100644
|
||||
--- a/vigranumpy/test/test2.py
|
||||
+++ b/vigranumpy/test/test2.py
|
||||
@@ -38,7 +38,6 @@ import sys
|
||||
print("\nexecuting test file", __file__, file=sys.stderr)
|
||||
exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec'))
|
||||
|
||||
-from nose.tools import assert_equal, raises
|
||||
import numpy as np
|
||||
from vigra import *
|
||||
from vigra.filters import *
|
||||
diff --git a/vigranumpy/test/test3.py b/vigranumpy/test/test3.py
|
||||
index e13dd81..c86e6a8 100644
|
||||
--- a/vigranumpy/test/test3.py
|
||||
+++ b/vigranumpy/test/test3.py
|
||||
@@ -38,7 +38,6 @@ import sys
|
||||
print("\nexecuting test file", __file__, file=sys.stderr)
|
||||
exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec'))
|
||||
|
||||
-from nose.tools import assert_equal, raises
|
||||
import numpy as np
|
||||
from vigra import *
|
||||
from vigra import arraytypes as at
|
||||
@@ -67,7 +66,7 @@ def checkShape(shape1, shape2):
|
||||
shape1 = shape1.shape
|
||||
if isinstance(shape2, np.ndarray):
|
||||
shape2 = shape2.shape
|
||||
- assert_equal(shape1, shape2)
|
||||
+ assert shape1 == shape2
|
||||
|
||||
def checkImages(i1,i2):
|
||||
checkShape(i1.shape, i2.shape)
|
||||
diff --git a/vigranumpy/test/test4.py b/vigranumpy/test/test4.py
|
||||
index bf89970..43f1bff 100644
|
||||
--- a/vigranumpy/test/test4.py
|
||||
+++ b/vigranumpy/test/test4.py
|
||||
@@ -39,7 +39,6 @@ print("\nexecuting test file", __file__, file=sys.stderr)
|
||||
exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec'))
|
||||
|
||||
|
||||
-from nose.tools import assert_equal, raises
|
||||
import numpy as np
|
||||
import numpy as numpy
|
||||
from vigra import graphs as vigraph
|
||||
@@ -273,17 +272,17 @@ class TestGraph(object):
|
||||
g.addNode(3)
|
||||
nodes = [n for n in g.nodeIter()]
|
||||
assert len(nodes)==1
|
||||
- assert g.id(nodes[0]) == 3
|
||||
+ assert g.id(nodes[0]) == 3
|
||||
|
||||
g.addNode(6)
|
||||
nodes = [n for n in g.nodeIter()]
|
||||
assert len(nodes)==2
|
||||
- assert g.id(nodes[0]) == 3
|
||||
- assert g.id(nodes[1]) == 6
|
||||
+ assert g.id(nodes[0]) == 3
|
||||
+ assert g.id(nodes[1]) == 6
|
||||
|
||||
g.addNode(2)
|
||||
nodes = [n for n in g.nodeIter()]
|
||||
assert len(nodes)==3
|
||||
- assert g.id(nodes[0]) == 2
|
||||
- assert g.id(nodes[1]) == 3
|
||||
- assert g.id(nodes[2]) == 6
|
||||
\ No newline at end of file
|
||||
+ assert g.id(nodes[0]) == 2
|
||||
+ assert g.id(nodes[1]) == 3
|
||||
+ assert g.id(nodes[2]) == 6
|
||||
diff --git a/vigranumpy/test/test_arraytypes.py b/vigranumpy/test/test_arraytypes.py
|
||||
index fb3f7bc..9251b95 100644
|
||||
--- a/vigranumpy/test/test_arraytypes.py
|
||||
+++ b/vigranumpy/test/test_arraytypes.py
|
||||
@@ -75,16 +75,13 @@ for n, f in vt.__dict__.items():
|
||||
|
||||
# 2023/09
|
||||
# Small compatibility shims with old code that used
|
||||
-# assert_equal and assert_true
|
||||
+# assert_equal
|
||||
# from nosetest. Rewriting the tests to use python's assert statement
|
||||
# was decided to be too invasive.
|
||||
def assert_equal(x, y):
|
||||
assert x == y
|
||||
|
||||
|
||||
-def assert_true(x):
|
||||
- assert x
|
||||
-
|
||||
|
||||
def checkShape(shape1, shape2):
|
||||
assert_equal(shape1, shape2)
|
||||
@@ -177,7 +174,7 @@ def checkArray(cls, channels, dim, hasChannelAxis=True):
|
||||
if channels > 1:
|
||||
assert_equal(img.order, "V" if hasChannelAxis else "F")
|
||||
else:
|
||||
- assert_true(img.order in ['V', 'F'])
|
||||
+ assert img.order in ['V', 'F']
|
||||
assert_equal(img.flags.c_contiguous, False)
|
||||
|
||||
# test axistags
|
||||
@@ -186,7 +183,7 @@ def checkArray(cls, channels, dim, hasChannelAxis=True):
|
||||
assert_equal(img.withAxes('y', 'z', 'x', 'c').axistags, axistags4)
|
||||
assert_equal(img.withAxes('yzxc').axistags, axistags4)
|
||||
assert_equal(img.withAxes(axistags4).axistags, axistags4)
|
||||
- assert_true(img.withAxes(img.axistags) is img)
|
||||
+ assert img.withAxes(img.axistags) is img
|
||||
array = img.noTags()
|
||||
assert_equal(type(array), numpy.ndarray)
|
||||
assert_equal(arraytypes.taggedView(array, vaxistags).axistags, vaxistags)
|
||||
@@ -265,7 +262,7 @@ def checkArray(cls, channels, dim, hasChannelAxis=True):
|
||||
if channels > 1:
|
||||
assert_equal(img.order, "V" if hasChannelAxis else "F")
|
||||
else:
|
||||
- assert_true(img.order in ['V', 'F'])
|
||||
+ assert img.order in ['V', 'F']
|
||||
assert_equal(img.flags.c_contiguous, False)
|
||||
assert_equal(img.axistags, vaxistags)
|
||||
img[1,2] = value
|
||||
@@ -319,7 +316,7 @@ def checkArray(cls, channels, dim, hasChannelAxis=True):
|
||||
if channels > 1:
|
||||
assert_equal(img.order, "V" if hasChannelAxis else "F")
|
||||
else:
|
||||
- assert_true(img.order in ['V', 'F'])
|
||||
+ assert img.order in ['V', 'F']
|
||||
assert_equal(b.axistags, img.axistags)
|
||||
assert_equal(b.flags.c_contiguous, False)
|
||||
assert (b==img).all()
|
||||
@@ -1379,7 +1376,7 @@ def testSlicing():
|
||||
assert_equal(tags, a.axistags)
|
||||
|
||||
b = a[...]
|
||||
- assert_true((a==b).all())
|
||||
+ assert (a==b).all()
|
||||
assert_equal(tags, b.axistags)
|
||||
|
||||
b = a[...,0]
|
||||
@@ -1420,17 +1417,17 @@ def testSlicing():
|
||||
|
||||
b = a.subarray((4,3,2))
|
||||
assert_equal(b.shape, (4,3,2,2))
|
||||
- assert_true((a[:4,:3,:2,:]==b).all())
|
||||
+ assert (a[:4,:3,:2,:]==b).all()
|
||||
assert_equal(tags, b.axistags)
|
||||
|
||||
b = a.subarray((1,1,1),(4,3,2))
|
||||
assert_equal(b.shape, (3,2,1,2))
|
||||
- assert_true((a[1:4,1:3,1:2]==b).all())
|
||||
+ assert (a[1:4,1:3,1:2]==b).all()
|
||||
assert_equal(tags, b.axistags)
|
||||
|
||||
b = a.subarray((1,1,1,1),(4,3,2,2))
|
||||
assert_equal(b.shape, (3,2,1,1))
|
||||
- assert_true((a[1:4,1:3,1:2,1:]==b).all())
|
||||
+ assert (a[1:4,1:3,1:2,1:]==b).all()
|
||||
assert_equal(tags, b.axistags)
|
||||
|
||||
def testMethods():
|
||||
diff --git a/vigranumpy/test/test_color.py b/vigranumpy/test/test_color.py
|
||||
index 5551a97..74139e2 100644
|
||||
--- a/vigranumpy/test/test_color.py
|
||||
+++ b/vigranumpy/test/test_color.py
|
||||
@@ -38,7 +38,6 @@ import sys
|
||||
print("\nexecuting test file", __file__, file=sys.stderr)
|
||||
exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec'))
|
||||
|
||||
-from nose.tools import assert_equal, raises, assert_raises, assert_true
|
||||
import vigra
|
||||
import numpy
|
||||
|
||||
@@ -69,8 +68,8 @@ def test_gray2qimage():
|
||||
tmp2 = vigra.impex.readImage("tmp2.png")
|
||||
|
||||
for i in range(3):
|
||||
- assert_true( (tmp1 == tmp2[:,:,i]).all() )
|
||||
- assert_true( (tmp2[:,:,3] == 255).all() )
|
||||
+ assert (tmp1 == tmp2[:,:,i]).all()
|
||||
+ assert (tmp2[:,:,3] == 255).all()
|
||||
|
||||
def test_alphamodulated2qimage():
|
||||
if not _have_qt:
|
||||
@@ -93,15 +92,11 @@ def test_alphamodulated2qimage():
|
||||
tmp2 = byte_view(img)
|
||||
tmp2 = tmp2.swapaxes(0,1)
|
||||
|
||||
- assert_true( tmp1.shape[0:2] == tmp2.shape[0:2] )
|
||||
- assert_true( tmp2.ndim == 3 )
|
||||
- assert_true( tmp2.shape[2] == 4 )
|
||||
+ assert tmp1.shape[0:2] == tmp2.shape[0:2]
|
||||
+ assert tmp2.ndim == 3
|
||||
+ assert tmp2.shape[2] == 4
|
||||
|
||||
- assert_true( (tmp2[:,:,0] == 0).all() )
|
||||
- assert_true( (tmp2[:,:,2] == 0).all() )
|
||||
- assert_true( (tmp2[:,:,3] == tmp1).all() )
|
||||
- assert_true( (tmp2[:,:,1] == tmp1).all() )
|
||||
-
|
||||
-if __name__ == '__main__':
|
||||
- import nose
|
||||
- nose.run(defaultTest=__file__)
|
||||
+ assert (tmp2[:,:,0] == 0).all()
|
||||
+ assert (tmp2[:,:,2] == 0).all()
|
||||
+ assert (tmp2[:,:,3] == tmp1).all()
|
||||
+ assert (tmp2[:,:,1] == tmp1).all()
|
||||
diff --git a/vigranumpy/test/test_impex.py b/vigranumpy/test/test_impex.py
|
||||
index 3a2a0f5..0e94d17 100644
|
||||
--- a/vigranumpy/test/test_impex.py
|
||||
+++ b/vigranumpy/test/test_impex.py
|
||||
@@ -38,7 +38,6 @@ import sys
|
||||
print("\nexecuting test file", __file__, file=sys.stderr)
|
||||
exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec'))
|
||||
|
||||
-from nose.tools import assert_equal, raises
|
||||
import numpy as np
|
||||
import vigra.vigranumpycore # FIXME: why is this needed? (without, impex returns ndarray)
|
||||
import vigra.impex as im
|
||||
@@ -58,11 +57,11 @@ volumeFloat=at.Volume(np.random.rand(3,4,5,6)*100,dtype=np.float32,
|
||||
axistags=at.VigraArray.defaultAxistags(4, 'C'))
|
||||
|
||||
def checkEqualData(i1,i2):
|
||||
- assert_equal(i1.shape, i2.shape)
|
||||
+ assert i1.shape == i2.shape
|
||||
assert(np.all(i1==i2))
|
||||
|
||||
def checkUnequalData(i1,i2):
|
||||
- assert_equal(i1.shape, i2.shape)
|
||||
+ assert i1.shape == i2.shape
|
||||
assert(np.any(i1!=i2))
|
||||
|
||||
def test_multiImageTiff():
|
||||
diff --git a/vigranumpy/test/test_multidef.py b/vigranumpy/test/test_multidef.py
|
||||
index a993a22..ad66846 100644
|
||||
--- a/vigranumpy/test/test_multidef.py
|
||||
+++ b/vigranumpy/test/test_multidef.py
|
||||
@@ -38,7 +38,7 @@ import sys
|
||||
print("\nexecuting test file", __file__, file=sys.stderr)
|
||||
exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec'))
|
||||
|
||||
-from nose.tools import assert_equal, raises, assert_raises
|
||||
+from nose.tools import assert_raises
|
||||
import vigra
|
||||
import numpy as np
|
||||
|
||||
From 2b9b6e2b30f84b441dcc2119e408dac208d04f09 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Harfouche <mark.harfouche@gmail.com>
|
||||
Date: Sun, 4 Aug 2024 12:13:10 -0400
|
||||
Subject: [PATCH 3/3] Remove nose as test dependency
|
||||
|
||||
---
|
||||
vigranumpy/test/test1.py | 8 +++++++-
|
||||
vigranumpy/test/test_multidef.py | 8 +++++++-
|
||||
2 files changed, 14 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/vigranumpy/test/test1.py b/vigranumpy/test/test1.py
|
||||
index b341e9c..9f556e3 100644
|
||||
--- a/vigranumpy/test/test1.py
|
||||
+++ b/vigranumpy/test/test1.py
|
||||
@@ -38,13 +38,19 @@ import sys
|
||||
print("\nexecuting test file", __file__, file=sys.stderr)
|
||||
exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec'))
|
||||
|
||||
-from nose.tools import raises, assert_raises
|
||||
+import pytest
|
||||
import vigra
|
||||
import numpy as np
|
||||
from vigra.analysis import *
|
||||
from vigra.filters import *
|
||||
import vigra.arraytypes as at
|
||||
|
||||
+# Compatibility for
|
||||
+# from nose.tools import assert_raises
|
||||
+def assert_raises(error, func, *args, **kwargs):
|
||||
+ with pytest.raises(error):
|
||||
+ func(*args, **kwargs)
|
||||
+
|
||||
img_rgb_f = at.RGBImage(np.random.rand(100,200,3)*255,dtype=np.float32)
|
||||
img_scalar_f = at.ScalarImage(np.random.rand(100,200)*255,dtype=np.float32)
|
||||
img_multi_f = at.Vector3Image(np.random.rand(100,200,3)*255,dtype=np.float32)
|
||||
diff --git a/vigranumpy/test/test_multidef.py b/vigranumpy/test/test_multidef.py
|
||||
index ad66846..cd7d042 100644
|
||||
--- a/vigranumpy/test/test_multidef.py
|
||||
+++ b/vigranumpy/test/test_multidef.py
|
||||
@@ -38,10 +38,16 @@ import sys
|
||||
print("\nexecuting test file", __file__, file=sys.stderr)
|
||||
exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec'))
|
||||
|
||||
-from nose.tools import assert_raises
|
||||
+import pytest
|
||||
import vigra
|
||||
import numpy as np
|
||||
|
||||
+# Compatibility for
|
||||
+# from nose.tools import assert_raises
|
||||
+def assert_raises(error, func, *args, **kwargs):
|
||||
+ with pytest.raises(error):
|
||||
+ func(*args, **kwargs)
|
||||
+
|
||||
def checkAboutSame(i1,i2):
|
||||
assert(i1.shape==i2.shape)
|
||||
difference=np.sum(np.abs(i1-i2))/float(np.size(i1))
|
||||
127
vigra.spec
127
vigra.spec
|
|
@ -1,30 +1,19 @@
|
|||
Summary: Generic Programming for Computer Vision
|
||||
Name: vigra
|
||||
Version: 1.11.1
|
||||
Release: 47%{?dist}
|
||||
Version: 1.12.1
|
||||
Release: 13%{?dist}
|
||||
License: MIT
|
||||
# The "Lenna" files are non-free, we need to remove them from the source tarball.
|
||||
# wget https://github.com/ukoethe/vigra/releases/download/Version-1-11-1/vigra-1.11.1-src.tar.gz
|
||||
# tar xf vigra-1.11.1-src.tar.gz
|
||||
# find vigra-1.11.1/ -name "lenna*" -delete
|
||||
# tar zcf vigra-1.11.1-src-clean.tar.gz vigra-1.11.1/
|
||||
# wget https://github.com/ukoethe/vigra/archive/refs/tags/Version-1-12-1.tar.gz
|
||||
# tar -zxvf Version-1-12-1.tar.gz
|
||||
# mv vigra-Version-1-12-1 vigra-1.12.1
|
||||
# find vigra-1.12.1/ -name "lenna*" -delete
|
||||
# tar zcf vigra-1.12.1-src-clean.tar.gz vigra-1.12.1/
|
||||
Source0: %{name}-%{version}-src-clean.tar.gz
|
||||
Source1: vigra-config.sh
|
||||
# Backported from upstream master, fixes a build failure:
|
||||
# https://github.com/ukoethe/vigra/issues/414
|
||||
Patch0: https://github.com/ukoethe/vigra/commit/81958d302494e137f98a8b1d7869841532f90388.patch
|
||||
# Avoid attempt to install non-free 'lenna' files
|
||||
Patch1: vigra-1.10.0-no-lenna.patch
|
||||
Patch2: vigra-1.11.1.docdir.patch
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1597394
|
||||
Patch3: vigra-1.11.1.py37.patch
|
||||
# As of OpenEXR 3 upstream has significantly reorganized the libraries
|
||||
# including splitting out imath as a standalone library (which this project may
|
||||
# or may not need). Please see
|
||||
# https://github.com/AcademySoftwareFoundation/Imath/blob/master/docs/PortingGuide2-3.md
|
||||
# for porting details and encourage upstream to support it.
|
||||
# Minimal patch provided.
|
||||
Patch4: vigra-openexr3.patch
|
||||
URL: http://ukoethe.github.io/vigra/
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc-c++
|
||||
|
|
@ -41,13 +30,10 @@ Requires: python3
|
|||
BuildRequires: hdf5-devel
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: python3-sphinx
|
||||
%if 0%{?fedora} > 34
|
||||
BuildRequires: cmake(OpenEXR)
|
||||
BuildRequires: cmake(Imath)
|
||||
%else
|
||||
BuildRequires: OpenEXR-devel
|
||||
%endif
|
||||
BuildRequires: python3-numpy-f2py
|
||||
BuildRequires: python3-pytest
|
||||
BuildRequires: boost-python3
|
||||
BuildRequires: boost-python3-devel
|
||||
%else
|
||||
|
|
@ -61,8 +47,6 @@ structures. By using template techniques similar to those in the C++ Standard
|
|||
Template Library, you can easily adapt any VIGRA component to the needs of your
|
||||
application without thereby giving up execution speed.
|
||||
|
||||
#'
|
||||
|
||||
%package devel
|
||||
Summary: Development tools for programs which will use the vigra library
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
|
@ -103,7 +87,10 @@ sed -i 's=SET(BOOST_PYTHON_NAMES=& boost_python%{python3_version_nodots}=' \
|
|||
|
||||
export CXXFLAGS="%{optflags} -DH5_USE_110_API"
|
||||
%cmake -DWITH_OPENEXR=1 -DWITH_HDF5=1 -DWITH_VALGRIND=0 -DWITH_LEMON=0 \
|
||||
-DWITH_VIGRANUMPY=1 -DPYTHON_VERSION=%{python3_version}
|
||||
-DPYTHON_NUMPY_INCLUDE_DIR=%{_includedir}/numpy \
|
||||
-DWITH_VIGRANUMPY=1 -DVIGRANUMPY_INSTALL_DIR=%{python3_sitearch} \
|
||||
-DPYTHON_VERSION=%{python3_version} \
|
||||
-DCMAKE_CXX_FLAGS="-Wno-template-body %{build_cxxflags}"
|
||||
%cmake_build
|
||||
%else
|
||||
sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python}=' \
|
||||
|
|
@ -131,16 +118,12 @@ mv %{buildroot}/%{_libdir}/vigranumpy/VigranumpyConfig.cmake \
|
|||
make install DESTDIR=%{buildroot}
|
||||
%endif
|
||||
|
||||
rm -rf %{buildroot}/usr/doc
|
||||
rm -rf %{buildroot}%{_prefix}/doc
|
||||
(
|
||||
cd $RPM_BUILD_ROOT%{_bindir}
|
||||
cd %{buildroot}%{_bindir}
|
||||
mv vigra-config vigra-config-%{__isa_bits}
|
||||
)
|
||||
install -p -m755 -D %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/vigra-config
|
||||
|
||||
#fixme: this fails,
|
||||
#%check
|
||||
#make VERBOSE=1 check
|
||||
install -p -m755 -D %{SOURCE1} %{buildroot}%{_bindir}/vigra-config
|
||||
|
||||
%ldconfig_scriptlets
|
||||
|
||||
|
|
@ -153,7 +136,7 @@ install -p -m755 -D %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/vigra-config
|
|||
%{_bindir}/vigra-config*
|
||||
%{_libdir}/libvigraimpex.so
|
||||
%{_libdir}/vigra
|
||||
%doc doc/vigra doc/vigranumpy
|
||||
%doc doc/vigra
|
||||
|
||||
%if ! 0%{?rhel}
|
||||
%files -n python3-vigra
|
||||
|
|
@ -162,6 +145,84 @@ install -p -m755 -D %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/vigra-config
|
|||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed Jul 22 2026 Python Maint <python-maint@redhat.com> - 1.12.1-13
|
||||
- Rebuilt for Python 3.15.0b4 ABI change
|
||||
|
||||
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-12
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
|
||||
|
||||
* Thu Jun 04 2026 Python Maint <python-maint@redhat.com> - 1.12.1-11
|
||||
- Rebuilt for Python 3.15
|
||||
|
||||
* Sun May 31 2026 Richard Shaw <hobbes1069@gmail.com> - 1.12.1-10
|
||||
- Rebuild for OpenColorIO 2.5.2.
|
||||
|
||||
* Mon May 25 2026 Richard Shaw <hobbes1069@gmail.com> - 1.12.1-9
|
||||
- Rebuild for OpenEXR 3.4.12.
|
||||
|
||||
* Fri Apr 17 2026 Orion Poplawski <orion@nwra.com> - 1.12.1-8
|
||||
- Rebuild for hdf5 2.1
|
||||
|
||||
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
|
||||
|
||||
* Mon Jan 12 2026 Jonathan Wakely <jwakely@fedoraproject.org> - 1.12.1-6
|
||||
- Rebuilt for Boost 1.90
|
||||
|
||||
* Fri Sep 19 2025 Python Maint <python-maint@redhat.com> - 1.12.1-5
|
||||
- Rebuilt for Python 3.14.0rc3 bytecode
|
||||
|
||||
* Fri Aug 15 2025 Python Maint <python-maint@redhat.com> - 1.12.1-4
|
||||
- Rebuilt for Python 3.14.0rc2 bytecode
|
||||
|
||||
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||
|
||||
* Tue Jun 03 2025 Python Maint <python-maint@redhat.com> - 1.12.1-2
|
||||
- Rebuilt for Python 3.14
|
||||
|
||||
* Wed Jan 08 2025 Bruno Postle <bruno@postle.net> - 1.12.1-1
|
||||
- Upstream release
|
||||
- build with -Wno-template-body for gcc15 breakage bug #2341506
|
||||
|
||||
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.2-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||
|
||||
* Thu Jan 02 2025 Miro Hrončok <mhroncok@redhat.com> - 1.11.2-3
|
||||
- Drop a test dependency on deprecated python3-nose
|
||||
- https://fedoraproject.org/wiki/Changes/DeprecateNose
|
||||
|
||||
* Tue Dec 24 2024 Orion Poplawski <orion@nwra.com> - 1.11.2-2
|
||||
- Rebuild with numpy 2.x (rhbz#2333964)
|
||||
|
||||
* Sat Nov 30 2024 Bruno Postle <bruno@postle.net> - 1.11.2-1
|
||||
- Upstream maintenance release
|
||||
- dropped vigra-1.11.1.py37.patch, 81958d302494e137f98a8b1d7869841532f90388.patch and vigra-openexr3.patch
|
||||
|
||||
* Fri Oct 25 2024 Orion Poplawski <orion@nwra.com> - 1.11.1-55
|
||||
- Rebuild for hdf5 1.14.5
|
||||
|
||||
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.1-54
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
||||
|
||||
* Sun Jun 09 2024 Python Maint <python-maint@redhat.com> - 1.11.1-53
|
||||
- Rebuilt for Python 3.13
|
||||
|
||||
* Wed Apr 24 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.11.1-52
|
||||
- Rebuilt for openexr 3.2.4
|
||||
|
||||
* Wed Mar 13 2024 Bruno Postle <bruno@postle.net> - 1.11.1-51
|
||||
- Fixes for the benefit of flatpak builds (yselkowitz)
|
||||
|
||||
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.1-50
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Thu Jan 18 2024 Jonathan Wakely <jwakely@redhat.com> - 1.11.1-49
|
||||
- Rebuilt for Boost 1.83
|
||||
|
||||
* Fri Oct 06 2023 Bruno Postle <bruno@postle.net> - 1.11.1-48
|
||||
- Add python3-nose build dependency, try and avoid numpy.distutils
|
||||
|
||||
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.1-47
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue