-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
collate now supports minimal dimension + added more support in sample…
…s cacher + added interface validation utility (#349) * multiprocessing fix and helper func * path utilities and also moshikos change to solve hang on tests * PR comments implemented * path utils * changed default deepdiff behavior to ignore nans in comparison, added keys() items() and values() to our NDict, and tried to highlight more the faulting op in pipeline ops error * solved static code analysis raised issues * removed unreachable code in paths.py * * Added "remove_extension" to path utils * Changed default deepdiff behavior to ignore nans in comparison, * Added keys() items() and values() to our NDict (until now it returned empty iterables for those which is incorrect) * Tried to highlight more the faulting op in pipeline ops error * fixed a bug in head_1D_classifier * added a lightweight mode of DatasetDefault that doesn't hold any sample_ids. fixed a typo in samplers.py and added a describe method to NDict * fixing statically detected issues * added simple function caching utility * lite weight dataset default * fixed static checkers * fixed static code analysis related stuff * code cleanup * removed comments * implemented PR comments * added hints and better error messages for common mistakes when providing pipeline ops list * linters etc. * activation checkpointing * ... * activation checkpointing * removed unneeded files * added ability to ignore kwargs in function string descriptor building logic, and solved an issue in run_multiprocessed in verbose=0 case * ... * added support for maxtasksperchild in run_multiprocessed * static code analysis based fixes * ... * multiprocessing related improvements * added a utility to get available cpu cores num * added simple but useful helper function to add prefix to file basename * static code fixes * fixed info message on num_available_cores * num_available_cores works correctly now in distributed LSF/CCC setting as well now * static code checkers fixes * ... * added a common op for replacing entities * static code checkers * ... * removed too user specific dir paths from hash input string * address tuple in colate * shared memory utility helping to speed up processing significantly in cases that enough RAM is available * typo fix * added a check for available total memory * ... * ... * ... * ... * ... * storing with full path * storing with full path * storing with full path * collate now supports minimal dimension + added more support in samples cacher * collate now supports minimal dimension + added more support in samples cacher * PR comments * ... * added unit tests :) * unit tests * unit tests * ... * interface validator * PR comments * PR comments * fixing tests * fixing tests --------- Co-authored-by: Yoel Shoshan <[email protected]> Co-authored-by: Moshiko Raboh <[email protected]> Co-authored-by: Michal Ozery-Flato <[email protected]> Co-authored-by: [email protected] <[email protected]>
- Loading branch information
1 parent
967e156
commit d0a7250
Showing
12 changed files
with
460 additions
and
23 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
""" | ||
(C) Copyright 2021 IBM Corp. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
""" | ||
|
||
import unittest | ||
|
||
from fuse.utils.rand.seed import Seed | ||
from fuse.utils.file_io.file_io import save_hdf5_safe, load_hdf5 | ||
import numpy as np | ||
import tempfile | ||
import os | ||
from fuse.utils.file_io import path | ||
|
||
|
||
class TestPath(unittest.TestCase): | ||
""" | ||
Test path.py | ||
""" | ||
|
||
def setUp(self) -> None: | ||
pass | ||
|
||
def test_path_1(self) -> None: | ||
|
||
ans = path.add_base_prefix("/a/b/c/de/fg/banana.phone", "hohoho@") | ||
self.assertEqual(ans, "/a/b/c/de/fg/[email protected]") | ||
|
||
ans = path.change_extension("/a/b/c/de/fg/123.txt", "7zip") | ||
self.assertEqual(ans, "/a/b/c/de/fg/123.7zip") | ||
|
||
ans = path.change_extension("/a/b/c/de/fg/123.456.txt", "7zip") | ||
self.assertEqual(ans, "/a/b/c/de/fg/123.456.7zip") | ||
|
||
ans = path.get_extension("/a/b/c/de/fg/123.456.7zip") | ||
self.assertEqual(ans, ".7zip") | ||
|
||
ans = path.remove_extension("/a/b/c/de/fg/123.456.7zip") | ||
self.assertEqual(ans, "/a/b/c/de/fg/123.456") | ||
|
||
ans = path.get_valid_filename("test 1 2 3 he^^llo") | ||
self.assertEqual(ans, "test_1_2_3_he^^llo") | ||
|
||
def tearDown(self) -> None: | ||
pass | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
Oops, something went wrong.