Skip to content

Basic e mag example review #322

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

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

Conversation

JackB-Ansys
Copy link
Collaborator

@JackB-Ansys JackB-Ansys commented Jun 13, 2024

Updates to EMag basic example. Fixes some issues and enhancements made to comments. Now the harmonic amplitude graph is plotted instead of the torque being plotted twice.

Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.58%. Comparing base (d9471c8) to head (6ec58b7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #322      +/-   ##
==========================================
- Coverage   88.66%   88.58%   -0.09%     
==========================================
  Files          21       21              
  Lines        2487     2487              
==========================================
- Hits         2205     2203       -2     
- Misses        282      284       +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@james-packer james-packer left a comment

Choose a reason for hiding this comment

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

Looks good. A couple of comments about the pictures.

# Define a coil's parameters:
# :code:`set_winding_coil(phase,
# path, coil, go_slot, go_position, return_slot, return_position, turns)`
# .. image:: ../../images/basics_emag_2.png
Copy link
Contributor

Choose a reason for hiding this comment

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

This image doesn't seem to exist?


print("Simulation completed.")


# %%
# Plot results
# ------------
# Plot results from the simulation.
# Use``pyplot`` from ``matplotlib`` (imported as ``plt``) to plot graphs of the simulation results.
# Plot the Airgap Flux Density and the Torque (VW) results as subplots in the same figure.
plt.subplot(211)
Copy link
Contributor

Choose a reason for hiding this comment

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

The X axis title gets cut off on the top graph:

image

The 'constrained' layout from matplotlib seems to work well for this. I think you can just add plt.figure(layout="constrained") before the plt.subplot(211) call, but I haven't tested this.

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.

Review the PyMotorCAD Basic Examples
3 participants