-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
checkpointing: switch to noop operators if unavailable
- Loading branch information
Showing
7 changed files
with
66 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,24 @@ | ||
try: | ||
import pyrevolve as pyrevolve | ||
import pyrevolve as pyrevolve # noqa | ||
from .checkpoint import * # noqa | ||
except ImportError: | ||
pyrevolve = None | ||
pass | ||
|
||
|
||
class Noop(object): | ||
""" Dummy replacement in case pyrevolve isn't available. """ | ||
|
||
def __init__(self, *args, **kwargs): | ||
raise ImportError("Missing required `pyrevolve`; cannot use checkpointing") | ||
|
||
|
||
class NoopCheckpointOperator(Noop): | ||
pass | ||
|
||
|
||
class NoopCheckpoint(Noop): | ||
pass | ||
|
||
|
||
class NoopRevolver(Noop): | ||
pass |
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