Skip to content
Snippets Groups Projects
Commit 00b98b7b authored by Martin Kuban's avatar Martin Kuban
Browse files

first failing unit test

parent 3ac5a4e3
No related branches found
No related tags found
No related merge requests found
......@@ -10,5 +10,8 @@ class DOSFingerprint():
self.indices = []
def calculate(dos_energies, dos_values):
def calculate(self, dos_energies, dos_values):
pass
def _integrate_to_bins(self, xs, ys):
return xs, ys
\ No newline at end of file
import pytest
import numpy as np
from nomad_dos_fingerprints import DOSFingerprint
def test_integrate_to_bins():
test_data_x = np.linspace(0, np.pi, num = 100)
test_data_y = [np.sin(x) for x in test_data_x]
fp = DOSFingerprint()
energies, dos = fp._integrate_to_bins(test_data_x, test_data_y)
assert np.isclose(sum(dos), 2)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment