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

DM-10926: Incompatibility with NumPy 1.13 #249

Merged
merged 1 commit into from Jun 24, 2017
Merged

Conversation

pschella
Copy link

No description provided.

Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

I think this is a good usecase for np.testing. See comments.

@@ -127,9 +127,9 @@ def testFlagColumn(self):
"""Test that Flag columns can be viewed if copy=True or unviewable="copy".
"""
v1 = self.catalog.asAstropy(unviewable="copy")
self.assertFloatsAlmostEqual(v1["a4"], self.catalog["a4"])
self.assertFalse(np.any(np.logical_xor(v1["a4"], self.catalog["a4"])))
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if np.testing.assert_array_equal(v1["a4"], self.catalog["a4"]) (and similarly for the below) wouldn't be easier to interpret?

@@ -357,8 +357,9 @@ def testExtract(self):
]:
d = catalog.extract("*", **kwds)
self.assertFloatsEqual(d["a_b_c1"], catalog.get("a_b_c1")[idx])
self.assertFloatsEqual(d["a_b_c2"], catalog.get("a_b_c2")[idx])
self.assertFloatsEqual(d["a_d1"], catalog.get("a_d1")[idx])
self.assertFalse(np.any(np.logical_xor(
Copy link
Contributor

Choose a reason for hiding this comment

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

Another case where np.testing would probably clarify the purpose of the test.

allBits = self.catalog.getBits()
someBits = self.catalog.getBits(["a_flag", "c_flag"])
self.assertEqual(allBits.getMask("a_flag"), 0x1)
self.assertEqual(allBits.getMask("b_flag"), 0x2)
self.assertEqual(allBits.getMask("c_flag"), 0x4)
self.assertEqual(someBits.getMask(self.fluxFlagKey), 0x1)
self.assertEqual(someBits.getMask(self.shapeFlagKey), 0x2)
self.assertFloatsEqual((allBits.array & 0x1 != 0),
Copy link
Contributor

Choose a reason for hiding this comment

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

np.testing again?

@pschella pschella force-pushed the tickets/DM-10926 branch 2 times, most recently from 8df0f75 to 2e1d673 Compare June 24, 2017 12:45
- Stop using assertFloatEqual for non-float fields
@pschella pschella merged commit 5553885 into master Jun 24, 2017
@ktlim ktlim deleted the tickets/DM-10926 branch August 25, 2018 06:43
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.

None yet

2 participants