Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nose2 warnings #410

Merged
merged 5 commits into from
Jan 28, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion geomstats/geometry/riemannian_metric.py
@@ -1,6 +1,7 @@
"""Riemannian and pseudo-Riemannian metrics."""

import math
import warnings

import geomstats.backend as gs

Expand Down Expand Up @@ -460,7 +461,7 @@ def while_loop_body(iteration, mean, variance, sq_dist):
maximum_iterations=n_max_iterations)

if last_iteration == n_max_iterations:
print('Maximum number of iterations {} reached.'
warnings.warn('Maximum number of iterations {} reached.'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The continuous integration tests fail because of this line (flake8 complains). Could you pep8 the style? Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to run flake8 one last time before submitting PR. Just fixed it

'The mean may be inaccurate'.format(n_max_iterations))

if verbose:
Expand Down
4 changes: 4 additions & 0 deletions tests/test_connection.py
Expand Up @@ -2,6 +2,8 @@
Unit tests for the affine connections.
"""

import warnings

import geomstats.backend as gs
import geomstats.tests
from geomstats.geometry.connection import Connection, LeviCivitaConnection
Expand All @@ -11,6 +13,8 @@

class TestConnectionMethods(geomstats.tests.TestCase):
def setUp(self):
warnings.simplefilter('ignore', category=UserWarning)

self.dimension = 4
self.euc_metric = EuclideanMetric(dimension=self.dimension)
self.lc_connection = LeviCivitaConnection(self.euc_metric)
Expand Down
1 change: 1 addition & 0 deletions tests/test_examples.py
Expand Up @@ -35,6 +35,7 @@ def setUpClass(cls):

def setUp(self):
warnings.simplefilter('ignore', category=ImportWarning)
warnings.simplefilter('ignore', category=UserWarning)
plt.figure()

@geomstats.tests.np_only
Expand Down
1 change: 1 addition & 0 deletions tests/test_special_orthogonal.py
Expand Up @@ -22,6 +22,7 @@
class TestSpecialOrthogonalMethods(geomstats.tests.TestCase):
def setUp(self):
warnings.simplefilter('ignore', category=ImportWarning)
warnings.simplefilter('ignore', category=UserWarning)

gs.random.seed(1234)

Expand Down