-
Notifications
You must be signed in to change notification settings - Fork 21
V3.7.0 #377
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
V3.7.0 #377
Changes from all commits
7cd01f1
0b46822
4a1ee18
8d11075
34bfb90
ed72aca
7ac6862
c357d3e
d6992e6
67e3db5
b90f56a
e4d3c66
28b6074
1c6bcda
2a79ecf
106b419
77db094
a35208a
ce61f51
efd094d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| **Added:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Changed:** | ||
|
|
||
| * load_data now takes a Path or a string for the file-path | ||
|
|
||
| **Deprecated:** | ||
|
|
||
| * diffpy.utils.parsers.loaddata.loadData replaced by diffpy.utils.parsers.load_data | ||
|
|
||
| **Removed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Fixed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Security:** | ||
|
|
||
| * <news item> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| **Added:** | ||
|
|
||
| * Support for Python 3.14 | ||
|
|
||
| **Changed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Deprecated:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Removed:** | ||
|
|
||
| * Support for Python 3.11 | ||
|
|
||
| **Fixed:** | ||
|
|
||
| * All references to ``loadData`` changed to ``load_data`` due to that deprecation | ||
|
|
||
| **Security:** | ||
|
|
||
| * <news item> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,9 @@ def deprecated(message, *, category=DeprecationWarning, stacklevel=1): | |
|
|
||
| .. code-block:: python | ||
|
|
||
| from diffpy.utils._deprecator import deprecated, deprecation_message | ||
| from diffpy.utils._deprecator import ( | ||
| deprecated, build_deprecation_message | ||
| ) | ||
|
|
||
| deprecation_warning = build_deprecation_message("diffpy.utils", | ||
| "old_function", | ||
|
|
@@ -44,8 +46,9 @@ def new_function(x, y): | |
|
|
||
| .. code-block:: python | ||
|
|
||
| from diffpy.utils._deprecator import deprecated, deprecation_message | ||
|
|
||
| from diffpy.utils._deprecator import ( | ||
| deprecated, build_deprecation_message | ||
| ) | ||
| deprecation_warning = build_deprecation_message("diffpy.utils", | ||
| "OldAtom", | ||
| "NewAtom", | ||
|
|
@@ -136,35 +139,36 @@ def build_deprecation_message( | |
| def generate_deprecation_docstring(new_name, removal_version, new_base=None): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did you remove this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It isnt used anywhere. my idea with it was to have it as a helper that could easily print the docstring then the user could copy/paste the docstring where it needs to go. I removed it because I felt like this was overkill but if you think its helpful we can add it back
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wrote it because I was hoping for more uniformity. You could just print the docstring template and use it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sbillinge oh whoops thought i wrote it 😂 . I'll add it back and make it more clear that this is for printing your docstring message. |
||
| """Generate a docstring for copy-pasting into a deprecated function. | ||
|
|
||
| this function will print the text to the terminal for copy-pasting | ||
|
|
||
| usage: | ||
| python | ||
| >>> import diffpy.utils._deprecator.generate_deprecation_docstring as gdd | ||
| >>> gdd("new_name", "4.0.0") | ||
|
|
||
| The message looks like: | ||
| This function has been deprecated and will be removed in version | ||
| {removal_version}. Please use {new_base}.{new_name} instead. | ||
| This function will print the text to the terminal for copy-pasting. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| new_name: str | ||
| The name of the new function or class to replace the existing one | ||
| removal_version: str | ||
| new_name : str | ||
| The name of the new function or class to replace the existing one. | ||
| removal_version : str | ||
| The version when the deprecated item is targeted for removal, | ||
| e.g., 4.0.0 | ||
| new_base: str Optional. Defaults to old_base. | ||
| The new base for importing. The new import statement would look like | ||
| "from new_base import new_name" | ||
| e.g., 4.0.0. | ||
| new_base : str, optional | ||
| The new base for importing. The new import statement would look like | ||
| "from new_base import new_name". Defaults to None. | ||
|
|
||
| Example | ||
| ------- | ||
| >>> from diffpy.utils._deprecator import generate_deprecation_docstring | ||
| >>> generate_deprecation_docstring("new_name", "4.0.0") | ||
|
|
||
| The message looks like: | ||
| This function has been deprecated and will be removed in version | ||
| {removal_version}. Please use {new_base}.{new_name} instead. | ||
|
|
||
|
|
||
| Returns | ||
| ------- | ||
| None | ||
| """ | ||
| print( | ||
| f"This function has been deprecated and will be " | ||
| f"removed in version {removal_version}. Please use" | ||
| f"{new_base}.{new_name} instead." | ||
| f"This function has been deprecated and will be removed in version " | ||
| f"{removal_version}.\n" | ||
| f"Please use {new_base}.{new_name} instead." | ||
| ) | ||
| return | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
moved to different news
dep-msg-helper.rstwith more description