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

Test to open images and file information #222

Merged
merged 11 commits into from
Apr 14, 2021
Merged

Conversation

zarda
Copy link
Contributor

@zarda zarda commented Apr 9, 2021

For #165 and #221, to test requesting the information of files and opening the images.

OPEN_IMAGE_PV will test the image containing pv data.
OPEN_IMAGE_CASA_VARIENTS will test the variant casa images.
FILEINFO_CASA_VARIENTS will check out the file info in the variant casa images.

Use Jest.toMatchSnapshot() to see if the responding message is as exact as expected.

@zarda zarda requested review from ajm-ska and acdo2002 April 9, 2021 07:41
Copy link

@ajm-ska ajm-ska left a comment

Choose a reason for hiding this comment

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

It works on Ubuntu.

I copied over the new /set_casaImageVarients folder to the Mac, but unfortunately there is a problem with these new 'snapshot' files. For example,

-     "date": "1575483289",
+     "date": "1618195790",
      "name": "componentlist.image",
      "size": "1880126",

-     "date": "1575483289",
+     "date": "1618195859",
      "name": "concatenated.image",
      "size": "1134908779",

            "entryType": "FLOAT",
            "name": "OBSDEC",
-           "numericValue": 13.277961108781836,
+           "numericValue": 13.277961108781838,
            "value": "1.327796110878E+01",

Could it be that the image files on the Mac are different (older versions) compared the ones currently on almalustre?

@zarda
Copy link
Contributor Author

zarda commented Apr 12, 2021

If the header item is trivial, we might skip it. Such as the file 'date' of creation.
The precision of float number would be considered as a test case.

and add a tolerance to precision digits
@zarda zarda requested a review from ajm-ska April 12, 2021 04:36
@ajm-ska
Copy link

ajm-ska commented Apr 12, 2021

Now the only problem is the float number in OPEN_IMAGE_CASA_VARIENTS.test.ts

-         "numericValue": 13.277961108781836,
+         "numericValue": 13.277961108781838,
          "value": "1.327796110878E+01",

How accurate does it need to be?

@zarda
Copy link
Contributor Author

zarda commented Apr 12, 2021

Suppose it's enough to set 4 digits here.

@kswang1029
Copy link

it is better to use relative error and tolerance.

@zarda
Copy link
Contributor Author

zarda commented Apr 12, 2021

How about verify its digits after transferring this float number to an exponential float number?
0.001234321 -> 1.234321E-3 -> 1.234E-3
........................................^

@acdo2002
Copy link
Contributor

So far testing with Ubuntu and MacOS, they works fine with ws.
Even generating the snapshots folder at the first run.

Copy link

@ajm-ska ajm-ska left a comment

Choose a reason for hiding this comment

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

Good. Seems fine on Ubuntu and MacOS now.

@zarda zarda merged commit e7b7bc6 into master Apr 14, 2021
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