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

Prevent array shape mismatch due to NumPy squeeze in mhd_waves_.py #2715

Merged
merged 4 commits into from
Jul 18, 2024

Conversation

TrestanSimon
Copy link
Contributor

Description

This PR adds an if statement to prevent array shape mismatch due to np.squeeze in mhd_waves_.py.

np.squeeze will convert column vectors to row vectors, for example, which causes problems where the array shape is assumed to be preserved.

Copy link

github-actions bot commented Jun 3, 2024

Thank you for submitting a pull request (PR) to PlasmaPy! ✨ The future of the project depends on contributors like you, so we deeply appreciate it! 🌱

Our contributor guide has information on:

Important

PlasmaPy recently switched to an src layout. The source code previously in plasmapy/ is now in src/plasmapy/. Tests are now in tests/. If you have previously done an editable installation, it will likely need to be re-done (i.e., with pip install -e .[tests,docs] in the top-level directory of the repository). The former plasmapy/ directory will need to be deleted manually in old clones because git does not track directories.

The bottom of this page shows several checks that are run for every PR. Don't worry if something broke! We break stuff all the time. 😺 Click on "Details" to learn why a check didn't pass. Please also feel free to ask for help. We do that all the time as well. 🌸 You can find us in our chat room or weekly community meeting & office hours. Here are some tips:

  • Try fixing CI / Python 3.12 test failures first.
  • Most pre-commit.ci - pr failures can be automagically fixed by commenting pre-commit.ci autofix below, followed by a git pull to bring the changes back to your computer. Please also see our pre-commit troubleshooting guide.
  • If pre-commit.ci - pr says that a function is too long or complex, try breaking up that function into multiple short functions that each do one thing. See also these tips on writing clean scientific software.
  • If the CI / Documentation check ends with a cryptic error message, check out our documentation troubleshooting guide.
  • For a documentation preview, click on Details next to docs/readthedocs.org:plasmapy.

If this PR is marked as ready for review, someone should stop by to provide a code review and offer suggestions soon. ✅ If you don't get a review within a few days, please feel free to send us a reminder.

Please also use SI units within PlasmaPy, except when there is strong justification otherwise or in some examples.

We thank you once again!

@github-actions github-actions bot added plasmapy.dispersion Related to the plasmapy.dispersion subpackage python Pull requests that update Python code labels Jun 3, 2024
@TrestanSimon TrestanSimon requested a review from a team as a code owner June 3, 2024 23:26
@github-actions github-actions bot added the bugfix Pull requests that fix a bug. Remember: a bug is a sign of a missing test! label Jun 3, 2024
@TrestanSimon TrestanSimon changed the title Address problems with NumPy squeeze in mhd_waves_.py Prevent array shape mismatch due to NumPy squeeze in mhd_waves_.py Jun 9, 2024
Copy link
Member

@namurphy namurphy left a comment

Choose a reason for hiding this comment

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

Thank you for doing this, and apologies for the delay in merging it!

changelog/2715.bugfix.rst Outdated Show resolved Hide resolved
@namurphy namurphy removed the request for review from ejohnson-96 July 18, 2024 01:47
@namurphy namurphy enabled auto-merge (squash) July 18, 2024 01:47
Copy link

codecov bot commented Jul 18, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 8 lines in your changes missing coverage. Please review.

Project coverage is 94.36%. Comparing base (71663fb) to head (e529624).
Report is 41 commits behind head on main.

Files Patch % Lines
src/plasmapy/dispersion/analytical/mhd_waves_.py 33.33% 4 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2715      +/-   ##
==========================================
- Coverage   95.14%   94.36%   -0.78%     
==========================================
  Files         107      107              
  Lines        9411     9608     +197     
  Branches     2168     2225      +57     
==========================================
+ Hits         8954     9067     +113     
- Misses        276      347      +71     
- Partials      181      194      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@namurphy namurphy disabled auto-merge July 18, 2024 01:53
@namurphy namurphy merged commit a40f34e into PlasmaPy:main Jul 18, 2024
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull requests that fix a bug. Remember: a bug is a sign of a missing test! plasmapy.dispersion Related to the plasmapy.dispersion subpackage python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants