Skip to content

Add ccsds_reader_pipeline.py - #13

Merged
namurphy merged 9 commits into
PlasmaPy:mainfrom
namurphy:ccsds-reader-pipeline
Sep 3, 2026
Merged

Add ccsds_reader_pipeline.py#13
namurphy merged 9 commits into
PlasmaPy:mainfrom
namurphy:ccsds-reader-pipeline

Conversation

@namurphy

@namurphy namurphy commented Sep 3, 2026

Copy link
Copy Markdown
Member

Description

This pull requests adds ccsds_reader_pipeline.py to a new pipeline subpackage, which contains the bulk of the functionality for the decommutation step (level 0 to level 0.5). This PR includes autoformatting and safe fixes to get the pre-commit checks to pass.

Description

  • Created pipeline subpackage
  • Added ccsds_reader_pipeline.py from /psp/code
  • Made automated changes via pre-commit
    • Autoformatted the file with ruff format
    • Performated safe automated fixes with ruff check
  • Added comments to ignore remaining failures with ruff and ty (note: some of the ruff changes have unsafe fixes; however, I totes don't want to try those before getting the automated tests set up.

Comment on lines +37 to +40
#########################################
def read_stdin(ptp=False, verbose=False): # noqa: ANN001, ANN201, FBT002
"""Parse binary stream on stdin""" # noqa: D400

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function originally had naught but a pass, so we can probably delete it...though it may be used elsewhere.



#########################################
def wrapper_status(path="", verbose=False, gzip=False, spconly=False): # noqa: ANN001, ANN201, ARG001, D103, FBT002

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably use the Parameter design pattern here at least partially, since there are functions with overlap in inputs.

@namurphy
namurphy merged commit 8bd9c28 into PlasmaPy:main Sep 3, 2026
11 checks passed
@namurphy
namurphy deleted the ccsds-reader-pipeline branch September 3, 2026 21:16
@namurphy namurphy changed the title Add original ccsds_reader_pipeline.py Add ccsds_reader_pipeline.py Sep 3, 2026
Comment on lines +110 to +121
# Define a pattern that will match a SWEM wrapper header and an SPC instrument header
pattern = struct.pack("1B", 0x0B)
pattern += b"["
for wrap_ap in wrapper_apids: # allowable wrapper apids
pattern += struct.pack("1B", wrap_ap & 255)
pattern += b"]"
pattern += b"." * 10
pattern += struct.pack("1B", 0x0B)
pattern += b"["
for inst_ap in ok_apids: # allowable SPC instrument apids
pattern += struct.pack("1B", inst_ap & 255)
pattern += b"]"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to extract this into a standalone function so that we can write tests for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant