-
Notifications
You must be signed in to change notification settings - Fork 191
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
CLI for plotting trajectories of binaries #5976
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.
This looks great! Thanks for writing this script. Please squash all your commits including changes you make in response to my comments below into a single commit, then force-push to this branch.
@show_or_save_plot_command() | ||
@apply_stylesheet_command() | ||
def plot_trajectories_command(h5_files, subfile_name_aha, subfile_name_ahb): |
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.
return None, None | ||
|
||
|
||
def plot_trajectory(AhA, AhB, sample_rate=15): |
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.
Please add documentation to this function that describes what the function does and also describes each argument. You find examples in the other Python files in this directory.
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.
Here is my revised version, with all the current comments/suggestions incorporated. I made the code more compact. The suggested as well as new options are documented in the help file. I'll keep working on the Test script while I wait for more feedback.
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.
Only a test is missing now as @knelli2 mentioned above. Maybe write some made-up data to a file in a setUp
function, then run the CLI command to plot it (@knelli2 pointed to some examples). You can't really test that the plot looks correct, but at least this test makes sure that the code runs without error, and keeps working in the future.
You can squash everything into 1 commit.
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.
Looks great! Move this one thing, then squash everything into a single commit.
@@ -12,115 +14,110 @@ | |||
from spectre.Informer import unit_test_build_path, unit_test_src_path | |||
from spectre.Visualization.PlotTrajectories import plot_trajectories_command | |||
|
|||
# Configure logging | |||
logging.basicConfig(level=logging.INFO) |
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.
Move this to __main__
at the bottom, like this:
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
unittest.main(verbosity=2)
fixup for PlotTrajectories CLI fixup for Test of PlotTrajectories CLI fixup 2 for PlotTrajectories CLI fixup 3 fixup 4
Yay nice job 👍 |
Proposed CLI for plotting trajectories
Code review checklist