-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
memory improvements + possibility to detect single issues
- Loading branch information
1 parent
e5f5405
commit 527b4e0
Showing
10 changed files
with
151 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ scikit-image | |
codecov | ||
jupyter | ||
loguru | ||
memory-profiler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import shutil | ||
import tempfile | ||
import unittest | ||
from pathlib import Path | ||
|
||
import numpy as np | ||
|
||
from src.utils.utils import triu_indices_memmap | ||
|
||
|
||
class TestUtils(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
cls.temp_path = Path(tempfile.mkdtemp()) | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
shutil.rmtree(cls.temp_path) | ||
|
||
def test_triu_indices_memmap(self): | ||
l_N = np.arange(1, 100, 10) | ||
for N in l_N: | ||
l_k = np.arange(0, N) | ||
for k in l_k: | ||
triu_indices = np.triu_indices(N, k=k) | ||
triu_indices_mem = triu_indices_memmap( | ||
str(TestUtils.temp_path / "triu_indices"), | ||
N=N, | ||
k=k, | ||
) | ||
self.assertTrue(np.array_equal(triu_indices_mem, triu_indices)) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |