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

Shot plotting draft #8

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

andrew-maris
Copy link

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

Copy link
Collaborator

@eepeterson eepeterson left a 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 Show resolved Hide resolved
import matplotlib.pyplot as plt

class Shot:
"""Shot class to store data from a shot."""
Copy link
Collaborator

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

self.load_csv()


def load_csv(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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.


return fig, axs

if __name__ == "__main__":
Copy link
Collaborator

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.

@eepeterson
Copy link
Collaborator

Can you rebase on main so that tests run?
Commands to add the main repo as a remote and then update your branch are below:
git remote add upstream [email protected]:j-fletcher/fusion-toolbox.git to add Jack's repo as a remote called "upstream"
git fetch --all to update references and see if there are any changes available
git rebase upstream/main if you are already on your feature branch will rebase your commits on the current state of main
git push

@RemDelaporteMathurin RemDelaporteMathurin changed the base branch from main to apiquery September 21, 2023 17:47
@RemDelaporteMathurin RemDelaporteMathurin changed the base branch from apiquery to main September 21, 2023 17:47
Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin left a 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?

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