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

Add octave and matlab to run module #45

Merged
merged 47 commits into from
Nov 14, 2022
Merged

Add octave and matlab to run module #45

merged 47 commits into from
Nov 14, 2022

Conversation

SarahAlidoost
Copy link
Member

@SarahAlidoost SarahAlidoost commented Oct 26, 2022

Related to EcoExtreML/STEMMUS_SCOPE#125

  • update module
  • update docs
  • update tests
  • update notebooks

Tests:

  • crib with octave
  • snellius with exe and matlab
  • my linux with exe

closes #44
closes #39
closes #25
relates #46

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@SarahAlidoost
Copy link
Member Author

I tried running the model using Octave, but it does not seem to work on my Windows machine. Subprocess just returns exit status 1:

CalledProcessError: Command '['octave --eval "STEMMUS_SCOPE_octave(\'C:\\STEMMUS_SCOPE_data\\workdir\\input\\ZA-Kru_2022-11-03-0927\\ZA-Kru_2022-11-03-0927_config.txt\');exit;"', '--no-gui', '--silent']' returned non-zero exit status 1.

code 1 Indicates that "Action has attempted to execute non-recognized command". This might be related to how we call octave executable here i.e. octave vs octave.bat on windows.

A solution would be to use shutil.which() as explained here.

Copy link
Contributor

@BSchilperoort BSchilperoort left a comment

Choose a reason for hiding this comment

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

Hi Sarah, you missed part of my suggestion which was to split up the octave --eval CODE into separate octave, --eval, and CODE list elements. This is required for it to work on Windows.

I also reviewed the rest of the PR and left some suggestions and comments! 👍

PyStemmusScope/stemmus_scope.py Outdated Show resolved Hide resolved
PyStemmusScope/stemmus_scope.py Outdated Show resolved Hide resolved
PyStemmusScope/stemmus_scope.py Outdated Show resolved Hide resolved
PyStemmusScope/stemmus_scope.py Outdated Show resolved Hide resolved
PyStemmusScope/stemmus_scope.py Outdated Show resolved Hide resolved
PyStemmusScope/stemmus_scope.py Outdated Show resolved Hide resolved
@SarahAlidoost
Copy link
Member Author

Hi Sarah, you missed part of my suggestion which was to split up the octave --eval CODE into separate octave, --eval, and CODE list elements. This is required for it to work on Windows.

I also reviewed the rest of the PR and left some suggestions and comments! +1

Thanks for reviewing. I addressed your comments, Please have another look, thanks.

Copy link
Contributor

@BSchilperoort BSchilperoort left a comment

Choose a reason for hiding this comment

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

Hi Sarah, great work! Octave + Windows 10 works as intended now 😄.

Seeing as you'll be gone for a week, and to avoid merge conflicts, I will merge this PR once I fixed the Windows CI. The tests are failing due to a lack of Windows wheels for the netcdf 1.6.0 package. I will fix it to <1.6.0.

@sonarcloud
Copy link

sonarcloud bot commented Nov 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

92.7% 92.7% Coverage
0.0% 0.0% Duplication

@BSchilperoort
Copy link
Contributor

BSchilperoort commented Nov 7, 2022

I noticed that the tests were failing on Windows, as trying to use a non-existent EXE results in a FileNotFoundError on Windows, instead of the ValueError you expected. I have updated the tests to account for this.

See the changes here:
6a0d024#diff-d57ca3aa8acb1482e37888eb52a0746872c9c36e6bc8c263dd3a1efed5f3196f

@SarahAlidoost
Copy link
Member Author

I noticed that the tests were failing on Windows, as trying to use a non-existent EXE results in a FileNotFoundError on Windows, instead of the ValueError you expected. I have updated the tests to account for this.

See the changes here: 6a0d024#diff-d57ca3aa8acb1482e37888eb52a0746872c9c36e6bc8c263dd3a1efed5f3196f

Thanks for the review and fixes. I will merge the PR.

@SarahAlidoost SarahAlidoost merged commit beb341f into main Nov 14, 2022
@SarahAlidoost SarahAlidoost deleted the add_octave branch November 14, 2022 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants