Skip to content

Commit

Permalink
Snakecase writeTiff
Browse files Browse the repository at this point in the history
  • Loading branch information
stefsmeets committed Jun 23, 2023
1 parent ef07898 commit ada8559
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/instamatic/camera/camera_emmenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,18 +363,18 @@ def getCameraName(self) -> str:
"""Get the name reported by the camera."""
return self._cam.name

def writeTiffFromPointer(self, image_pointer, filename: str) -> None:
def write_tiff_from_pointer(self, image_pointer, filename: str) -> None:
"""Write tiff file using the EMMENU machinery `image_pointer` is the
memory address returned by `getImageIndex()`"""
self._emf.WriteTiff(image_pointer, filename)

def writeTiff(self, image_index, filename: str) -> None:
def write_tiff(self, image_index, filename: str) -> None:
"""Write tiff file using the EMMENU machinery `image_index` is the
index in the current directory of the image to be written."""
drc_index = self.drc_index
p = self.getImageByIndex(image_index, drc_index)

self.writeTiffFromPointer(p, filename)
self.write_tiff_from_pointer(p, filename)

def write_tiffs(self, start_index: int, stop_index: int, path: str, clear_buffer: bool = False) -> None:
"""Write a series of data in tiff format and writes them to the given
Expand All @@ -394,7 +394,7 @@ def write_tiffs(self, start_index: int, stop_index: int, path: str, clear_buffer
# TODO: wrap writeTiff in try/except
# writeTiff causes vague error if image does not exist

self.writeTiffFromPointer(p, fn)
self.write_tiff_from_pointer(p, fn)

if clear_buffer:
# self._immgr.DeleteImageBuffer(drc_index, image_index) # does not work on 3200
Expand Down
2 changes: 1 addition & 1 deletion src/instamatic/camera/camera_gatan2.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def getCameraName(self) -> str:
"""Get the name reported by the camera."""
return self.name

def writeTiff(self, filename: str) -> None:
def write_tiff(self, filename: str) -> None:
"""Write tiff file using the DM machinery."""
raise NotImplementedError

Expand Down

0 comments on commit ada8559

Please sign in to comment.