Skip to content

Commit

Permalink
Fixed type.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaeladuta committed Dec 2, 2024
1 parent e9f8e9f commit 7c8c37e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions l2gv2/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,18 +465,18 @@ def plot_reconstruction(
return error


def save_data(points: np.ndarray, filename: str):
def save_data(points: np.ndarray, fname: str):
"""Save an array of points to a CSV file.
Ensures the specified filename has a `.csv` extension and
writes the data to a CSV file with UTF-8 encoding.
Args:
points (np.ndarray): Array of data points to save, where each row is a data point.
filename (str): Desired filename for saving the data.
points: Array of data points to save, where each row is a data point.
fname: Desired filename for saving the data.
"""
filename = ut.ensure_extension(filename, ".csv")
filename = ut.ensure_extension(fname, ".csv")
with open(filename, "w", newline="", encoding="utf-8") as f:
writer = csv.writer(f)
writer.writerows(points)
Expand Down Expand Up @@ -531,7 +531,7 @@ def main(arguments: argparse.Namespace):
dim=arguments.dim,
)
outdir = Path(arguments.outdir)
save_data(points, filename=outdir / "points.csv")
save_data(points, fname=outdir / "points.csv")
patches = voronoi_patches(
points=points,
sample_size=arguments.sample_size,
Expand Down

0 comments on commit 7c8c37e

Please sign in to comment.