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

Raise exception in compare_dataset and fixes to comply #5932

Merged
merged 9 commits into from
Oct 11, 2023

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Oct 9, 2023

Let's see how bad it is. It is not too bad, some small bugs.

Resolves #5931

@hoxbro hoxbro marked this pull request as draft October 9, 2023 13:26
@@ -218,29 +218,29 @@ class TestDynamicMapInvocation(ComparisonTestCase):

def test_dynamic_kdims_only(self):
def fn(A,B):
return Scatter([(A,2)], label=A)
return Scatter([(B,2)], label=A)
Copy link
Member Author

Choose a reason for hiding this comment

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

This was a bug in our test.

@@ -740,7 +740,7 @@ def fn2(x, y):

overlaid = dmap * dmap2
overlay = overlaid[()]
self.assertEqual(overlay.Scatter.I, fn(0, 0))
self.assertEqual(overlay.Scatter.I, fn(None, None))
Copy link
Member Author

Choose a reason for hiding this comment

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

At some point, it could be that the dataframe in scatter returned (0, 0). But now it returns (None, None)

@codecov-commenter
Copy link

codecov-commenter commented Oct 9, 2023

Codecov Report

Merging #5932 (378b75e) into main (2060d59) will increase coverage by 0.02%.
Report is 2 commits behind head on main.
The diff coverage is 68.75%.

@@            Coverage Diff             @@
##             main    #5932      +/-   ##
==========================================
+ Coverage   88.42%   88.45%   +0.02%     
==========================================
  Files         313      313              
  Lines       65160    65215      +55     
==========================================
+ Hits        57619    57686      +67     
+ Misses       7541     7529      -12     
Flag Coverage Δ
ui-tests 23.27% <6.25%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
holoviews/tests/core/test_dynamic.py 99.45% <100.00%> (ø)
holoviews/tests/element/test_graphelement.py 99.10% <100.00%> (ø)
holoviews/tests/operation/test_datashader.py 97.64% <100.00%> (ø)
holoviews/tests/core/test_callable.py 98.67% <80.00%> (ø)
holoviews/element/comparison.py 89.70% <50.00%> (-0.72%) ⬇️

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

nodes = np.array(
[[-0.5, 0.866025, 0],
[0.5, -0.866025, 1]]
nodes = pd.DataFrame(
Copy link
Member Author

@hoxbro hoxbro Oct 9, 2023

Choose a reason for hiding this comment

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

It could be at some point, this worked with an array. This seems like a safe change to make.

else:
cls.compare_arrays(d1, d2, msg)
try:
np.testing.assert_equal(d1, d2)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is mainly to avoid exceptions if one type is int and the other is float.

@hoxbro hoxbro added the type: bug Something isn't correct or isn't working label Oct 9, 2023
@hoxbro
Copy link
Member Author

hoxbro commented Oct 9, 2023

Geoviews and hvplot do not seems to be affected by these changes running their test locally.

@hoxbro hoxbro changed the title Raise comparison error Raise exception in compare_dataset and fixes to comply Oct 9, 2023
@hoxbro hoxbro marked this pull request as ready for review October 9, 2023 14:59
@@ -875,7 +875,7 @@ def test_regrid_mean_xarray_transposed(self):
self.assertEqual(regridded, expected)

def test_regrid_rgb_mean(self):
arr = (np.arange(10) * np.arange(5)[np.newaxis].T).astype('f')
arr = (np.arange(10) * np.arange(5)[np.newaxis].T).astype('float64')
Copy link
Member Author

@hoxbro hoxbro Oct 10, 2023

Choose a reason for hiding this comment

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

Could give precision problems with float32

@hoxbro hoxbro force-pushed the raise_dataset_error branch from c6cee2e to 378b75e Compare October 10, 2023 09:07
@hoxbro hoxbro added this to the 1.18.0 milestone Oct 10, 2023
@hoxbro hoxbro merged commit 6386616 into main Oct 11, 2023
@hoxbro hoxbro deleted the raise_dataset_error branch October 11, 2023 12:21
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testing framework fails to raise exceptions
2 participants