-
Notifications
You must be signed in to change notification settings - Fork 3
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
Deprecate kadi load_ska_dir() in favor of parse_cm load_dir_from_load_name #310
Conversation
I think you've used FutureWarning in recent work (like https://github.com/sot/chandra_cmd_states/blob/efd4c947c6508c63df232344d58696fa9d11a6eb/chandra_cmd_states/__init__.py#L17) so maybe that's our convention? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. The change is simple enough. The tests pass.
I think one can use FutureWarning
instead of the numpy
warning. What is the reason not to?
kadi/commands/core.py
Outdated
|
||
warnings.warn( | ||
"ska_load_dir() is deprecated. Use parse_cm.paths.load_dir_from_load_name()", | ||
np.VisibleDeprecationWarning, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the issue with using FutureWarning
here? (as you suggest) It would seem to me that this is exactly what it is meant for, but perhaps I'm missing something.
Strictly speaking, maybe the intended use is to create our own deprecation warning class and make it inherit from FutureWarning
, though I am not proposing to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I like that the numpy one has the word Deprecation in it, but I see the point and have changed this.
2b977de
to
5fcdf13
Compare
0f28614
to
b5c0d6e
Compare
3724bc9
to
1d6011d
Compare
Description
The
kadi.commands.core
functionload_ska_dir()
has been superceded byparse_cm.paths.load_dir_from_load_name()
. This PR re-implements the kadiload_ska_dir()
function as a call toload_dir_from_load_name()
and issues a deprecationFutureWarning
.Interface impacts
This function is now deprecated and using it will cause unit tests to fail or issue warnings to the console.
From https://github.com/search?q=org%3Asot%20ska_load_dir&type=code it seems that only
mica
was using this (fixed in sot/mica#288).Testing
Unit tests
With Use parse_cm load_dir_from_load_name and test mica#288 installed:
Independent check of unit tests by [REVIEWER NAME]
Functional tests
No functional testing.