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 plotting module #425

Merged
merged 9 commits into from
Dec 20, 2023
Merged

Add plotting module #425

merged 9 commits into from
Dec 20, 2023

Conversation

richypitman
Copy link
Collaborator

Added a plotting module with functionality to request plots via the pyscal CLI. One plot is made for each system (oil-water/gas-water/oil-gas) and each SATNUM. For curves interpolated using SCALrecommendation, the interpolated curves are plotted. By default, requesting plots will create relative permeability plots. There is an option to request a capillary pressure plot. Figures are saved in the current working directory. Some basic tests have also been added.

@richypitman richypitman requested a review from alifbe December 13, 2023 13:15
@codecov-commenter
Copy link

codecov-commenter commented Dec 13, 2023

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (22d82ef) 99.02% compared to head (1639e24) 98.73%.

❗ Current head 1639e24 differs from pull request most recent head 1c6a913. Consider uploading reports for the commit 1c6a913 to get more accurate results

Files Patch % Lines
pyscal/plotting.py 94.02% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #425      +/-   ##
==========================================
- Coverage   99.02%   98.73%   -0.29%     
==========================================
  Files          16       17       +1     
  Lines        2558     2698     +140     
==========================================
+ Hits         2533     2664     +131     
- Misses         25       34       +9     

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

pyscal/pyscalcli.py Outdated Show resolved Hide resolved
pyscal/pyscalcli.py Outdated Show resolved Hide resolved
assert (
hasattr(PyscalList(), "pyscal_list") is True
), "The PyscalList object should have a pyscal_list instance variable.\
This is accessed by the plotting module."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you also test if CLI is creating figure as it should be?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have added a number of tests for the plotting module in a42fc88

Copy link
Collaborator

@alifbe alifbe left a comment

Choose a reason for hiding this comment

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

Could you please update the PR? Thank's a lot @richypitman

@richypitman
Copy link
Collaborator Author

@alifbe I think this is ready to be approved 😃

Copy link
Collaborator

@alifbe alifbe 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 to me and don't forget to squash 😄

Please consider my comment about CLI testing.

captured = capsys.readouterr()

for plot in expected_plots:
assert plot in captured.out
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice.

I think more robust way is to check if the file exist in the tmpdir But it's more of a suggestion.

@richypitman richypitman merged commit ee05460 into main Dec 20, 2023
9 checks passed
@richypitman richypitman deleted the plotting branch December 20, 2023 12:40
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.

3 participants