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

MNT/ENH: Add FLOAT and FILL options for spreadsheet dataType #701

Merged

Conversation

greglucas
Copy link
Collaborator

Change Summary

Overview

This adds two new options to the handled data types, and also raises an error if we get a datatype that isn't handled. This is important because otherwise there will be a parameter added without a corresponding parameterType entry.

Working from an SCID spreadsheet, I now get the following parameterTypes, when they were missing before.

			<xtce:IntegerParameterType name="SCID_X252_FILL6" signed="false">
				<xtce:IntegerDataEncoding sizeInBits="6" encoding="unsigned" />
			</xtce:IntegerParameterType>
			<xtce:FloatParameterType name="SCID_X252_SCIENCEDATA1HZ_QUAT_10_HZ_TIME">
				<xtce:FloatDataEncoding sizeInBits="64" encoding="IEEE-754" />
			</xtce:FloatParameterType>

closes #697

@greglucas greglucas requested a review from tech3371 July 22, 2024 21:29
This adds two new options to the handled data types, and also raises
an error if we get a datatype that isn't handled. This is important
because otherwise there will be a parameter added without a corresponding
parameterType entry.
@greglucas greglucas force-pushed the xtce-float-fill branch 2 times, most recently from c593f9f to 955845d Compare July 26, 2024 13:59
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I went down the road of mocking/creating this spreadsheet in code, but it ended up being a lot more confusing in my opinion to follow what was being changed/updated. So this seemed reasonable to add a small-ish binary file for testing this routine for clarity's sake.

Add a simple excel file with variable types we want to test and
assert against a known XML file we have produced.
@greglucas
Copy link
Collaborator Author

@tech3371, ping for review on this again.

Copy link
Contributor

@tech3371 tech3371 left a comment

Choose a reason for hiding this comment

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

LGTM!

def test_generated_xml(excel_file, tmp_path):
"""Make sure we are producing the expected contents within the XML file.

To produce a new expected output file the following command can be used.
Copy link
Contributor

Choose a reason for hiding this comment

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

Good to know! This makes me wonder, do we have readme for this cli tool?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We have an issue to make this better! On my list...
#703

Copy link
Contributor

@subagonsouth subagonsouth left a comment

Choose a reason for hiding this comment

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

LGTM. I will admit that I am not up to speed on the xtce requirements though.

@greglucas greglucas merged commit ba50882 into IMAP-Science-Operations-Center:dev Jul 30, 2024
17 checks passed
@greglucas greglucas deleted the xtce-float-fill branch July 30, 2024 20:14
@bourque bourque added the enhancement New feature or request label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

BUG - FLOAT and FILL data types not supported in XTCE converter
4 participants