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-36326: Simplify materialized skypix overlaps. #739

Merged
merged 1 commit into from Oct 6, 2022
Merged

Conversation

TallJimbo
Copy link
Member

@TallJimbo TallJimbo commented Oct 5, 2022

We were maintaining a lot of unused, probably too-clever code for dealing with spatial overlaps between regular database dimension elements and arbitrary skypix dimensions, while only overlaps with the common skypix dimension are actually supported everywhere else.

This commit drops that extra complexity, and with it an undesirable dependency on GovernorDimensionRecordStorage.values (which I'd like to remove) and some unnecessary table locking.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

Copy link
Contributor

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

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

Looks good, few minor comments.

@@ -125,28 +120,12 @@ def initialize(
table = context.addTable(element.name, spec)
else:
table = db.ensureTableExists(element.name, spec)
skyPixOverlap: _SkyPixOverlapStorage | None
skypix_overlap_tables: _SkyPixOverlapTables | None
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this declaration do anything useful?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch; it does not.

return result

def connect(self, overlaps: DatabaseDimensionOverlapStorage) -> None:
# Docstring inherited from DatabaseDimensionRecordStorage.
self._otherOverlaps.append(overlaps)

def _on_governor_insert(self, record: DimensionRecord) -> None:
"""A `GovernorDimensionRecordStorage.registerInsertionListener callback
Copy link
Contributor

Choose a reason for hiding this comment

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

Closing backtick is missing.

Record storage backend for this element's governor dimension.
Parameters
----------
records : `Sequence` [ `DimensionElement` ]
Copy link
Contributor

Choose a reason for hiding this comment

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

DimensionElement -> DimensionRecord?

to require users to explicitly materialize all relationships they will
want to use in queries.
This class (and the related methods in TableDimensionRecordStorage) can in
principle manage overlaps between with any skypix dimension, but at present
Copy link
Contributor

Choose a reason for hiding this comment

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

between with ?

We were maintaining a lot of unused, probably too-clever code for
dealing with spatial overlaps between regular database dimension
elements and arbitrary skypix dimensions, while only overlaps with
the common skypix dimension are actually supported everywhere else.

This commit drops that extra complexity, and with it an undesirable
dependency on GovernorDimensionRecordStorage.values (which I'd like to
remove) and some unnecessary table locking.
@codecov
Copy link

codecov bot commented Oct 6, 2022

Codecov Report

Base: 84.74% // Head: 84.79% // Increases project coverage by +0.04% 🎉

Coverage data is based on head (d976a5a) compared to base (a21ee8f).
Patch coverage: 95.65% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #739      +/-   ##
==========================================
+ Coverage   84.74%   84.79%   +0.04%     
==========================================
  Files         254      254              
  Lines       32960    32911      -49     
  Branches     5639     5618      -21     
==========================================
- Hits        27933    27907      -26     
+ Misses       3802     3783      -19     
+ Partials     1225     1221       -4     
Impacted Files Coverage Δ
...ython/lsst/daf/butler/registry/dimensions/table.py 94.68% <95.65%> (+9.02%) ⬆️
...on/lsst/daf/butler/registry/dimensions/governor.py 92.68% <0.00%> (-1.22%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@TallJimbo TallJimbo merged commit 3bd5c44 into main Oct 6, 2022
@TallJimbo TallJimbo deleted the tickets/DM-36326 branch October 6, 2022 14:49
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