sot / kadi

Chandra commands and events
https://sot.github.io/kadi
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

test_get_pitch_from_mid_maneuver fails on linux32 #128

Closed jeanconn closed 2 years ago

jeanconn commented 5 years ago
In [2]: kadi.test()
================================================ test session starts =================================================
platform linux -- Python 3.6.2, pytest-3.2.1, py-1.4.34, pluggy-0.4.0
rootdir: /export/aca/ska3matlab32/lib/python3.6/site-packages, inifile:
plugins: openfiles-0.3.0, arraydiff-0.2, remotedata-0.3.0, doctestplus-0.1.3
collected 50 items                                                                                                    

kadi/commands/tests/test_commands.py ...
kadi/commands/tests/test_states.py ...................x............F
kadi/tests/test_events.py ..........
kadi/tests/test_occweb.py ....

====================================================== FAILURES ======================================================
__________________________________________ test_get_pitch_from_mid_maneuver __________________________________________

    def test_get_pitch_from_mid_maneuver():
        """Regression test for the fix for #125.  Mostly the same as the test above, but for
        the Maneuver transition class.

        """
        start = '2019:039:14:16:25.002'  # Mid-maneuver
        stop = '2019:039:16:00:00.000'
        exp = ['      datestart              datestop           pitch     pcad_mode',
               '--------------------- --------------------- ------------- ---------',
               '2019:039:14:16:25.002 2019:039:14:16:54.364 63.2696565838      NMAN',
               '2019:039:14:16:54.364 2019:039:14:22:01.825 83.0388345752      NMAN',
               '2019:039:14:22:01.825 2019:039:14:27:09.285 106.057258631      NMAN',
               '2019:039:14:27:09.285 2019:039:14:32:16.745 129.079427541      NMAN',
               '2019:039:14:32:16.745 2019:039:14:37:24.205 148.857427163      NMAN',
               '2019:039:14:37:24.205 2019:039:14:42:31.665 159.541502291      NMAN',
               '2019:039:14:42:31.665 2019:039:16:00:00.000 161.950922135      NPNT']

        sts = states.get_states(start, stop, state_keys=['pitch', 'pcad_mode'])
        del sts['trans_keys']

>       assert sts.pformat(max_width=-1, max_lines=-1) == exp
E       AssertionError: assert ['      dates...   NMAN', ...] == ['      datest...   NMAN', ...]
E         At index 3 diff: '2019:039:14:16:54.364 2019:039:14:22:01.825 83.0388345748      NMAN' != '2019:039:14:16:54.364 2019:039:14:22:01.825 83.0388345752      NMAN'
E         Use -v to get the full diff

kadi/commands/tests/test_states.py:1226: AssertionError
================================== 1 failed, 48 passed, 1 xfailed in 143.85 seconds ==================================
Out[2]: 1

In [3]:                                                                                                               
Do you really want to exit ([y]/n)? y
eaca-quango% echo $SKA
/export/aca/ska3matlab32
jeanconn commented 5 years ago

These look like issues in the numeric comparisons after the 8th decimal place in pitch (probably didn't need to go out that far?). I'm OK with this not getting fixed for the release if my assessment is accurate (we have tests in Ska.Shell and cmd_states that are also not passing and it would be my hope to fix up broken tests next release).

jeanconn commented 5 years ago
        exp = ['      datestart              datestop           pitch     pcad_mode',
               '--------------------- --------------------- ------------- ---------',
               '2019:039:14:16:25.002 2019:039:14:16:54.364 63.2696565838      NMAN',
               '2019:039:14:16:54.364 2019:039:14:22:01.825 83.0388345752      NMAN',
               '2019:039:14:22:01.825 2019:039:14:27:09.285 106.057258631      NMAN',
               '2019:039:14:27:09.285 2019:039:14:32:16.745 129.079427541      NMAN',
               '2019:039:14:32:16.745 2019:039:14:37:24.205 148.857427163      NMAN',
               '2019:039:14:37:24.205 2019:039:14:42:31.665 159.541502291      NMAN',
               '2019:039:14:42:31.665 2019:039:16:00:00.000 161.950922135      NPNT']

vs

ipdb> sts
<Table length=7>
      datestart              datestop           pitch     pcad_mode
        str21                 str21            float64       str4  
--------------------- --------------------- ------------- ---------
2019:039:14:16:25.002 2019:039:14:16:54.364 63.2696565838      NMAN
2019:039:14:16:54.364 2019:039:14:22:01.825 83.0388345748      NMAN  <- ends in 48 no 52
2019:039:14:22:01.825 2019:039:14:27:09.285  106.05725863       NMAN  <- stops at 3 not 31 
2019:039:14:27:09.285 2019:039:14:32:16.745 129.079427541      NMAN
2019:039:14:32:16.745 2019:039:14:37:24.205 148.857427163      NMAN
2019:039:14:37:24.205 2019:039:14:42:31.665 159.541502291      NMAN
2019:039:14:42:31.665 2019:039:16:00:00.000 161.950922135      NPNT
taldcroft commented 5 years ago

Stupid, my bad, being lazy doesn't really save time.

taldcroft commented 5 years ago

But more to the point, this is OK.

jeanconn commented 5 years ago

Thanks! And I can take some "my bad" credit for not stepping up and doing the 32 bit test before we tagged the package.