-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
ENH : Add of a line for saving the filtered dataset #518
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #518 +/- ##
===========================================
- Coverage 72.02% 71.99% -0.04%
===========================================
Files 56 56
Lines 9370 9372 +2
===========================================
- Hits 6749 6747 -2
- Misses 2621 2625 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contributions! Left I quick comment on this feature regarding making the save behavior more versatile.
rocketpy/mathutils/function.py
Outdated
@@ -1112,6 +1112,9 @@ def low_pass_filter(self, alpha): | |||
alpha * self.source[i] + (1 - alpha) * filtered_signal[i - 1] | |||
) | |||
|
|||
# Save the new csv file with filtered data | |||
np.savetxt("filtered_data.csv", filtered_signal, delimiter=",") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good feature. One small note is that it might not be the user's will to always save the file and in this location.
Therefore, what I suggest is to add an optional parameter to the method filepath
(or another name you prefer) that defaults to None
(in this case nothing will be saved), but may receive the filepath (and filename) string that will go into the np.savetxt
.
The final step would be describing this behavior on this parameter docstring.
As always, we are open to any other suggestions you might have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, thank you! I didn't thought about it, I will try to implement it!
…e if he wants to save the CSV or not
…Team/RocketPy into enh/save-filtered-data
Pull request type
Checklist
black rocketpy/ tests/
) has passed locallypytest --runslow
) have passed locallyCHANGELOG.md
has been updated (if relevant)Current behavior
The code is able to filter data (of a CSV file) but doesn't save the filtered dataset.
New behavior
Once you filter a dataset, this one is saved in a CSV file.
Breaking change
Additional information
Enter text here...