forked from tensorflow/lucid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move io to lucid.misc.io, enable show in render, fix text mode readin…
…g by avoiding it, more structure for tests
- Loading branch information
Ludwig Schubert
committed
Feb 6, 2018
1 parent
42903b6
commit 148449a
Showing
32 changed files
with
620 additions
and
356 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright 2018 The Deepviz Authors. All Rights Reserved. | ||
# | ||
# 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. | ||
# ============================================================================== | ||
|
||
"""Ensuring compatibilty across environments, e.g. Jupyter/Colab/Shell.""" | ||
|
||
from __future__ import absolute_import, division, print_function | ||
|
||
|
||
def is_notebook_environment(): | ||
try: | ||
shell = get_ipython().__class__.__name__ | ||
if shell == 'ZMQInteractiveShell': | ||
return True # IPython Notebook | ||
elif shell == 'Shell': | ||
return True # Colaboratory Notebook | ||
elif shell == 'TerminalInteractiveShell': | ||
return False # Terminal running IPython | ||
else: | ||
return False # Other unknown type (?) | ||
except NameError: | ||
return False # Probably standard Python interpreter |
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,3 @@ | ||
These modules' names end on 'ing' so the three main public methods can stay as | ||
simple verbs ('load', 'save', and 'show') without creating namespace conflicts | ||
if you do need to import the module or some of the lower level methods. |
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,3 @@ | ||
from lucid.misc.io.showing import show | ||
from lucid.misc.io.loading import load | ||
from lucid.misc.io.saving import save |
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
Oops, something went wrong.