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
Create plotting function for VACF #23
Conversation
The code should work, but I am still figuring out how to write tests for it. Also want to consider and discuss whether there is a better way of going about this. |
* OO interface refers to Matplotlib's object-oriented interface
* Tests cover plotted data and labels
Tests are done, but I am struggling with the type hinting for specific class instances. Any advice @hmacdope @orionarcher? |
@@ -228,3 +229,41 @@ def _conclude_simple(self): | |||
self.results.vacf_by_particle[lag, :] = np.mean(sum_veloc, axis=0) | |||
# average over # particles and update results array | |||
self.results.timeseries = self.results.vacf_by_particle.mean(axis=1) | |||
|
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.
If this takes a VACF object only it should be a method rather than standalone.
@@ -228,3 +229,41 @@ def _conclude_simple(self): | |||
self.results.vacf_by_particle[lag, :] = np.mean(sum_veloc, axis=0) | |||
# average over # particles and update results array | |||
self.results.timeseries = self.results.vacf_by_particle.mean(axis=1) | |||
|
|||
|
|||
def plot_vacf(vacf_obj, start=0, stop=0, step=1): |
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.
can do type hint with a string `vacf_obj: "ObJType..." but see above comment.
* Method is in class `VelocityAutocorr`
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.
LGTM!
Towards #7
Changes made in this Pull Request:
plot_vacf()
to easily plot VACFs viaMatplotlib