-
Notifications
You must be signed in to change notification settings - Fork 11
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
Shot plotting draft #8
base: main
Are you sure you want to change the base?
Conversation
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.
Nice work!! first round of comments. Generally we may want to factor out some of the plotting functionality and scripting functionality, but first let's work on the class itself.
fusion_toolbox/shot.py
Outdated
import matplotlib.pyplot as plt | ||
|
||
class Shot: | ||
"""Shot class to store data from a shot.""" |
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.
You need a class docstring that documents Parameters and Attributes - take a look at PR #2 to see an example that has been through review
fusion_toolbox/shot.py
Outdated
self.load_csv() | ||
|
||
|
||
def load_csv(self): |
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.
def load_csv(self): | |
@classmethod | |
def from_csv(self, path=None): |
This function feels a bit awkward, because the user has no control over the load_csv
method (i.e. no arguments to pass). If this is only used in the constructor then it's probably not worth having as a method on it's own. The way from_file
methods typically work is as class methods to give the user the option of specifying a path.
fusion_toolbox/shot.py
Outdated
|
||
return fig, axs | ||
|
||
if __name__ == "__main__": |
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 __name__ == "__main__":
shouldn't really be used in module files I don't think. Typically these aren't intended to be run by the command line, but scripts that should be run like this go in a separate place we can look at.
Can you rebase on main so that tests run? |
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 we add some tests to this feature?
Shot.py introduces a "shot object" that we load data into
Helper functions allow plotting in matplotlib style
Example of how it can be used are in shot.py main method