Skip to content

Commit

Permalink
change input variable name back to "filename"
Browse files Browse the repository at this point in the history
  • Loading branch information
HaleySchuhl committed Mar 6, 2024
1 parent 2cabecd commit b276a17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions plantcv/annotate/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ def onclick(self, event):
self.sample_labels.pop(idx_remove)
self.fig.canvas.draw()

def print_coords(self, outfile):
def print_coords(self, filename):
"""Save collected coordinates to a file.
Input variables:
outfile = Name of the file to save collected coordinate
filename = Name of the file to save collected coordinate
:param filename: str
:return:
"""
# Open the file for writing
with open(outfile, "w") as fp:
with open(filename, "w") as fp:
# Save the data in JSON format with indentation
json.dump(obj=self.coords, fp=fp, indent=4)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_annotate_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_points_print_coords(test_data, tmpdir):
drawer_rgb.onclick(e2)

# Save collected coords out
drawer_rgb.print_coords(outfile=filename)
drawer_rgb.print_coords(filename)
assert os.path.exists(filename)

def test_points_import_list(test_data):
Expand Down

0 comments on commit b276a17

Please sign in to comment.