Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lmd/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _sanitize_file_name(file_name):
warning = f"File {download_to_path} already exists!"
if not overwrite:
print(warning)
Path(lock_path).unlink()
Path(lock_path).unlink(missing_ok=True)
return
else:
print(f"{warning} Overwriting...")
Expand All @@ -108,7 +108,7 @@ def _sanitize_file_name(file_name):
else:
download_to_path.with_name(output_file_name)

Path(lock_path).unlink()
Path(lock_path).unlink(missing_ok=True)


def _download_glyphs() -> Path:
Expand Down
8 changes: 4 additions & 4 deletions src/lmd/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ def save(self, file_location: str, encoding: str = "utf-8"):

id = i + 1
x = ET.SubElement(root, f"X_CalibrationPoint_{id}")
x.text = f"{np.floor(point[0]).astype(int)}"
x.text = f"{int(round(point[0], 0))}"

y = ET.SubElement(root, f"Y_CalibrationPoint_{id}")
y.text = f"{np.floor(point[1]).astype(int)}"
y.text = f"{int(round(point[1], 0))}"

# write shape length
shape_count = ET.SubElement(root, "ShapeCount")
Expand Down Expand Up @@ -687,10 +687,10 @@ def to_xml(
for i, point in enumerate(transformed_points):
id = i + 1
x = ET.SubElement(shape, f"X_{id}")
x.text = f"{np.floor(point[0]).astype(int)}"
x.text = f"{int(round(point[0], 0))}"

y = ET.SubElement(shape, f"Y_{id}")
y.text = f"{np.floor(point[1]).astype(int)}"
y.text = f"{int(round(point[1], 0))}"

return shape

Expand Down
Loading