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

Fix V&V processing error with Sqsh #303

Open
wants to merge 2 commits into
base: no-aiprops-report
Choose a base branch
from
Open

Conversation

jeanconn
Copy link
Contributor

@jeanconn jeanconn commented Oct 3, 2024

Description

Fix V&V processing error with Sqsh.
Put the Sqsh calls in context managers instead of using an explicit conn.close that doesn't work on Sqsh.

Fixes issue that V&V processing was going through its paces but not getting the right information to update the status table.

Interface impacts

Testing

Unit tests

  • Linux
(ska3-mica) jeanconn-fido> pytest
======================================================== test session starts ========================================================
platform linux -- Python 3.11.8, pytest-7.4.4, pluggy-1.4.0
rootdir: /proj/sot/ska/jeanproj/git
configfile: pytest.ini
plugins: timeout-2.2.0, anyio-4.3.0
collected 108 items                                                                                                                 

mica/archive/tests/test_aca_dark_cal.py ..................                                                                    [ 16%]
mica/archive/tests/test_aca_hdr3.py .                                                                                         [ 17%]
mica/archive/tests/test_aca_l0.py ...                                                                                         [ 20%]
mica/archive/tests/test_asp_l1.py .......                                                                                     [ 26%]
mica/archive/tests/test_cda.py ..............................................                                                 [ 69%]
mica/archive/tests/test_obspar.py .                                                                                           [ 70%]
mica/report/tests/test_write_report.py .                                                                                      [ 71%]
mica/starcheck/tests/test_catalog_fetches.py ...............                                                                  [ 85%]
mica/stats/tests/test_acq_stats.py ...                                                                                        [ 87%]
mica/stats/tests/test_guide_stats.py ....                                                                                     [ 91%]
mica/vv/tests/test_vv.py .........                                                                                            [100%]

================================================== 108 passed in 535.22s (0:08:55)

Independent check of unit tests by [REVIEWER NAME]

  • [PLATFORM]:

Functional tests

While I prefer not to test "live", I did so here. Old code when unhandled does:

obsid dir /fido.real/conda/envs/ska3-flight-2024.1rc4/data/mica/archive/vv/01/01456_v06 already exists
moved VV files to /fido.real/conda/envs/ska3-flight-2024.1rc4/data/mica/archive/vv/01/01456_v06
removed directory /fido.real/conda/envs/ska3-flight-2024.1rc4/data/mica/archive/tempvv/tmpb4fq4trw
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[3], line 1
----> 1 mica.vv.process.process(1456, 6)

File /proj/sot/ska/jeanproj/git/mica/mica/vv/process.py:250, in process(obsid, version)
    248 tbl = h5.get_node("/", "vv")
    249 obi.set_tbl(tbl)
--> 250 obi.slots_to_table()
    251 tbl.flush()
    252 h5.flush()

File /proj/sot/ska/jeanproj/git/mica/mica/vv/core.py:304, in Obi.slots_to_table(self)
    302 def slots_to_table(self):
    303     save = self.info()
--> 304     if save["aspect_1_id"] is None:
    305         logger.warning("Table save not implemented for obsids without aspect_1_ids")
    306         return

KeyError: 'aspect_1_id'

New code updates correctly

obsid dir /fido.real/conda/envs/ska3-flight-2024.1rc4/data/mica/archive/vv/01/01456_v06 already exists
moved VV files to /fido.real/conda/envs/ska3-flight-2024.1rc4/data/mica/archive/vv/01/01456_v06
removed directory /fido.real/conda/envs/ska3-flight-2024.1rc4/data/mica/archive/tempvv/tmpug65mcrx
obsid 1456 is in table
updating obsid 1456 rev 6 in place

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