Skip to content

Commit

Permalink
Improve logging about storage class conversions in QG gen.
Browse files Browse the repository at this point in the history
If the storage classes are bidirectionally convertible, we just emit
a debug message, since this shouldn't cause any trouble.  If they're
only one-way convertible, it's now an info message rather than a
warning, because it's probably fine and the only problem is that the
code doing the logging is embarrassed that it can't really tell.
  • Loading branch information
TallJimbo committed Apr 7, 2023
1 parent bec71f6 commit 23cfa10
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions python/lsst/pipe/base/graphBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,28 @@ def fromSubset(
# stream code will be more explicit about input
# vs output incompatibilities.
existing = combined_by_name[datasetType.name]
if existing.is_compatible_with(datasetType) or datasetType.is_compatible_with(existing):
_LOG.warning(
"Dataset type mismatch (%s != %s) but continuing since they are compatible",
datasetType,
existing,
convertible_to_existing = existing.is_compatible_with(datasetType)
convertible_from_existing = datasetType.is_compatible_with(existing)

Check warning on line 164 in python/lsst/pipe/base/graphBuilder.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/graphBuilder.py#L163-L164

Added lines #L163 - L164 were not covered by tests
if convertible_to_existing and convertible_from_existing:
_LOG.debug(

Check warning on line 166 in python/lsst/pipe/base/graphBuilder.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/graphBuilder.py#L166

Added line #L166 was not covered by tests
"Dataset type %s has multiple fully compatible storage classes "
"%s and %s",
datasetType.name,
datasetType.storageClass_name,
existing.storageClass_name,
)
_dict[datasetType] = combined[existing]

Check warning on line 173 in python/lsst/pipe/base/graphBuilder.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/graphBuilder.py#L173

Added line #L173 was not covered by tests
elif convertible_to_existing or convertible_from_existing:
# We'd need to refactor a fair amount to recognize
# whether this is an error or not, so I'm not going to
# bother until we need to do that for other reasons
# (it won't be too long).
_LOG.info(

Check warning on line 179 in python/lsst/pipe/base/graphBuilder.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/pipe/base/graphBuilder.py#L179

Added line #L179 was not covered by tests
"Dataset type %s is present with multiple only partially-compatible storage "
"classes %s and %s.",
datasetType.name,
datasetType.storageClass_name,
existing.storageClass_name,
)
_dict[datasetType] = combined[existing]
else:
Expand Down

0 comments on commit 23cfa10

Please sign in to comment.