| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| 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 |
|---|---|---|
| Expand Up | @@ -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", | ||
| Expand All | @@ -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", | ||
| Expand Down Expand Up | @@ -136,35 +139,36 @@ def build_deprecation_message( | |
| def generate_deprecation_docstring(new_name, removal_version, new_base=None): | ||
|
Comment thread
Copy link
Copy Markdown
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. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitywhy did you remove this?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
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. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIt 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
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
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. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI wrote it because I was hoping for more uniformity. You could just print the docstring template and use it.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
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. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality@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.
Sorry, something went wrong.
All reactions
|
||
| """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 | ||
| Back | FazBrowse Home | New Git URL |
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitymoved to different news dep-msg-helper.rst with more description
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.