Skip to content

Commit

Permalink
Remove matplotlib debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Aug 7, 2024
1 parent 323709d commit d69d718
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions tests/test_simpleButler.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,20 +816,6 @@ def test_region_queries(self):
# Use a region from the first visit.
first_visit_region = refs[0].dataId.visit.region

# Debug code to plot some visit detector regions.
# Will be removed.
polygons = []
with butler._query() as query:
results = query.dimension_records("visit_detector_region")
for rec in results:
region = rec.region.to_ivoa_pos()
coords = region.split()
coords.pop(0)
pairs = list(zip(coords[0::2], coords[1::2]))
polygons.append(pairs)
print(pairs)
# plot_poly(polygons)

# Get a visit detector region from the first ref.
with butler._query() as query:
results = query.dimension_records("visit_detector_region").where(**refs[0].dataId.mapping)
Expand Down Expand Up @@ -892,22 +878,6 @@ def test_time_queries(self):
self.assertEqual(len(list(with_ts)), 16)


def plot_poly(polygons: list[list[tuple[float, float], ...]]):
"""Plot polygons."""
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon

fig, ax = plt.subplots(1, 1)

for poly in polygons:
polygon1 = Polygon(poly, fc=(1, 0, 0, 0.1), ec=(0, 0, 0, 0.25), lw=1)
ax.add_patch(polygon1)

plt.ylim(-0.6, 0)
plt.xlim(320.6, 321.12)
plt.show()


class NameKeyCollectionManagerDirectSimpleButlerTestCase(DirectSimpleButlerTestCase, unittest.TestCase):
"""Run tests against DirectButler implementation using the
NameKeyCollectionsManager.
Expand Down

0 comments on commit d69d718

Please sign in to comment.