Skip to content

Commit

Permalink
mypy passes
Browse files Browse the repository at this point in the history
  • Loading branch information
daralynnrhode committed Aug 7, 2024
1 parent a12001a commit 32a0730
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions imap_processing/swe/l1b/swe_l1b_science.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Any

import numpy as np
import numpy.typing as npt
import pandas as pd
import xarray as xr

Expand Down Expand Up @@ -70,7 +71,7 @@ def read_lookup_table(table_index_value: int) -> Any:
raise ValueError("Error: Invalid table index value")


def deadtime_correction(counts: np.ndarray, acq_duration: int) -> np.ndarray:
def deadtime_correction(counts: np.ndarray, acq_duration: int) -> npt.NDArray:
"""
Calculate deadtime correction.
Expand Down Expand Up @@ -118,7 +119,7 @@ def deadtime_correction(counts: np.ndarray, acq_duration: int) -> np.ndarray:
return corrected_count


def convert_counts_to_rate(data: np.ndarray, acq_duration: int) -> np.ndarray:
def convert_counts_to_rate(data: np.ndarray, acq_duration: int) -> npt.NDArray:
"""
Convert counts to rate using sampling time.
Expand Down Expand Up @@ -206,7 +207,7 @@ def apply_in_flight_calibration(data: np.ndarray) -> None:

def populate_full_cycle_data(
l1a_data: xr.Dataset, packet_index: int, esa_table_num: int
) -> np.ndarray:
) -> npt.NDArray:
"""
Populate full cycle data array using esa lookup table and l1a_data.
Expand Down Expand Up @@ -277,7 +278,7 @@ def populate_full_cycle_data(
return full_cycle_data


def find_cycle_starts(cycles: np.ndarray) -> np.ndarray:
def find_cycle_starts(cycles: np.ndarray) -> npt.NDArray:
"""
Find index of where new cycle started.
Expand Down Expand Up @@ -312,7 +313,7 @@ def find_cycle_starts(cycles: np.ndarray) -> np.ndarray:
return np.where(valid)[0]


def get_indices_of_full_cycles(quarter_cycle: np.ndarray) -> np.ndarray:
def get_indices_of_full_cycles(quarter_cycle: np.ndarray) -> npt.NDArray:
"""
Get indices of full cycles.
Expand Down

0 comments on commit 32a0730

Please sign in to comment.