Skip to content

Filter observations and starcats by scheduled obsid and other obs params#380

Merged
taldcroft merged 12 commits intomasterfrom
select-scheduled-obsid
Mar 25, 2026
Merged

Filter observations and starcats by scheduled obsid and other obs params#380
taldcroft merged 12 commits intomasterfrom
select-scheduled-obsid

Conversation

@taldcroft
Copy link
Copy Markdown
Member

@taldcroft taldcroft commented Mar 3, 2026

Description

This generalizes the possible filtering of observations to include obsid_sched (as a named parameter) as well as any other key in the observation dict.

Interface impacts

Testing

This needs the cmds3.h5 / cmds3.pkl files in SKA data.

Unit tests

  • Mac
(ska3) ➜  kadi git:(select-scheduled-obsid) pytest           
=========================================== test session starts ============================================
platform darwin -- Python 3.13.11, pytest-9.0.2, pluggy-1.6.0
rootdir: /Users/aldcroft/git
configfile: pytest.ini
plugins: anyio-4.12.1, timeout-2.4.0
collected 311 items                                                                                        

kadi/commands/tests/test_commands.py .............................................................s. [ 20%]
.............................                                                                        [ 29%]
kadi/commands/tests/test_commands_v2.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 48%]
ssssssssssssssssssssssssssss                                                                         [ 57%]
kadi/commands/tests/test_filter_events.py ..                                                         [ 58%]
kadi/commands/tests/test_states.py ...............................................x................. [ 79%]
.........                                                                                            [ 82%]
kadi/commands/tests/test_validate.py ......................                                          [ 89%]
kadi/tests/test_events.py ..........                                                                 [ 92%]
kadi/tests/test_occweb.py .......................                                                    [100%]

========================== 221 passed, 89 skipped, 1 xfailed in 114.17s (0:01:54) ==========================
(ska3) ➜  kadi git:(select-scheduled-obsid) git rev-parse --short HEAD
c7d20b1

Commands v2

(ska3) ➜  kadi git:(select-scheduled-obsid) env KADI_CMDS_VERSION=2 pytest          
================================================== test session starts ==================================================
platform darwin -- Python 3.13.11, pytest-9.0.2, pluggy-1.6.0
rootdir: /Users/aldcroft/git
configfile: pytest.ini
plugins: anyio-4.12.1, timeout-2.4.0
collected 309 items                                                                                                     

kadi/commands/tests/test_commands.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 24%]
ssssssssssssss                                                                                                    [ 29%]
kadi/commands/tests/test_commands_v2.py ......................................................................... [ 52%]
...............                                                                                                   [ 57%]
kadi/commands/tests/test_filter_events.py ..                                                                      [ 58%]
kadi/commands/tests/test_states.py ...............................................x..........................     [ 82%]
kadi/commands/tests/test_validate.py ......................                                                       [ 89%]
kadi/tests/test_events.py ..........                                                                              [ 92%]
kadi/tests/test_occweb.py .......................                                                                 [100%]

================================ 218 passed, 90 skipped, 1 xfailed in 111.64s (0:01:51) =================================

Independent check of unit tests by Jean

  • Linux
jeanconn-kady> git rev-parse HEAD
c7d20b10286313ec0654ce86108fa69558104585
jeanconn-kady> pytest
============================================================================================= test session starts ==============================================================================================
platform linux -- Python 3.13.11, pytest-9.0.2, pluggy-1.6.0
rootdir: /proj/sot/ska/jeanproj/git
configfile: pytest.ini
plugins: anyio-4.12.1, timeout-2.4.0
collected 311 items                                                                                                                                                                                            

kadi/commands/tests/test_commands.py .............................................................s..............................                                                                        [ 29%]
kadi/commands/tests/test_commands_v2.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss                                                                         [ 57%]
kadi/commands/tests/test_filter_events.py ..                                                                                                                                                             [ 58%]
kadi/commands/tests/test_states.py ...............................................x..........................                                                                                            [ 82%]
kadi/commands/tests/test_validate.py ......................                                                                                                                                              [ 89%]
kadi/tests/test_events.py ..........                                                                                                                                                                     [ 92%]
kadi/tests/test_occweb.py .......................                                                                                                                                                        [100%]

============================================================================ 221 passed, 89 skipped, 1 xfailed in 223.77s (0:03:43)

Functional tests

Documentation build was successful.

@taldcroft taldcroft requested review from javierggt and jeanconn March 9, 2026 20:18
Comment thread kadi/commands/observations.py
Comment thread kadi/commands/observations.py
Comment thread kadi/commands/observations.py Outdated
Comment thread kadi/commands/observations.py
@jeanconn
Copy link
Copy Markdown
Contributor

Just an FYI that with the changes up to 9c6721 this is not passing tests.

@taldcroft
Copy link
Copy Markdown
Member Author

Sigh, should have gone with my first instinct so say that perfect is the enemy of good. Instead 1/2 hour spent for this little error message and now #382 has a merge conflict.

@taldcroft
Copy link
Copy Markdown
Member Author

But tests are passing for me now.

@taldcroft
Copy link
Copy Markdown
Member Author

I'm going to wait on final approvals for this PR before rebasing #382.

Comment thread kadi/commands/observations.py Outdated
@taldcroft taldcroft merged commit 2ecf220 into master Mar 25, 2026
5 checks passed
@taldcroft taldcroft deleted the select-scheduled-obsid branch March 25, 2026 12:55
@javierggt javierggt mentioned this pull request Apr 7, 2026
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.

3 participants