Skip to content

Commit

Permalink
Merge pull request #11 from borondics/test_functions
Browse files Browse the repository at this point in the history
Starting to test functions
  • Loading branch information
borondics authored Jun 18, 2024
2 parents 14d3f81 + 785b502 commit 6983abe
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions pySNOM/tests/test_functions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import unittest
import os

import numpy as np

import pySNOM
from pySNOM import NeaImage


class test_public_functions(unittest.TestCase):
def test_normalize_simple(self):
f = 'datasets/image.gwy'
im = NeaImage()
im.read_from_gwyfile(os.path.join(pySNOM.__path__[0], f), 'M1A raw')

im2 = pySNOM.normalize_simple(im)

np.testing.assert_almost_equal(im2.data[4][8], -0.018852233886)
np.testing.assert_almost_equal(im2.data[7][5], 2.023254394531)

def self_reference(self):
# TODO for testing these we need to have a better test file with actual optical data
f = 'datasets/image.gwy'
im = NeaImage()
im.read_from_gwyfile(os.path.join(pySNOM.__path__[0], f), 'M1A raw')

pass


if __name__ == '__main__':
unittest.main()

0 comments on commit 6983abe

Please sign in to comment.