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

chore: ♻️ Update RIXSConverter class documentation and argument descriptions #1605

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

Anselmoo
Copy link
Owner

@Anselmoo Anselmoo commented Sep 24, 2024

Update the documentation and argument descriptions in the RIXSConverter class to provide clearer explanations and improve readability. This commit also renames some argument labels for consistency and adds default values for certain arguments. The changes aim to enhance the understanding and usability of the RIXSConverter class for converting raw pickle data into JSON, TOML, or numpy formats for RIXS visualization.

All PR-Submissions:


  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open
    Pull Requests for the same
    update/change?

New ✨✨ Feature-Submissions:


  • Does your submission pass tests?
  • Have you lint your code locally prior to submission? Fixed:
  • This PR is for a new feature, not a bug fix.

Changes to ⚙️ Core-Features:


  • Have you added an explanation of what your changes do and why you'd like
    us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

Summary by Sourcery

Enhance the RIXSConverter class by updating its documentation and argument descriptions for better clarity and usability. This includes renaming argument labels for consistency and adding default values to improve the user experience when converting raw pickle data into JSON, TOML, or numpy formats.

Enhancements:

  • Improve the clarity and readability of the RIXSConverter class documentation and argument descriptions.
  • Rename argument labels for consistency and add default values for certain arguments in the RIXSConverter class.

…iptions

Update the documentation and argument descriptions in the RIXSConverter class to provide clearer explanations and improve readability. This commit also renames some argument labels for consistency and adds default values for certain arguments. The changes aim to enhance the understanding and usability of the RIXSConverter class for converting raw pickle data into JSON, TOML, or numpy formats for RIXS visualization.
Copy link

semanticdiff-com bot commented Sep 24, 2024

Review changes with SemanticDiff.

Analyzed 1 of 1 files.

Overall, the semantic diff is 43% smaller than the GitHub diff.

Filename Status
✔️ spectrafit/plugins/rixs_converter.py 42.13% smaller

Copy link
Contributor

sourcery-ai bot commented Sep 24, 2024

Reviewer's Guide by Sourcery

This pull request updates the RIXSConverter class documentation and argument descriptions in the spectrafit/plugins/rixs_converter.py file. The changes focus on improving clarity, consistency, and readability of the class and its methods. The main modifications include updating docstrings, renaming argument labels, and adding default values for certain arguments.

File-Level Changes

Change Details Files
Improved class and method documentation
  • Updated class docstring to be more concise
  • Clarified the description of the get_args method
  • Improved the description of the argparse parser
  • Updated help messages for command-line arguments to be more informative
spectrafit/plugins/rixs_converter.py
Renamed argument labels for consistency
  • Changed 'incident_energy' to 'incident-energy'
  • Changed 'emission_energy' to 'emission-energy'
  • Changed 'rixs_map' to 'rixs-map'
spectrafit/plugins/rixs_converter.py
Added default values and improved argument descriptions
  • Added default value 'latin1' for file_format argument
  • Added default value 'json' for export_format argument
  • Added default value 'sum' for mode argument
  • Clarified descriptions for file_format, export_format, and mode arguments
spectrafit/plugins/rixs_converter.py

Sequence Diagram

No sequence diagram generated.


Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

@github-actions github-actions bot added the python Pull requests that update Python code label Sep 24, 2024
Copy link

sonarcloud bot commented Sep 24, 2024

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Anselmoo - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding type hints to the argparse arguments for improved code clarity and easier maintenance.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

)
parser.add_argument(
"-f",
"--file-format",
help="File format for the optional encoding of the pickle file."
" Default is 'latin1'.",
help="Encoding format of the pickle file (default: 'latin1').",
type=str,
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Addition of explicit type for --rixs-map argument improves consistency.

Adding type=str to the --rixs-map argument improves consistency with other arguments and enhances type safety. Consider applying this pattern consistently across all string arguments if not already done.

Suggested change
type=str,
"--rixs-map",
type=str,

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (0445e3f) to head (f8bce19).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1605   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           44        44           
  Lines         4464      4464           
=========================================
  Hits          4464      4464           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
spectrafit/plugins/rixs_converter.py 100.00% <ø> (ø)

@Anselmoo Anselmoo merged commit 88280d0 into main Sep 24, 2024
33 checks passed
@Anselmoo Anselmoo deleted the improve-cli-usability branch September 24, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant