Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

import numpy as np 

import unittest 

from lsst.sims.featureScheduler.utils import season_calc, create_season_offset 

import lsst.utils.tests 

import healpy as hp 

 

 

class TestFeatures(unittest.TestCase): 

 

def testSeason(self): 

""" 

Test that the season utils work as intended 

""" 

night = 365.25 * 3.5 

plain = season_calc(night) 

assert(plain == 3) 

 

mod2 = season_calc(night, modulo=2) 

assert(mod2 == 1) 

 

mod3 = season_calc(night, modulo=3) 

assert(mod3 == 0) 

 

mod3 = season_calc(night, modulo=3, max_season=2) 

assert(mod3 == -1) 

 

mod3 = season_calc(night, modulo=3, max_season=2, offset=-365.25*2) 

assert(mod3 == 1) 

 

mod3 = season_calc(night, modulo=3, max_season=2, offset=-365.25*10) 

assert(mod3 == -1) 

 

mod3 = season_calc(night, modulo=3, offset=-365.25*10) 

assert(mod3 == -1) 

 

 

class TestMemory(lsst.utils.tests.MemoryTestCase): 

pass 

 

 

def setup_module(module): 

lsst.utils.tests.init() 

 

 

45 ↛ 46line 45 didn't jump to line 46, because the condition on line 45 was never trueif __name__ == "__main__": 

lsst.utils.tests.init() 

unittest.main()