Skip to content

Commit

Permalink
Updating ruff and mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
maxinelasp committed Aug 30, 2024
1 parent 75240fd commit add62a4
Show file tree
Hide file tree
Showing 6 changed files with 255 additions and 169 deletions.
3 changes: 2 additions & 1 deletion examples/Dockerfile.processing
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ FROM public.ecr.aws/docker/library/python:3.10-slim
# TODO: delete this section once imap_processing is released
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y git
RUN pip install git+https://github.com/IMAP-Science-Operations-Center/imap_processing.git@dev
# RUN pip install git+https://github.com/IMAP-Science-Operations-Center/imap_processing.git@dev
RUN pip install git+https://github.com/maxinelasp/imap_processing.git@mag_l1a_compression

# Uncomment this once imap_processing is released
# RUN pip install imap_processing
Expand Down
4 changes: 2 additions & 2 deletions imap_processing/glows/l1b/glows_l1b_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,8 @@ class HistogramL1B:
spin_period_ground_std_dev: np.double = field(init=False) # Spin table
position_angle_offset_average: np.double = field(init=False) # retrieved from SPICE
position_angle_offset_std_dev: np.double = field(init=False) # retrieved from SPICE
spin_axis_orientation_std_dev: np.double = field(init=False) # retrieved from SPICE - CK
spin_axis_orientation_average: np.double = field(init=False) # retrieved from SPICE - CK
spin_axis_orientation_std_dev: np.double = field(init=False) # SPICE - CK
spin_axis_orientation_average: np.double = field(init=False) # SPICE - CK
spacecraft_location_average: np.ndarray = field(init=False) # retrieved from SPICE
spacecraft_location_std_dev: np.ndarray = field(init=False) # retrieved from SPICE
spacecraft_velocity_average: np.ndarray = field(init=False) # retrieved from SPICE
Expand Down
16 changes: 7 additions & 9 deletions imap_processing/mag/l0/mag_l0_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,13 @@ def __post_init__(self) -> None:
Also convert encoded "VECSEC" (vectors per second) into proper vectors per
second values.
"""
# Convert string output from space_packet_parser to numpy array of
# big-endian bytes
self.VECTORS = np.frombuffer(
int(self.VECTORS, 2).to_bytes(len(self.VECTORS) // 8, "big"),
# type: ignore[arg-type]
# TODO Check MYPY Error: Argument 1 to "int" has incompatible type
# "Union[ndarray[Any, Any], str]"; expected "Union[str, bytes, bytearray]"
dtype=np.dtype(">B"),
)
if isinstance(self.VECTORS, str):
# Convert string output from space_packet_parser to numpy array of
# big-endian bytes
self.VECTORS = np.frombuffer(
int(self.VECTORS, 2).to_bytes(len(self.VECTORS) // 8, "big"),
dtype=np.dtype(">B"),
)

# Remove buffer from end of vectors. Vector data needs to be in 50 bit chunks,
# and may have an extra byte at the end from CCSDS padding.
Expand Down
Loading

0 comments on commit add62a4

Please sign in to comment.