Repository navigation
depr tests #372
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
Merged
Merged
depr tests #372
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7cd01f1
deprecated: loadData to load_data, and move it
sbillinge 0b46822
fix: bad imports so tests pass
sbillinge 4a1ee18
change: change structure so load_data is back in parsers
sbillinge 8d11075
docs: change docstring so API docs are correctly updated
sbillinge 34bfb90
docs; fix typos in examples text that had load_data in tools
sbillinge 7ac6862
fix: caught a couple of tools typos fixed to parsers
sbillinge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.tools.load_data | ||
|
|
||
| **Removed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Fixed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Security:** | ||
|
|
||
| * <news item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we want to replace the code of the deprecated function so it points to the new function? that way we don't have duplicate code. So it would look something like:
This is a unique case because youve moved this function to
tools.py, but in most cases it would be something likereturn self.new_func_name()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.
Yah, that's a good point. The docstrings will be wrong for the old function, but we kind of want to point people to the new one anyway.
Do you know what happens to the API docs with the deprecated function? We kind of don't want it showing up in the API docs. I just thought of that too. Your way is probably better in this regard too as there is no explicit discussing in the old function any more.
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.
Yah, that's a good point. The docstrings will be wrong for the old function, but we kind of want to point people to the new one anyway.
Do you know what happens to the API docs with the deprecated function? We kind of don't want it showing up in the API docs. I just thought of that too. Your way is probably better in this regard too as there is no explicit discussing in the old function any more.
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.
@sbillinge thats a good point about api docs. In that case I think we should probably replace the docstring in the old function with something like "This function is deprecated. Please use
diffpy.utils.wherever.new_function." That way, if someone tries to mouse-over it, they can see what the new function is. I think no matter what we will have duplicates in the api docs temporarily, but the docstring will point to the new function so no big deal. I don't know how the api docs are built from the docstring in the deprecated function case however we can easily check.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.
yes yes yes! Nice. OK, we are making progress here. I like this approach. I wonder if we want to quickly catch the steps and write a little chapter in the docs of
scikit-package(which is our kind of de-facto group standards for doing everything)? The advantage is that we can then share around these deprecation tasks. I am about to make anaother push.In other news, I have changed the base branch of this PR to a branch
called v3.7.0. Let's make all our deprecation work into that. I can then make a patch-release from main when we get our free minutes back from GH and we can start this work in earnest starting on Feb 1!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.
@sbillinge I did this here a while ago. It might need a little update based on this convo but the bones are good: #366 (comment)