Skip to content

Commit

Permalink
Remove int initialization from return value since it's only ever an i…
Browse files Browse the repository at this point in the history
…nteger. It was added to fix a mypy issue, but now the type is initialized earlier in the function
  • Loading branch information
vmartinez-cu committed Nov 22, 2024
1 parent 327c539 commit adfb891
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion imap_processing/hit/l0/decom_hit.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ def decompress_rates_16_to_32(packed: int) -> int:
# than 1, the compressed value needs to be decompressed by reconstructing the
# integer using the mantissa and exponent. If the condition is false, the
# compressed and uncompressed values are considered the same.
decompressed_int: int
if power > 1:
# Retrieve the "mantissa" portion of the packed value by masking out the
# exponent bits
Expand All @@ -440,7 +441,7 @@ def decompress_rates_16_to_32(packed: int) -> int:
# The compressed and uncompressed values are the same
decompressed_int = packed

return int(decompressed_int)
return decompressed_int


def decom_hit(sci_dataset: xr.Dataset) -> xr.Dataset:
Expand Down

0 comments on commit adfb891

Please sign in to comment.