Skip to content

Commit

Permalink
Add message for examples in TF
Browse files Browse the repository at this point in the history
  • Loading branch information
ninamiolane committed Dec 28, 2018
1 parent f57411a commit 3b5d003
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 27 deletions.
10 changes: 7 additions & 3 deletions examples/plot_geodesics_h2.py
Expand Up @@ -6,8 +6,6 @@
import matplotlib.pyplot as plt
import numpy as np
import os
# Examples with visualizations are only implemented with numpy
os.environ['GEOMSTATS_BACKEND'] = 'numpy' # NOQA

import geomstats.visualization as visualization

Expand Down Expand Up @@ -64,4 +62,10 @@ def main():


if __name__ == "__main__":
main()
if os.environ['GEOMSTATS_BACKEND'] == 'tensorflow':
print('Examples with visualizations are only implemented '
'with numpy backend.\n'
'To change backend, write: '
'export GEOMSTATS_BACKEND = \'numpy\'.')
else:
main()
10 changes: 7 additions & 3 deletions examples/plot_geodesics_s2.py
Expand Up @@ -5,8 +5,6 @@
import matplotlib.pyplot as plt
import numpy as np
import os
# Examples with visualizations are only implemented with numpy
os.environ['GEOMSTATS_BACKEND'] = 'numpy' # NOQA

import geomstats.visualization as visualization

Expand All @@ -33,4 +31,10 @@ def main():


if __name__ == "__main__":
main()
if os.environ['GEOMSTATS_BACKEND'] == 'tensorflow':
print('Examples with visualizations are only implemented '
'with numpy backend.\n'
'To change backend, write: '
'export GEOMSTATS_BACKEND = \'numpy\'.')
else:
main()
10 changes: 7 additions & 3 deletions examples/plot_geodesics_se3.py
Expand Up @@ -6,8 +6,6 @@
import matplotlib.pyplot as plt
import numpy as np
import os
# Examples with visualizations are only implemented with numpy
os.environ['GEOMSTATS_BACKEND'] = 'numpy' # NOQA

import geomstats.visualization as visualization

Expand All @@ -33,4 +31,10 @@ def main():


if __name__ == "__main__":
main()
if os.environ['GEOMSTATS_BACKEND'] == 'tensorflow':
print('Examples with visualizations are only implemented '
'with numpy backend.\n'
'To change backend, write: '
'export GEOMSTATS_BACKEND = \'numpy\'.')
else:
main()
10 changes: 7 additions & 3 deletions examples/plot_geodesics_so3.py
Expand Up @@ -6,8 +6,6 @@
import matplotlib.pyplot as plt
import numpy as np
import os
# Examples with visualizations are only implemented with numpy
os.environ['GEOMSTATS_BACKEND'] = 'numpy' # NOQA

import geomstats.visualization as visualization

Expand All @@ -32,4 +30,10 @@ def main():


if __name__ == "__main__":
main()
if os.environ['GEOMSTATS_BACKEND'] == 'tensorflow':
print('Examples with visualizations are only implemented '
'with numpy backend.\n'
'To change backend, write: '
'export GEOMSTATS_BACKEND = \'numpy\'.')
else:
main()
10 changes: 7 additions & 3 deletions examples/plot_grid_h2.py
Expand Up @@ -6,8 +6,6 @@
import matplotlib.pyplot as plt
import numpy as np
import os
# Examples with visualizations are only implemented with numpy
os.environ['GEOMSTATS_BACKEND'] = 'numpy' # NOQA

import geomstats.visualization as visualization

