Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the tool data_product_writer with unit test. #163

Merged
merged 24 commits into from
May 29, 2024

Conversation

garthwatney
Copy link
Contributor

Related Issue(s)
Has Unit Tests (y/n)
Documentation Included (y/n)

Change Description

Added the Data Product writer tool which reads a data product binary file and deserializes the data into a JSON output file.
The binary file may contain 1 or more Records which are specified in the FPP.
A unit test is also added which reads in a collection of binary files and produces the resultant JSON data.
The unit test includes a JSON Dictionary which is a manual translation of the DpTool component's FPP.
By running the DpTool component's unit test will generate a collection of binary files. DpTool and its unit test are in the F prime repo under FpTools/dpTool
In addition another JSON file is part of the tool which encapsulates the specification of the data product header information.

Rationale

A tool to deserialize and display F prime data products.

Testing/Review Recommendations

The data_product_writer.py is located in src/fprime_gds/executables
The unit test is located in test/fprime_gds/executables
Run test_data_product_writer.py. The tool will be invoked for each *.bin file in this directory. All the JSON output is placed in JSONoutput

Future Work

Once the F prime JSON dictionary is part of the build, the tool will need to be changed to access this file.

@Joshua-Anderson
Copy link
Contributor

Often times data products wind up storing opaque binary data - it might be nice to provide a mode that decodes the DP header/metadata to a json file but stores the contents of the dp as a binary data instead.

Copy link
Collaborator

@thomas-bc thomas-bc left a comment

Choose a reason for hiding this comment

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

Since I was in there already, I made the few changes that make your test cases runnable in CI and with pytest, I hope you don't mind.

A few comments below:

src/fprime_gds/executables/data_product_writer.py Outdated Show resolved Hide resolved
src/fprime_gds/executables/plotData.py Outdated Show resolved Hide resolved
test/fprime_gds/executables/dictionary.json Outdated Show resolved Hide resolved
src/fprime_gds/executables/data_product_writer.py Outdated Show resolved Hide resolved
test/fprime_gds/executables/test_data_product_writer.py Outdated Show resolved Hide resolved
@garthwatney garthwatney requested a review from thomas-bc May 15, 2024 22:05
Copy link
Collaborator

@thomas-bc thomas-bc left a comment

Choose a reason for hiding this comment

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

The code looks good to me! Question about the dictionary, and one comment about reusability.

src/fprime_gds/executables/data_product_writer.py Outdated Show resolved Hide resolved
thomas-bc
thomas-bc previously approved these changes May 29, 2024
Copy link
Collaborator

@thomas-bc thomas-bc left a comment

Choose a reason for hiding this comment

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

LGTM!

@thomas-bc thomas-bc merged commit 2c95a45 into nasa:devel May 29, 2024
11 checks passed
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.

4 participants