-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
39 additions
and
506 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 |
---|---|---|
|
@@ -75,3 +75,5 @@ target/ | |
|
||
# OS X extra files | ||
.DS_Store | ||
.aider* | ||
.env |
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 |
---|---|---|
@@ -1,32 +1,34 @@ | ||
''' | ||
""" | ||
Utility functions for tests. | ||
''' | ||
""" | ||
|
||
import os | ||
import time | ||
|
||
|
||
def data_path(name): | ||
''' | ||
""" | ||
Return the absolute path to a file in the test/data directory. | ||
The name specified should be relative to test/data. | ||
''' | ||
""" | ||
return os.path.join(os.path.dirname(__file__), "data", name) | ||
|
||
|
||
def initialize(): | ||
''' | ||
""" | ||
Initialize logging and tensorflow, numpy, and python random seeds. | ||
''' | ||
""" | ||
import logging | ||
|
||
logging.getLogger("tensorflow").disabled = True | ||
logging.getLogger("matplotlib").disabled = True | ||
|
||
import tensorflow as tf | ||
|
||
seed = int(os.environ.get("MHCFLURRY_TEST_SEED", 1)) | ||
if seed == 0: | ||
# Enable nondeterminism | ||
seed = int(time.time()) | ||
print("Using random seed", seed) | ||
tf.keras.utils.set_random_seed(seed) | ||
tf.config.experimental.enable_op_determinism() | ||
tf.config.experimental.enable_op_determinism() |
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
Oops, something went wrong.