Skip to content
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

docs: improve docstring based on group standards in diffraction_objects.py transforms.py #300

Merged
merged 5 commits into from
Dec 31, 2024

Conversation

bobleesj
Copy link
Contributor

Closes #239 - primarily focused on DiffractionObjects and Transform functions that will be used by our beta users.

Copy link

codecov bot commented Dec 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (52f1c79) to head (5dfff33).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #300   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          516       516           
=========================================
  Hits           516       516           

Copy link
Contributor Author

@bobleesj bobleesj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbillinge ready for review

@yucongalicechen cc' on the changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran python ../release-scripts/auto_api.py diffpy.utils ./src/diffpy/utils ./doc/source/api/ and these are automated changes:


Raises
------
ValueError
Raised when the length of the yarray of the two DiffractionObject instances do not match.
Raised when the xarrays of two DiffractionObject instances are not equal.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"not equal" feels more explicit and program-like, than "unequal" or "do not match"

"""Subtract scalar value or another DiffractionObject to the yarray of
the DiffractionObject.

This method behaves similarly to the `__add__` method, but performs subtraction instead of addition.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since sub, mul, and truediv pretty much have the same docstrings, I asked them to refer to mul while the examples are still unique.

The ORCID id of the user/owner

Returns
-------
dict:
user_info : dict
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like numpy uses both (1) what's returned and (2) its type

Screenshot 2024-12-30 at 10 11 02 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -97,7 +97,7 @@ def get_user_info(owner_name=None, owner_email=None, owner_orcid=None):


def check_and_build_global_config(skip_config_creation=False):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor prettification based on the standard

@bobleesj
Copy link
Contributor Author

@sbillinge (ready for review after a minor fix, pls see my review comments above)

Copy link
Contributor

@sbillinge sbillinge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice indeed. I had a few comments, and it is conflincted so I couldn't merge in any case.

@bobleesj bobleesj closed this Dec 31, 2024
@bobleesj bobleesj reopened this Dec 31, 2024
@bobleesj
Copy link
Contributor Author

@sbillinge ready for review - all fixed

@yucongalicechen ready for 3.6.0 release checklist once this is merged.

@sbillinge sbillinge merged commit 0a3241b into diffpy:main Dec 31, 2024
7 checks passed
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.

docs: Double-check and refine docstrings before 3.6.0 release
2 participants