Skip to content

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

Merged
sbillinge merged 5 commits into
diffpy:mainfrom
bobleesj:docstrings-overview
Dec 31, 2024
Merged

docs: improve docstring based on group standards in diffraction_objects.py transforms.py#300
sbillinge merged 5 commits into
diffpy:mainfrom
bobleesj:docstrings-overview

Conversation

@bobleesj

Copy link
Copy Markdown
Contributor

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

@codecov

codecovBot commented Dec 31, 2024

Copy link
Copy Markdown

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 

@bobleesjbobleesj left a comment

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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:

Comment threadsrc/diffpy/utils/diffraction_objects.py
------
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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.

Returns
-------
dict:
user_info : dict

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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

@sbillingesbillinge left a comment

Copy link
Copy Markdown
Contributor

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.

Comment threadsrc/diffpy/utils/diffraction_objects.py Outdated
Comment threadnews/docstrings-refactor.rst Outdated
@bobleesjbobleesj reopened this Dec 31, 2024
@bobleesj

Copy link
Copy Markdown
ContributorAuthor

@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:mainDec 31, 2024
Sign up for freeto 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

@bobleesj@sbillinge