[med-svn] [Git][med-team/nipy][master] 3 commits: Added autopkgtest

Israel Komolehin (@Komolehin) gitlab at salsa.debian.org
Mon Dec 11 12:46:30 GMT 2023



Israel Komolehin pushed to branch master at Debian Med / nipy


Commits:
10c532d7 by Komolehin Israel Timilehin at 2023-12-11T12:20:44+00:00
Added autopkgtest

- - - - -
f085d32f by Komolehin Israel Timilehin at 2023-12-11T12:42:21+00:00
Updated tests/control

- - - - -
1c4d195b by Komolehin Israel Timilehin at 2023-12-11T12:44:16+00:00
Updated changelog

- - - - -


3 changed files:

- debian/changelog
- + debian/tests/control
- + debian/tests/nipy_test.py


Changes:

=====================================
debian/changelog
=====================================
@@ -1,5 +1,6 @@
 nipy (0.5.0-9) UNRELEASED; urgency=medium
 
+  [ Andreas Tille ]
   * Team upload.
   * Add alternatives
       liblapack-dev | liblapack.so,
@@ -7,7 +8,11 @@ nipy (0.5.0-9) UNRELEASED; urgency=medium
   * Switch to cython3-legacy
     Closes: #1056823
 
- -- Andreas Tille <tille at debian.org>  Wed, 29 Nov 2023 10:17:22 +0100
+  [ Komolehin Israel Timilehin ]
+  * Added autopkgtest
+  
+
+ -- Komolehin Israel Timilehin <komolehinisrael at gmail.com>  Mon, 11 Dec 2023 12:43:32 +0000
 
 nipy (0.5.0-8) unstable; urgency=medium
 


=====================================
debian/tests/control
=====================================
@@ -0,0 +1,3 @@
+Test-Command: cd debian/tests && python3 -m pytest nipy_test.py
+Depends: python3-nipy, python3-nipy-lib, python-nipy-doc
+Restrictions: allow-stderr
\ No newline at end of file


=====================================
debian/tests/nipy_test.py
=====================================
@@ -0,0 +1,35 @@
+import pytest
+import numpy as np
+from nipy.testing import anatfile
+from nipy import load_image
+from nipy import save_image
+from nipy.core.api import Image, vox2mni
+
+# Reference for nipy example usage, visit official documentation
+# https://nipy.org/nipy/users/basic_io.html
+
+# fixture
+ at pytest.fixture
+def image_from_disk():
+    return load_image(anatfile)
+
+# Load Image from File
+def test_loaded_image_shape(image_from_disk):
+    assert image_from_disk.shape == (33, 41, 25)
+
+# Access Data into an Array
+def test_loaded_image_dimension(image_from_disk):
+    assert image_from_disk.ndim == 3
+
+# Save image to a File
+def test_image_save_to_file(tmp_path, image_from_disk):
+    output_file = tmp_path / 'newimagefile.nii'
+    newimg = save_image(image_from_disk, str(output_file))
+    assert output_file.is_file()
+
+
+# Create Image from an Array
+def test_create_image_from_array():
+    rawarray = np.zeros((43,128,128))
+    arr_img = Image(rawarray, vox2mni(np.eye(4)))
+    assert arr_img.shape == (43,128,128)
\ No newline at end of file



View it on GitLab: https://salsa.debian.org/med-team/nipy/-/compare/c31d2d2f861afb2c3bf6fdcb7cae8548e63fed01...1c4d195ba0460890d92a7d1959e484c657bffa41

-- 
View it on GitLab: https://salsa.debian.org/med-team/nipy/-/compare/c31d2d2f861afb2c3bf6fdcb7cae8548e63fed01...1c4d195ba0460890d92a7d1959e484c657bffa41
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20231211/766a9950/attachment-0001.htm>


More information about the debian-med-commit mailing list