Skip to content

Commit fd3cb1a

Browse files
committed
style(jpk|gwy): Addressing pylint errors
1 parent 95d828e commit fd3cb1a

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

AFMReader/gwy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from AFMReader.io import read_uint32, read_null_terminated_string, read_char, read_double
1111

1212

13-
def load_gwy(file_path: Path | str, channel: str) -> tuple[np.ndarray[Any, np.dtypes.Float64DType], float]:
13+
def load_gwy(file_path: Path | str, channel: str) -> tuple[np.ndarray[Any, np.float64], float]:
1414
"""
1515
Extract image and pixel to nm scaling from the .gwy file.
1616

AFMReader/jpk.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
logger.enable(__package__)
1313

14+
# pylint: disable=too-many-locals
15+
1416

1517
def _jpk_pixel_to_nm_scaling(tiff_page: tifffile.tifffile.TiffPage, jpk_tags: dict[str, int]) -> float:
1618
"""
@@ -140,11 +142,13 @@ def _get_z_scaling(tif: tifffile.tifffile, channel_idx: int, jpk_tags: dict[str,
140142
for value in values:
141143
if tif.pages[channel_idx].tags[str(value)].value == default_slot.value:
142144
_default_slot = slot
143-
145+
# pylint: disable=possibly-used-before-assignment
144146
# Determine if the default slot requires scaling and find scaling and offset values
145147
scaling_type = _get_tag_value(
146-
tif.pages[channel_idx], str(int(jpk_tags["first_scaling_type"]) + (jpk_tags["slot_size"] * (_default_slot)))
148+
tif.pages[channel_idx],
149+
str(int(jpk_tags["first_scaling_type"]) + (jpk_tags["slot_size"] * (_default_slot))),
147150
)
151+
# pylint: enable=possibly-used-before-assignment
148152
if scaling_type == "LinearScaling":
149153
scaling_name = (
150154
tif.pages[channel_idx]
@@ -202,7 +206,9 @@ def load_jpk(
202206
Load height trace channel from the .jpk file. 'height_trace' is the default channel name.
203207
204208
>>> from AFMReader.jpk import load_jpk
205-
>>> image, pixel_to_nanometre_scaling_factor = load_jpk(file_path="./my_jpk_file.jpk", channel="height_trace", flip_image=True)
209+
>>> image, pixel_to_nanometre_scaling_factor = load_jpk(file_path="./my_jpk_file.jpk",
210+
>>> channel="height_trace",
211+
>>> flip_image=True)
206212
"""
207213
logger.info(f"Loading image from : {file_path}")
208214
file_path = Path(file_path)

0 commit comments

Comments
 (0)