1. wrobell
  2. libdeco-ostc

Commits

wrobell  committed e4c5c1b Merge

- merged default branch

  • Participants
  • Parent commits fe06f3c, ccb5384
  • Branches deco-spike

Comments (0)

Files changed (8)

File .hgtags

View file
  • Ignore whitespace
 dea7573fcea20704ef8b3dd2fbafe5484411c3d8 libdeco-ostc-0.2.0
 dea7573fcea20704ef8b3dd2fbafe5484411c3d8 libdeco-ostc-0.2.0
 98c6d07971bda9c08eebd1566e58523b2a34ef12 libdeco-ostc-0.2.0
+682374758995158a6fef46022448eca7c598864b libdeco-ostc-0.3.0

File code_part1/libdeco/configure.ac

View file
  • Ignore whitespace
-AC_INIT(libdeco-ostc, 0.3.0, wrobell@pld-linux.org)
+AC_INIT(libdeco-ostc, 0.4.0, wrobell@pld-linux.org)
 
 AC_CONFIG_MACRO_DIR([m4])
 

File code_part1/libdeco/decomecha/__init__.py

View file
  • Ignore whitespace
 
 from .engine import DecoEngine, DecoInfo
 
-__version__ = '0.3.0'
+__version__ = '0.4.0'
 
 __all__ = [DecoEngine, DecoInfo]
 

File code_part1/libdeco/libdeco/deco.c

View file
  • Ignore whitespace
 
         assert(char_I_deco_N2_ratio[i] + char_I_deco_He_ratio[i] + o2 == 100);
     }
-
+    // set the bottom gas as this is not done when OSTC's
+    // deco_calc_hauptroutine function is called
+    char_I_N2_ratio = char_I_deco_N2_ratio[0];
+    char_I_He_ratio = char_I_deco_He_ratio[0];
 
     // enable CCR mode
     if (conf->setpoints)

File code_part1/libdeco/tests/profile/test_oc.py

View file
  • Ignore whitespace
 
         info = de.calculate()
 
-        self.assertEquals(12, len(info.stops))
+        self.assertEquals(11, len(info.stops))
 
-        expected = list(range(36, 0, -3))
+        expected = list(range(33, 0, -3))
         self.assertEquals(expected, [s.depth for s in info.stops])
 
-        expected = [2] * 3 + [3, 3, 2, 2, 3, 4, 8, 8, 14]
+        expected = [1, 1, 2, 3, 1, 2, 3, 4, 7, 8, 14]
         self.assertEquals(expected, [s.time for s in info.stops])
 
 

File code_part1/libdeco/tests/sanity/test_depth.py

View file
  • Ignore whitespace
         Test shallower OC NDL dive on EAN 32
         """
         d1 = DecoEngine()
-        d1.add_segment(20, 25)
+        d1.add_segment(30, 20)
         d1.add_gas(0, 32)
         i1 = d1.calculate()
 
         d2 = DecoEngine()
-        d2.add_segment(18, 25)
+        d2.add_segment(26, 20)
         d2.add_gas(0, 32)
         i2 = d2.calculate()
 
         assert len(i1.stops) == 0
         assert len(i2.stops) == 0
 
-        self.assertTrue(i1.ndl < i2.ndl)
+        # Buhlmann tables for EAN 32: 25min vs. 35 min
+        self.assertTrue(i2.ndl - i1.ndl > 8, '{} vs. {}' \
+                .format(i1.ndl, i2.ndl))
 
 
     def test_oc_ndl_tx(self):
         Test shallower OC NDL dive on TX 18/45
         """
         d1 = DecoEngine()
-        d1.add_segment(20, 25)
+        d1.add_segment(20, 20)
         d1.add_gas(0, 18, 45)
         i1 = d1.calculate()
 
         d2 = DecoEngine()
-        d2.add_segment(18, 25)
+        d2.add_segment(18, 20)
         d2.add_gas(0, 18, 45)
         i2 = d2.calculate()
 

File code_part1/libdeco/tests/sanity/test_gas.py

View file
  • Ignore whitespace
         self._verify(i1, i2, 6)
 
 
+    def test_air_ean27(self):
+        """
+        Test better gas: Air vs. EAN27
+        """
+        d1 = DecoEngine()
+        d1.add_segment(40, 25)
+        d1.add_gas(0, 21)
+
+        i1 = d1.calculate()
+
+        d2 = DecoEngine()
+        d2.add_segment(40, 25)
+        d2.add_gas(0, 27)
+
+        i2 = d2.calculate()
+
+        self._verify(i1, i2, 12)
+
+
+    def test_air_ean32_ndl(self):
+        """
+        Test better gas: Air vs. EAN32 (NDL)
+        """
+        d1 = DecoEngine()
+        d1.add_segment(30, 10)
+        d1.add_gas(0, 21)
+
+        i1 = d1.calculate()
+
+        d2 = DecoEngine()
+        d2.add_segment(30, 10)
+        d2.add_gas(0, 32)
+
+        i2 = d2.calculate()
+
+        # Buhlmann tables, the diff for Air and EAN32 is 8 min
+        self.assertTrue(i2.ndl - i1.ndl > 5, '{} vs. {}'.format(i1.ndl, i2.ndl))
+
+
     def test_air_tx_21_55(self):
         """
         Test better gas: TX 21/55 vs. Air
 
         i2 = d2.calculate()
 
-        self._verify(i1, i2, 45)
+        self._verify(i1, i2, 15)
 
 
 

File code_part1/libdeco/tests/sanity/test_gf.py

View file
  • Ignore whitespace
         d2.gf_high = 90
         i2 = d2.calculate()
 
-        self._verify(i1, i2, 15)
+        self._verify(i1, i2, 6)
 
 
     def test_ccr_gf_deeper(self):
         d2.add_gas(0, 27)
         d2.add_setpoint(0, 1.3)
         d2.gf_low = 20
-        d2.gf_high = 90
+        d2.gf_high = 95
         i2 = d2.calculate()
 
-        self._verify(i1, i2, 3)
+        self._verify(i1, i2, 9)
 
 # vim: sw=4:et:ai