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

Testing, documentation, and exception handling for Apple Silicon #111

Merged
merged 6 commits into from
Mar 5, 2024

Conversation

rkingsbury
Copy link
Member

@rkingsbury rkingsbury commented Mar 4, 2024

Summary

Partially addresses #109 by detecting OSError that may result from Apple silicon trying to use phreeqpython. phreeqpython and PHREEQC itself do not support ARM64 as far as I can tell, but we can at least detect this situation and allow everything in Solution that does not depend on phreeqpython to work.

Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 82.24%. Comparing base (f00d960) to head (b8b0705).
Report is 4 commits behind head on main.

Files Patch % Lines
src/pyEQL/solution.py 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #111      +/-   ##
==========================================
+ Coverage   82.18%   82.24%   +0.06%     
==========================================
  Files          10       10              
  Lines        1448     1453       +5     
  Branches      250      293      +43     
==========================================
+ Hits         1190     1195       +5     
+ Misses        221      220       -1     
- Partials       37       38       +1     

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

@yuxuanzhuang
Copy link

Hi! I assume the job is still only running on Ubuntu. I believe you need to change runs-on

https://github.com/KingsburyLab/pyEQL/actions/runs/8147303075/job/22267731867?pr=111

@yuxuanzhuang
Copy link

And macos-14 (the M1 macOS runner) should also be added. If you check https://github.com/KingsburyLab/pyEQL/actions/runs/8158585151/job/22300886092?pr=111, you can see that x86 packages are installed in macos-latest.

@rkingsbury
Copy link
Member Author

And macos-14 (the M1 macOS runner) should also be added. If you check https://github.com/KingsburyLab/pyEQL/actions/runs/8158585151/job/22300886092?pr=111, you can see that x86 packages are installed in macos-latest.

Yes, thanks! Having some trouble getting python to install properly on that runner though. See actions/setup-python#825

@yuxuanzhuang
Copy link

Could you try to put it in os as well? as in https://github.com/MDAnalysis/mdanalysis/pull/4442/files

@rkingsbury
Copy link
Member Author

Alright, got the M1 runner added to CI, and added a try/except that should allow pyEQL to be used. An error will be logged (and by default, shown to the user) telling them that equilibrate and other methods that depend on PHREEQC won't work, but otherwise pyEQL should function normally.

I will make an update to the docs to mention this limitation shortly.

It isn't possible (without significant effort) to get the existing test suite to pass without these methods in place, so I've separated the M1 test into an optional GH action that we can use to keep an eye on this. Do you know if there's a way to mark a Github Action as an "expected failure"?

@yuxuanzhuang
Copy link

I assume you can mark failed tests with @pytest.mark.xfail(platform.machine() == "arm64" and platform.system() == "Darwin"). Not sure there's anything one can do with GitHub action.

@rkingsbury rkingsbury changed the title support Apple Silicon Testing, documentation, and exception handling for Apple Silicon Mar 5, 2024
@rkingsbury rkingsbury added enhancement release:minor will issue a minor release github_actions Pull requests that update GitHub Actions code labels Mar 5, 2024
@rkingsbury rkingsbury merged commit 28ce5fc into main Mar 5, 2024
13 checks passed
@rkingsbury rkingsbury deleted the apple_silicon branch March 5, 2024 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement github_actions Pull requests that update GitHub Actions code release:minor will issue a minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants