Skip to content

Conversation

@sbillinge
Copy link
Contributor

  • deprecated: loadData to load_data, and move it
  • fix: bad imports so tests pass

@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (aab1765) to head (8d11075).

Additional details and impacted files
@@            Coverage Diff            @@
##            v3.7.0      #372   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          516       547   +31     
=========================================
+ Hits           516       547   +31     
Files with missing lines Coverage Δ
tests/test_loaddata.py 100.00% <100.00%> (ø)
tests/test_serialization.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cadenmyers13
Copy link
Contributor

@sbillinge one comment inline

@sbillinge
Copy link
Contributor Author

@sbillinge one comment inline

I couldn't see an inline comment, did you maybe forget to save it (that happens to me sometimes)?

* All data blocks findable by load_data.
* Headers (if present) for each data block. (Generally the headers
contain column name information).
"""
Copy link
Contributor

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:

@ deprecated(loaddata_deprecation_msg)
def loadData(inputs):
   '''leave the docstring here unchanged so mouse-over shows it properly```
   from diffpy.utils.tools import load_data
   return load_data(inputs)

This is a unique case because youve moved this function to tools.py, but in most cases it would be something like return self.new_func_name()

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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!

Copy link
Contributor

@cadenmyers13 cadenmyers13 Jan 18, 2026

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)

@cadenmyers13
Copy link
Contributor

@sbillinge yep sorry, forgot to submit! should be visible now

@sbillinge sbillinge changed the base branch from main to v3.7.0 January 18, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants