Skip to content

improved coverage#674

Open
Royboitoe wants to merge 1 commit intodata-8:masterfrom
Royboitoe:maps_xtd
Open

improved coverage#674
Royboitoe wants to merge 1 commit intodata-8:masterfrom
Royboitoe:maps_xtd

Conversation

@Royboitoe
Copy link

[ ] Added tests/test_coverage_increase.py and refactored tests/test_coverage_augmentation.py Updated with v0.18.2 entries for coverage goals and bug fixes
[ ] Updated with v0.18.2 entries for coverage goals and bug fixes
[ ] Incremented datascience/version.py from 0.18.1 to 0.18.2.

Increased total test coverage to 97% by adding comprehensive tests for interactive plotting and fixing identified bugs in Table.scatter.

icon_args['background_color'] = icon_args['border_color'] = icon_args.pop('color')
if icon_args['background_color'][1] == icon_args['background_color'][3] == icon_args['background_color'][5] == 'f':
icon_args['text_color'] = 'gray'
# White background, use black text for visibility
Copy link
Member

Choose a reason for hiding this comment

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

This seems unrelated to increasing coverage. Each pull request should have a single purpose. Please separate each bug fix / improvement into its own separate pull request.

if height is None:
height = 5

if "colors" in vargs and vargs["colors"]:
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer that this be in a separate pull request, and that the benefit / reason for this change be explained.

m, b = np.polyfit(x_data, self[label], 1)
minx, maxx = np.min(x_data),np.max(x_data)
axis.plot([minx,maxx],[m*minx+b,m*maxx+b], color=color)
line_color = color_list[0] if group is not None else color
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to see this in a separate pull request, with a justification/explanation for the purpose/rationale of this proposed change.

assert isinstance(html, str)
assert 'folium' in html.lower()

def test_inline_map():
Copy link
Member

Choose a reason for hiding this comment

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

We prefer to focus tests on the publicly callable API only, not on tests of internal methods.

@@ -0,0 +1,223 @@
"""
Copy link
Member

Choose a reason for hiding this comment

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

I think there should be a more useful/descriptive filename.

@@ -0,0 +1,333 @@

Copy link
Member

Choose a reason for hiding this comment

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

The filename could be more descriptive/useful.

t.to_csv(temp_name)
assert os.path.exists(temp_name)
df = pd.read_csv(temp_name)
assert list(df.columns) == ['a', 'b']
Copy link
Member

Choose a reason for hiding this comment

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

Would be useful to check that the values are correct as well.

plt.close('all')

def test_plot_branches():
"""Test various branches in Table.plot."""
Copy link
Member

Choose a reason for hiding this comment

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

I am not clear on the value of this test. It doesn't check the results of the plot. It seems like this is overfitting to improving the coverage metric without adding value (thus making coverage misleading).

t.plot()

def test_interactive_plots_coverage():
"""Test interactive plot methods to increase coverage."""
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't check that any of this code does the right thing, only that it doesn't throw an exception. I would prefer to avoid trivial tests just to increase coverage. The reason we want tests is to catch bugs in the code, not to game the coverage metric.

@@ -39,15 +39,15 @@ def test_draw_map(states):
def test_setup_map():
""" Tests that passing kwargs doesn't error. """
kwargs1 = {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for these bugfixes. Maybe should be in a separate PR, to keep bugfixes separate from additions of new tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments