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

abstracting plotting #278

Merged
merged 8 commits into from
Dec 2, 2024
Merged

abstracting plotting #278

merged 8 commits into from
Dec 2, 2024

Conversation

K20shores
Copy link
Collaborator

When checking out differences in TS1, I noticed that plotting no longer worked after we (correctly) added data headers in #273

This PR

  • moves all plotting to its own file and adds tests, also makes it easier to plot
  • corrects the readme examples
  • corrects some data output functionality so that we can output to a file and print to the terminal if the output type is csv

@adityakiran1423
Copy link
Collaborator

Hello @K20shores. Just one thing :
In src/acom_music_box/main.py (before changes where made to it) the plot_with_gnuplot function runs a finally block where data_file_path is deleted if generated after successfully plotting using gnu_plot.

However

In src/acom_music_box/plot_output.py the plot_with_gnuplot function doesn't seem to have a finally block for deleting data_file_path. Is this done for a specific reason?

I've reviewed all the other files changed in the PR, looks good to me!

@adityakiran1423
Copy link
Collaborator

Looks good to me!

@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2024

Codecov Report

Attention: Patch coverage is 90.27778% with 7 lines in your changes missing coverage. Please review.

Project coverage is 81.91%. Comparing base (383e938) to head (90380ca).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/acom_music_box/plot_output.py 88.70% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #278      +/-   ##
==========================================
+ Coverage   79.90%   81.91%   +2.01%     
==========================================
  Files          12       13       +1     
  Lines         821      846      +25     
==========================================
+ Hits          656      693      +37     
+ Misses        165      153      -12     

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

@K20shores K20shores requested a review from montythind December 2, 2024 17:08
@@ -64,12 +57,12 @@ def __init__(self, df, args):
- output_format : str, optional
Format of the output file, either 'csv' or 'netcdf'. Defaults to 'csv'.
"""
self.df = df
self.df = df.copy(deep=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

is there reason for a Deep copy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, without the deep copy, the changes made on the dataframe inside this class are reflected elsewhere, and that's not what we want

@montythind
Copy link
Contributor

Looks good to me.

Copy link
Collaborator

@boulderdaze boulderdaze 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! I just have a minor suggestion

.github/workflows/pep8_autoformat.yml Outdated Show resolved Hide resolved
@K20shores K20shores merged commit 0d566a2 into main Dec 2, 2024
4 checks passed
@K20shores K20shores deleted the fix_plotting branch December 2, 2024 20:00
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.

5 participants