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 PM plotter label, imports, calc report example #31

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

janderson4
Copy link
Contributor

@janderson4 janderson4 commented Oct 30, 2024

Summary by Sourcery

Enhance the plotting functionality by adjusting label offsets for better positioning and update import paths in visual test scripts to use absolute paths for improved clarity.

Enhancements:

  • Update import paths in visual test scripts to use absolute paths for better clarity and maintainability.
  • Adjust label offsets in the point plotter to improve label positioning on plots.

# 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
Copy link

sourcery-ai bot commented Oct 30, 2024

Reviewer's Guide by Sourcery

This PR makes three main types of changes: updates import statements to use absolute imports, adjusts the point plotter label positioning logic, and modifies the calculation report example parameters.

Class diagram for updated import statements

classDiagram
    class Input
    class get_capacity
    class pmm_mesh
    class point_plotter
    class assign_max_min
    class Column
    class BarSize
    class LoadCombination
    class getCalculatedColumnProps

    Input <.. get_capacity
    Input <.. pmm_mesh
    Input <.. point_plotter
    Input <.. assign_max_min
    Input <.. Column
    Input <.. BarSize
    Input <.. LoadCombination
    Input <.. getCalculatedColumnProps

    note for Input "Updated import paths to use absolute imports"
Loading

File-Level Changes

Change Details Files
Updated import statements to use absolute imports instead of relative imports
  • Changed relative imports (...) to absolute imports (examples.conc_col_pmm)
  • Maintained the same imported components but with full path specification
examples/conc_col_pmm/tests/visual_tests/visual_test_point_plotter.py
examples/conc_col_pmm/tests/visual_tests/visual_test_document_wrapper.py
Improved label positioning logic in point plotter
  • Split single label offset into separate x and y offsets
  • Added conditional y-offset selection based on point position
  • Modified y-offset values for better label placement
examples/conc_col_pmm/calc_document/plotting/point_plotter.py
Modified calculation report example parameters
  • Changed column dimensions from 24x18 to 18x24
  • Updated column type from Spiral to Tied
  • Modified load case values and reduced number of load cases
  • Removed two pure bending load cases
examples/conc_col_pmm/tests/visual_tests/visual_test_document_wrapper.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 and they look great!

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 and I'll use the feedback to improve your reviews.

# label the intersections with the y-axis
for i in (0, pt_count - 1):
pos = (phi_Mn[i], phi_Pn[i])
label = str(round(phi_Pn[i], 1))
plt.plot(pos[0], pos[1], marker="+", ms=12, mew=1.2, c="black", zorder=3)
plt.text(pos[0] + label_offsets[0], pos[1] + label_offsets[1], label, zorder=3)
label_offset_y=label_offsets_y[0] if i==0 else label_offsets_y[1]
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): The variable 'i' is undefined in this scope and could cause incorrect label positioning

This variable was only defined in the previous for-loop scope. Consider basing the y-offset on the point's position relative to the plot bounds instead.

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.

1 participant