Expand Down Expand Up @@ -46,4 +44,10 @@ def main(left=-128,


if __name__ == "__main__":
main()
if os.environ['GEOMSTATS_BACKEND'] == 'tensorflow':
print('Examples with visualizations are only implemented '
'with numpy backend.\n'
'To change backend, write: '
'export GEOMSTATS_BACKEND = \'numpy\'.')
else:
main()
9 changes: 8 additions & 1 deletion examples/plot_quantization_s1.py
Expand Up @@ -4,6 +4,7 @@
"""

import matplotlib.pyplot as plt
import os

import geomstats.visualization as visualization

Expand Down Expand Up @@ -39,4 +40,10 @@ def main():


if __name__ == "__main__":
main()
if os.environ['GEOMSTATS_BACKEND'] == 'tensorflow':
print('Examples with visualizations are only implemented '
'with numpy backend.\n'
'To change backend, write: '
'export GEOMSTATS_BACKEND = \'numpy\'.')
else:
main()
9 changes: 8 additions & 1 deletion examples/plot_quantization_s2.py
Expand Up @@ -4,6 +4,7 @@
"""

import matplotlib.pyplot as plt
import os

import geomstats.visualization as visualization

Expand Down Expand Up @@ -40,4 +41,10 @@ def main():


if __name__ == "__main__":
main()
if os.environ['GEOMSTATS_BACKEND'] == 'tensorflow':
print('Examples with visualizations are only implemented '
'with numpy backend.\n'
'To change backend, write: '
'export GEOMSTATS_BACKEND = \'numpy\'.')
else:
main()
10 changes: 7 additions & 3 deletions examples/plot_square_h2_klein_disk.py
Expand Up @@ -5,8 +5,6 @@
import matplotlib.pyplot as plt
import numpy as np
import os
# Examples with visualizations are only implemented with numpy
os.environ['GEOMSTATS_BACKEND'] = 'numpy' # NOQA

import geomstats.visualization as visualization

Expand Down Expand Up @@ -45,4 +43,10 @@ def main():


if __name__ == "__main__":
main()
if os.environ['GEOMSTATS_BACKEND'] == 'tensorflow':
print('Examples with visualizations are only implemented '
'with numpy backend.\n'
'To change backend, write: '
'export GEOMSTATS_BACKEND = \'numpy\'.')
else:
main()
10 changes: 7 additions & 3 deletions examples/plot_square_h2_poincare_disk.py
Expand Up @@ -5,8 +5,6 @@
import matplotlib.pyplot as plt
import numpy as np
import os
# Examples with visualizations are only implemented with numpy
os.environ['GEOMSTATS_BACKEND'] = 'numpy' # NOQA

import geomstats.visualization as visualization

Expand Down Expand Up @@ -47,4 +45,10 @@ def main():


if __name__ == "__main__":
main()
if os.environ['GEOMSTATS_BACKEND'] == 'tensorflow':
print('Examples with visualizations are only implemented '
'with numpy backend.\n'
'To change backend, write: '
'export GEOMSTATS_BACKEND = \'numpy\'.')
else:
main()
10 changes: 7 additions & 3 deletions examples/plot_square_h2_poincare_half_plane.py
Expand Up @@ -5,8 +5,6 @@
import matplotlib.pyplot as plt
import numpy as np
import os
# Examples with visualizations are only implemented with numpy
os.environ['GEOMSTATS_BACKEND'] = 'numpy' # NOQA

import geomstats.visualization as visualization

Expand Down Expand Up @@ -47,4 +45,10 @@ def main():


if __name__ == "__main__":
main()
if os.environ['GEOMSTATS_BACKEND'] == 'tensorflow':
print('Examples with visualizations are only implemented '
'with numpy backend.\n'
'To change backend, write: '
'export GEOMSTATS_BACKEND = \'numpy\'.')
else:
main()
2 changes: 1 addition & 1 deletion tests/test_examples.py
Expand Up @@ -20,9 +20,9 @@
import examples.plot_square_h2_poincare_disk as plot_square_h2_poincare_disk
import examples.plot_square_h2_poincare_half_plane as plot_square_h2_poincare_half_plane # NOQA
import examples.plot_square_h2_klein_disk as plot_square_h2_klein_disk
import examples.tangent_pca_so3 as tangent_pca_so3
import examples.plot_quantization_s1 as plot_quantization_s1
import examples.plot_quantization_s2 as plot_quantization_s2
import examples.tangent_pca_so3 as tangent_pca_so3
import geomstats.tests


Expand Down

0 comments on commit 3b5d003

Please sign in to comment.