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

afw/DM-8221: Add test helper for comparing Schemas. #119

Merged
merged 1 commit into from Nov 15, 2016

Conversation

TallJimbo
Copy link
Member

This is test support code used to help diagnose DM-8221 that may be useful long-term.

Copy link
Contributor

@r-owen r-owen 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.

indicating which features of schema items to compare. The returned
diff will always show all differences, but no diff will be shown if
the only differences are not included in the flags. Default is
`lsst.afw.table.Schema.IDENTICAL`, which checks everything.
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems a bit odd to show diffs that are not in the flags, but I'm guessing that made the code simpler.

In any case it's a minor point. This seems like a really useful utility.

Copy link
Member Author

Choose a reason for hiding this comment

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

You guessed correctly. It'd be really hard to actually modify the diff to pay attention to the flags.

msg = "%s, %s, and %s differ:\n%s" % (components[0].capitalize(),
", ".join(components[1:-1]),
components[-1], diff)
return msg
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would be a bit cleaner if you made a separate function that created the list of components (with or without capitalization--that could always be done afterwards since it would be a short string). Whether the gain is worth the cost of further coding is a valid question.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@TallJimbo TallJimbo merged commit f354919 into master Nov 15, 2016
@ktlim ktlim deleted the tickets/DM-8221 branch August 25, 2018 06:44
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