Skip to content

Commit

Permalink
run ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
arturtoshev committed Jun 25, 2024
1 parent c10009a commit b24cbbb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions data_gen/lagrangebench_data/plot_frame.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
"""Print a frame for visual inspection of the data."""

import matplotlib.pyplot as plt
import numpy as np
import h5py
import argparse

import h5py
import matplotlib.pyplot as plt


def plot_frame(src_dir, frame):
with h5py.File(src_dir, "r") as f:
tag = f["00000/particle_type"][:]
r = f["00000/position"][frame]

fig = plt.figure()
plt.scatter(r[:,0], r[:,1], c=tag)
plt.scatter(r[:, 0], r[:, 1], c=tag)
plt.savefig(f"frame_{frame}.png")


if __name__ == "__main__":

parser = argparse.ArgumentParser(
description="Print a frame for visual inspection of the data."
)
Expand Down

0 comments on commit b24cbbb

Please sign in to comment.