|
11 | 11 |
|
12 | 12 | logger.enable(__package__) |
13 | 13 |
|
| 14 | +# pylint: disable=too-many-locals |
| 15 | + |
14 | 16 |
|
15 | 17 | def _jpk_pixel_to_nm_scaling(tiff_page: tifffile.tifffile.TiffPage, jpk_tags: dict[str, int]) -> float: |
16 | 18 | """ |
@@ -140,11 +142,13 @@ def _get_z_scaling(tif: tifffile.tifffile, channel_idx: int, jpk_tags: dict[str, |
140 | 142 | for value in values: |
141 | 143 | if tif.pages[channel_idx].tags[str(value)].value == default_slot.value: |
142 | 144 | _default_slot = slot |
143 | | - |
| 145 | + # pylint: disable=possibly-used-before-assignment |
144 | 146 | # Determine if the default slot requires scaling and find scaling and offset values |
145 | 147 | 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))), |
147 | 150 | ) |
| 151 | + # pylint: enable=possibly-used-before-assignment |
148 | 152 | if scaling_type == "LinearScaling": |
149 | 153 | scaling_name = ( |
150 | 154 | tif.pages[channel_idx] |
@@ -202,7 +206,9 @@ def load_jpk( |
202 | 206 | Load height trace channel from the .jpk file. 'height_trace' is the default channel name. |
203 | 207 |
|
204 | 208 | >>> 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) |
206 | 212 | """ |
207 | 213 | logger.info(f"Loading image from : {file_path}") |
208 | 214 | file_path = Path(file_path) |
|
0 commit comments