build: deprecate CamelCase function for structure.py#154
build: deprecate CamelCase function for structure.py#154stevenhua0320 wants to merge 5 commits intodiffpy:mainfrom
Conversation
|
@sbillinge The test fails because we don't have Do we need to add |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #154 +/- ##
==========================================
+ Coverage 98.93% 98.95% +0.02%
==========================================
Files 13 13
Lines 1878 1916 +38
==========================================
+ Hits 1858 1896 +38
Misses 20 20
🚀 New features to boost your workflow:
|
sbillinge
left a comment
There was a problem hiding this comment.
P lease see inline comments. Also. Make sure that both versions of the function are tested. To do this copy paste the tests then only modify one version to the new function name.
|
|
||
| base = "diffpy.structure.Structure" | ||
| removal_version = "3.8.0" | ||
|
|
There was a problem hiding this comment.
This should be 4.0.0.
Removal will be breaking so we put it to a top level release
There was a problem hiding this comment.
Have changed this and in any corresponding docstring that would affected.
src/diffpy/structure/structure.py
Outdated
|
|
||
| Please use diffpy.structure.Structure.add_new_atom instead. | ||
| """ | ||
| kwargs["lattice"] = self.lattice |
There was a problem hiding this comment.
This shouldn't have any functional code in it I think. It should just return the correct form of the function
sbillinge
left a comment
There was a problem hiding this comment.
Please check with @cadenmyers13 but I think there are still some issues. I think that all the deprecated functions should look something like:
@deprecated(writeStr_deprecation_msg)
def writeStr(self, format):
"""This function has been deprecated and will be removed in
version 4.0.0.
Please use diffpy.structure.Structure.write_str instead.
"""
return self.write_structure(format)
(not sure if str means structure or string but I am guessing. Better to fix it since we are deprecating...don't want to have to deprecate again)
Also, we want to leave all the existing tests so the deprecated functions are getting tested but then copy-paste them and replace the old name for the new name. I see that you have done this last step but I want to make sure that you have also left the tests for the old function names.
|
@stevenhua0320 Thanks for getting started on this. If you havent already, please see the documentation on how to deprecate: https://scikit-package.github.io/scikit-package/programming-guides/billinge-group-standards.html#deprecating-functions. @sbillinge can you create a new branch upstream to merge into? I guess it would be called @sbillinge is correct. the deprecated function should call the new function like exemplified above. Additionally, it is best to take this slow and do one function per PR. At least at first. Also, it helps if your commit messages or PR title reflect which functions are being deprecated so we know exactly what to look for. As for tests, I think the best way to handle it is for each deprecated function have it emit 1 let me know if you have any questions! |
It might be a good idea to initiate the workflow like this. @sbillinge could you open a new branch called |
|
ok, done!. lets assign modules to different people to try and build momentum |
|
Closed due to split into individual functions. |
@sbillinge ready to review. Note that for
diffpy.structurethere are too many CamelCase function that needs to be deprecated, I decide to split into several PRs to make and once we have finished all of these we add a news item.