Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fealho committed Jun 18, 2022
1 parent ad57d16 commit 65741a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
5 changes: 4 additions & 1 deletion tests/integration/constraints/test_tabular.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import numpy as np
import pandas as pd

from sdv.constraints import FixedIncrements, Inequality, Range, ScalarInequality, ScalarRange, create_custom_constraint
from sdv.constraints import (
create_custom_constraint, FixedIncrements, Inequality, Range, ScalarInequality, ScalarRange)
from sdv.tabular import GaussianCopula


def test_create_custom_constraint():
"""Test the ``create_custom_constraint`` method end to end."""
# Setup
Expand All @@ -22,6 +24,7 @@ def test_create_custom_constraint():
# Assert
assert all(sampled > 0)


def test_FixedIncrements():
"""Test the ``FixedIncrements`` constraint end to end."""
# Setup
Expand Down
13 changes: 6 additions & 7 deletions tests/unit/constraints/test_tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def test_create_custom_constraint_is_valid(self):
# Assert
expected_out = pd.Series([False, True, True, True, False])
pd.testing.assert_series_equal(valid_out, expected_out)

def test_create_custom_constraint_is_valid_wrong_shape(self):
"""Test ``is_valid`` method of ``CustomConstraint`` which produces data of wrong shape.
Expand All @@ -193,7 +193,6 @@ def test_create_custom_constraint_is_valid_wrong_shape(self):
with pytest.raises(InvalidFunctionError, match=err_msg):
custom_constraint.is_valid(data)


def test_create_custom_constraint_transform(self):
"""Test ``transform`` method of ``CustomConstraint``.
Expand All @@ -217,7 +216,7 @@ def test_create_custom_constraint_transform(self):
# Assert
expected_out = pd.DataFrame({'col': [100, 1, 0, 9, .25]})
pd.testing.assert_frame_equal(transform_out, expected_out)

def test_create_custom_constraint_transform_not_defined(self):
"""Test ``transform`` method of ``CustomConstraint`` when it wasn't defined.
Expand All @@ -237,7 +236,7 @@ def test_create_custom_constraint_transform_not_defined(self):
err_msg = 'Transform is not defined for this custom constraint.'
with pytest.raises(ValueError, match=err_msg):
custom_constraint.transform(data)

def test_create_custom_constraint_transform_wrong_shape(self):
"""Test ``transform`` method of ``CustomConstraint`` which produces data of wrong shape.
Expand Down Expand Up @@ -281,7 +280,7 @@ def test_create_custom_constraint_reverse_transform(self):
# Assert
expected_out = pd.DataFrame({'col': [100, 1, 0, 9, .25]})
pd.testing.assert_frame_equal(transformed_out, expected_out)

def test_create_custom_constraint_reverse_transform_not_defined(self):
"""Test ``reverse_transform`` method of ``CustomConstraint`` when it wasn't defined.
Expand All @@ -300,8 +299,8 @@ def test_create_custom_constraint_reverse_transform_not_defined(self):
err_msg = 'Reverse transform is not defined for this custom constraint.'
with pytest.raises(ValueError, match=err_msg):
custom_constraint.reverse_transform(data)
def test_create_custom_constraint_transform_wrong_shape(self):

def test_create_custom_constraint_reverse_transform_wrong_shape(self):
"""Test invalid ``reverse_transform`` method of ``CustomConstraint``
Call ``create_custom_constraint`` on a ``reverse_transform`` function
Expand Down

0 comments on commit 65741a0

Please sign in to comment.