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

issue 297: Update format of the report scores #301

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sdmetrics/reports/multi_table/quality_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def _print_results(self, out=sys.stdout):

for prop, score in self._property_breakdown.items():
if not pd.isna(score):
out.write(f'{prop}: {round(score * 100, 2)}%\n')
out.write(f'- {prop}: {round(score * 100, 2)}%\n')
elif self._property_errors[prop] > 0:
out.write(f'{prop}: Error computing property.\n')
out.write(f'- {prop}: Error computing property.\n')
else:
out.write(f'{prop}: NaN\n')
out.write(f'- {prop}: NaN\n')

def generate(self, real_data, synthetic_data, metadata, verbose=True):
"""Generate report.
Expand Down
6 changes: 3 additions & 3 deletions sdmetrics/reports/single_table/quality_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ def _print_results(self, out=sys.stdout):

for prop, score in self._property_breakdown.items():
if not pd.isna(score):
out.write(f'{prop}: {round(score * 100, 2)}%\n')
out.write(f'- {prop}: {round(score * 100, 2)}%\n')
elif self._property_errors[prop] > 0:
out.write(f'{prop}: Error computing property.\n')
out.write(f'- {prop}: Error computing property.\n')
else:
out.write(f'{prop}: NaN\n')
out.write(f'- {prop}: NaN\n')

def generate(self, real_data, synthetic_data, metadata, verbose=True):
"""Generate report.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1224,9 +1224,9 @@ def test__print_result(self):
mock_out.write.assert_has_calls([
call('\nOverall Quality Score: 80.0%\n\n'),
call('Properties:\n'),
call('Column Shapes: 60.0%\n'),
call('Column Pair Trends: 80.0%\n'),
call('Parent Child Relationships: 90.0%\n'),
call('- Column Shapes: 60.0%\n'),
call('- Column Pair Trends: 80.0%\n'),
call('- Parent Child Relationships: 90.0%\n'),
])

def test__print_result_with_error(self):
Expand Down Expand Up @@ -1262,9 +1262,9 @@ def test__print_result_with_error(self):
mock_out.write.assert_has_calls([
call('\nOverall Quality Score: 70.0%\n\n'),
call('Properties:\n'),
call('Column Shapes: 60.0%\n'),
call('Column Pair Trends: Error computing property.\n'),
call('Parent Child Relationships: 80.0%\n'),
call('- Column Shapes: 60.0%\n'),
call('- Column Pair Trends: Error computing property.\n'),
call('- Parent Child Relationships: 80.0%\n'),
])

def test__print_result_with_all_errors(self):
Expand Down Expand Up @@ -1300,7 +1300,7 @@ def test__print_result_with_all_errors(self):
mock_out.write.assert_has_calls([
call('\nOverall Quality Score: Error computing report.\n\n'),
call('Properties:\n'),
call('Column Shapes: Error computing property.\n'),
call('Column Pair Trends: Error computing property.\n'),
call('Parent Child Relationships: Error computing property.\n'),
call('- Column Shapes: Error computing property.\n'),
call('- Column Pair Trends: Error computing property.\n'),
call('- Parent Child Relationships: Error computing property.\n'),
])
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,8 @@ def test__print_result(self):
mock_out.write.assert_has_calls([
call('\nOverall Quality Score: 70.0%\n\n'),
call('Properties:\n'),
call('Column Shapes: 60.0%\n'),
call('Column Pair Trends: 80.0%\n'),
call('- Column Shapes: 60.0%\n'),
call('- Column Pair Trends: 80.0%\n'),
])

def test__print_result_with_error(self):
Expand Down Expand Up @@ -840,8 +840,8 @@ def test__print_result_with_error(self):
mock_out.write.assert_has_calls([
call('\nOverall Quality Score: 60.0%\n\n'),
call('Properties:\n'),
call('Column Shapes: 60.0%\n'),
call('Column Pair Trends: Error computing property.\n'),
call('- Column Shapes: 60.0%\n'),
call('- Column Pair Trends: Error computing property.\n'),
])

def test__print_result_with_all_errors(self):
Expand Down Expand Up @@ -869,6 +869,6 @@ def test__print_result_with_all_errors(self):
mock_out.write.assert_has_calls([
call('\nOverall Quality Score: Error computing report.\n\n'),
call('Properties:\n'),
call('Column Shapes: Error computing property.\n'),
call('Column Pair Trends: Error computing property.\n'),
call('- Column Shapes: Error computing property.\n'),
call('- Column Pair Trends: Error computing property.\n'),
])