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 frontend unit test of SpectralProfile.rawValuesFp64 #2369

Open
acdo2002 opened this issue Apr 17, 2024 · 0 comments
Open

Add frontend unit test of SpectralProfile.rawValuesFp64 #2369

acdo2002 opened this issue Apr 17, 2024 · 0 comments
Labels
code maintenance For issues relating to code maintenance and quality

Comments

@acdo2002
Copy link
Contributor

Describe the motivation
We move the conversion of rawValuesFp64 to float number test to the frontend unit test. ICD-RxJS tests focus on the protobuf communication between the frontend and the backend, ICD-RxJS tests are only testing the compressed rawValuesFp64.

The conversion of rawValuesFp64 to float number is located in carta-frontend/src/utilities/Processed/Processed.ts line 59 ProcessSpectralProfile

The frontend unit test will test this line:
new Float64Array(profile.rawValuesFp64.slice().buffer)

Expected behavior
An example for the frontend unit test:

Should convert the unit8Array

SpectralProfile {
coordinate: 'z',
statsType: 4,
rawValuesFp64: Uint8Array(40) [
254, 200, 105, 252, 224, 108, 150, 63, 116,
209, 69, 71, 156, 152, 146, 63, 250, 90,
61, 131, 156, 74, 162, 63, 80, 42, 76,
112, 43, 3, 147, 63, 195, 196, 251, 25,
238, 78, 149, 63
]
}

to actual coordinate

{
  coordinate: 'z',
  statsType: 4,
  values: Float64Array(5) [
    0.021899714857178225,
    0.01816028771413998,
    0.035725489635913335,
    0.018566778878304213,
    0.02080890687551996
  ],
  progress: 1
}
@YuHsuan-Hwang YuHsuan-Hwang added the code maintenance For issues relating to code maintenance and quality label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code maintenance For issues relating to code maintenance and quality
Projects
None yet
Development

No branches or pull requests

2 participants