Adjust for testing against Python 3.11 and scipy 1.10 and current sci… #156
This check has been archived and is scheduled for deletion.
Learn more about checks retention
GitHub Actions / Unit Test Results
failed
Sep 30, 2023 in 0s
2 fail, 289 pass in 1h 20m 39s
Annotations
Check warning on line 0 in tests.Stoner.Image.test_core
github-actions / Unit Test Results
All 5 runs failed: test_attrs (tests.Stoner.Image.test_core)
artifacts/Unit Test Results (Python 3.10)/pytest.xml
artifacts/Unit Test Results (Python 3.11)/pytest.xml
artifacts/Unit Test Results (Python 3.7)/pytest.xml
artifacts/Unit Test Results (Python 3.8)/pytest.xml
artifacts/Unit Test Results (Python 3.9)/pytest.xml
Raw output
def test_attrs():
attrs=[x for x in dir(ImageArray([])) if not x.startswith("_")]
expected={6:1056,7:1062,8:1062,9:1062,10:1089}.get(spv[1],1054)
> assert len(attrs)==expected,"Length of ImageArray dir failed. {}".format(len(attrs))
E AssertionError: Length of ImageArray dir failed. 1087
E assert 1087 == 1062
E + where 1087 = len(['AffineTransform', 'BRIEF', 'CCW', 'CENSURE', 'CW', 'Cascade', ...])
/home/runner/work/Stoner-PythonCode/Stoner-PythonCode/tests/Stoner/Image/test_core.py:294: AssertionError
Check warning on line 0 in tests.Stoner.Image.test_core
github-actions / Unit Test Results
All 5 runs failed: test_methods (tests.Stoner.Image.test_core)
artifacts/Unit Test Results (Python 3.10)/pytest.xml
artifacts/Unit Test Results (Python 3.11)/pytest.xml
artifacts/Unit Test Results (Python 3.7)/pytest.xml
artifacts/Unit Test Results (Python 3.8)/pytest.xml
artifacts/Unit Test Results (Python 3.9)/pytest.xml
Raw output
def test_methods():
b=np.arange(12).reshape(3,4)
ifi = ImageFile(b)
ifi.asfloat(normalise=False, clip_negative=False) #convert in place
assert ifi.image.dtype.kind == 'f'
assert np.max(ifi) == 11.0
ifi.image == ifi.image*5
ifi.rescale_intensity()
assert np.allclose(ifi.image, np.linspace(0,1,12).reshape(3,4))
ifi.crop(0,3,0,None)
assert ifi.shape==(3,3) #check crop is forced to overwrite ifi despite shape change
datadir=path.join(__home__,"..","sample-data")
image=ImageFile(path.join(datadir,"kermit.png")).asfloat(normalise=False)
i2=image.clone.crop(5,_=True)
assert i2.shape==(469, 349),"Failed to trim box by integer"
i2=image.clone.crop(0.25,_=True)
assert i2.shape==(269, 269),"Failed to trim box by float"
i2=image.clone
i2.crop([0.1,0.2,0.05,0.1],_=True)
assert i2.shape==(24, 36),"Failed to trim box by sequence of floats"
assert image.aspect== pytest.approx(0.7494780793),"Aspect ratio failed"
assert image.centre==(239.5, 179.5),"Failed to read image.centre"
i2=image.CW
assert i2.shape==(359,479),"Failed to rotate clockwise"
i3=i2.CCW
assert i3.shape==(479,359),"Failed to rotate counter-clockwise"
i3=i2.flip_h
assert np.all(i3[:,0]==i2[:,-1]),"Flip Horizontal failled"
i3=i2.flip_v
assert np.all(i3[0,:]==i2[-1,:]),"Flip Horizontal failled"
i2=image.clone
i3=i2-127
assert i3.mean()==pytest.approx(33940.72596111909,rel=1E-2),"Subtract integer failed."
with pytest.raises(TypeError):
i2-"Gobble"
attrs=[x for x in dir(i2) if not x.startswith("_")]
expected={6:1060, 7:1066,8:1066,9:1066,10:1093}.get(spv[1],1058)
> assert len(attrs)==expected,"Length of ImageFile dir failed. {}:{}".format(expected,len(attrs))
E AssertionError: Length of ImageFile dir failed. 1066:1091
E assert 1091 == 1066
E + where 1091 = len(['AffineTransform', 'BRIEF', 'CCW', 'CENSURE', 'CW', 'Cascade', ...])
/home/runner/work/Stoner-PythonCode/Stoner-PythonCode/tests/Stoner/Image/test_core.py:366: AssertionError
Loading