Skip to content

Commit

Permalink
Fix(api): Use absolute path when reading module calibration files (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
TamarZanzouri authored and sfoster1 committed Apr 18, 2023
1 parent 8e75b29 commit 5648dd3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/src/opentrons/calibration_storage/ot3/module_offset.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ def load_all_module_offsets() -> List[v1.ModuleOffsetModel]:
files = os.listdir(config.get_opentrons_path("module_calibration_dir"))
for file in files:
try:
calibrations.append(v1.ModuleOffsetModel(**io.read_cal_file(Path(file))))
calibrations.append(
v1.ModuleOffsetModel(
**io.read_cal_file(
Path(config.get_opentrons_path("module_calibration_dir") / file)
)
)
)
except (json.JSONDecodeError, ValidationError):
log.warning(
f"Malformed module calibrations for {file}. Please factory reset your calibrations."
Expand Down

0 comments on commit 5648dd3

Please sign in to comment.