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

Use FutureWarning instead of DeprecationWarning. #692

Merged
merged 14 commits into from
Mar 12, 2022
2 changes: 1 addition & 1 deletion signac/contrib/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ def __init__(self, *args, **kwargs):
warnings.warn(
"The MasterCrawler class has been replaced by the MainCrawler class. "
"Both classes are deprecated and will be removed in a future release.",
DeprecationWarning,
FutureWarning,
)
super().__init__(*args, **kwargs)

Expand Down
4 changes: 2 additions & 2 deletions signac/synced_collections/backends/collection_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _str_key(key):
warnings.warn(
f"Use of {type(key).__name__} as key is deprecated "
"and will be removed in version 2.0",
DeprecationWarning,
FutureWarning,
)
key = str(key)
return key
Expand Down Expand Up @@ -146,7 +146,7 @@ def json_attr_dict_validator(data):
warnings.warn(
f"Use of {type(key).__name__} as key is deprecated "
"and will be removed in version 2.0.",
DeprecationWarning,
FutureWarning,
)
data[str(key)] = data.pop(key)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def buffer_backend(cls, buffer_size=None, force_write=None, *args, **kwargs):
"""
if force_write is not None:
warnings.warn(
DeprecationWarning(
FutureWarning(
Copy link
Member

@bdice bdice Mar 9, 2022

Choose a reason for hiding this comment

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

Hmm, something was wrong here in the old code. Can you switch this to call warnings.warn(message, FutureWarning) instead of warnings.warn(FutureWarning(message))? The function isn't being used correctly.

https://docs.python.org/3/library/warnings.html#warnings.warn

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, sure.

"The force_write parameter is deprecated and will be removed in "
"signac 2.0. This functionality is no longer supported."
)
Expand Down