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-29497: Issue deprecation warning for Mapper/Butler #127

Merged
merged 4 commits into from Mar 31, 2021
Merged

Conversation

timj
Copy link
Member

@timj timj commented Mar 29, 2021

This code implements three options:

  • Only issues one ever
  • Issues one per component (Butler or Mapper)
  • Always issues

I've defaulted it to only one ever for now.

@timj timj requested a review from ktlim March 29, 2021 22:04
import traceback
import warnings

ALWAYS = None
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought all-caps items were supposed to be constants. Should have a docstring; I believe the valid values are None, False, True?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I get it, despite its use in the test, it is supposed to be a hard-coded constant, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I'm not sure how we want to play it. I was leaving the ALWAYS=True option for when we need to get serious about removing things. I'm fine with making it a public variable.

python/lsst/daf/persistence/deprecation.py Outdated Show resolved Hide resolved
python/lsst/daf/persistence/mapper.py Outdated Show resolved Hide resolved
python/lsst/daf/persistence/deprecation.py Outdated Show resolved Hide resolved
This allows subclasses to issue the warning even if they
don't call __init__ of base class.
This only works for the base classes.
@timj timj merged commit 5674e7b into master Mar 31, 2021
@timj timj deleted the tickets/DM-29497 branch March 31, 2021 19:03
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