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

Change labels in point_plotter.py #32

Closed
wants to merge 5 commits into from

Conversation

janderson4
Copy link
Contributor

@janderson4 janderson4 commented Nov 16, 2024

Summary by Sourcery

Enhancements:

  • Adjust label offset logic in point_plotter.py to improve label positioning.

janderson4 and others added 5 commits October 13, 2024 10:29
# Conflicts:
#	examples/conc_col_pmm/calc_document/plotting/point_plotter.py
#	examples/conc_col_pmm/tests/visual_tests/visual_test_document_wrapper.py
#	examples/conc_col_pmm/tests/visual_tests/visual_test_pmm_plotter_plotly.py
#	examples/conc_col_pmm/tests/visual_tests/visual_test_point_plotter.py
Return PMM data from main calculation function
Revert relative import changes and rename visual test files
Fix PMM field types
Copy link

sourcery-ai bot commented Nov 16, 2024

Reviewer's Guide by Sourcery

The changes improve the label positioning in the point plotter by separating the x and y offset calculations and adjusting the vertical positioning of labels based on their location. This makes the plot more readable by preventing label overlap.

Class diagram for label offset changes in point_plotter.py

classDiagram
    class PointPlotter {
        +plot(capacity_pts, point: LoadCombination | None, only_Mx)
    }

    PointPlotter : -label_offset_x
    PointPlotter : -label_offsets_y
    PointPlotter : +plot()

    note for PointPlotter "Updated label offset calculations for x and y axes"
Loading

File-Level Changes

Change Details Files
Refactored label offset calculation for better label positioning
  • Split single label_offsets tuple into separate x and y offset variables
  • Modified y-axis offset to use different values for top and bottom labels
  • Updated label positioning logic to use position-dependent y-offset
  • Increased negative y-offset for bottom labels to -5% of load span (from +2%)
examples/conc_col_pmm/calc_document/plotting/point_plotter.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@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 @janderson4 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • There's a bug in the point plotting section - the variable 'i' is undefined when determining label_offset_y. You'll need to use a different condition to determine whether to use the top or bottom offset.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 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 and I'll use the feedback to improve your reviews.

@youandvern
Copy link
Owner

I committed the changes directly for this one. We'll probably want to clean up your repo git history and use branches for future PRs

@youandvern youandvern closed this Nov 25, 2024
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