Skip to content

Commit

Permalink
(test_WriteDescriptorDataToNPY) test the default destination
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardonpa committed Mar 17, 2024
1 parent 29193fc commit 74a31dd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pysipfenn/tests/test_pysipfenn.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,15 @@ def test_WriteDescriptorDataToNPY(self):

self.c.inputFiles = ['myStructure1.POSCAR', 'myStructure2.POSCAR', 'myStructure3.POSCAR', 'myStructure4.POSCAR']

self.c.writeDescriptorsToNPY(descriptor='KS2022',
file='TestFile_DescriptorData_4_KS2022_labeled_named.npy')
for file in ['TestFile_DescriptorData_4_KS2022_labeled_named.npy', 'descriptorData.npy']:
self.c.writeDescriptorsToNPY(descriptor='KS2022', file=file)

loaded_data = np.load('TestFile_DescriptorData_4_KS2022_labeled_named.npy')
np.testing.assert_array_equal(loaded_data, self.c.descriptorData)
if file == 'descriptorData.npy':
loaded_data = np.load('KS2022_' + file)
else:
loaded_data = np.load(file)

np.testing.assert_array_equal(loaded_data, self.c.descriptorData)

def test_CalculatorPrint(self):
'''Test that the Calculator.__str__() method returns the correctly formatted string after being initialized
Expand Down

0 comments on commit 74a31dd

Please sign in to comment.