예제 #1
0
def many_with_pumps(settings, init_steps=tpid_cool_start):
    """
    Make a LongRecipe for temp PID testing using the given settings.
    Settings is an iterable yielding valid inputs to full_test_with_pumps.
    A long recipe start is added to initialize the test.

    Settings must be 2-5 ints (or floats) long, yielding (Pgain, Itime, [Dtime,
    [set-point, [start_temp]]]), and will be passed to full_test_with_pumps directly
    without error checking.


    @param settings: list of settings to pass
    @type settings: collections.Iterable[collections.Iterable[int | float]]
    @return: recipe
    @rtype: LongRecipe
    """

    long_recipe = LongRecipe()
    long_recipe.add_recipe(init_steps)

    for settings in settings:
        recipe = full_test_with_pumps(*settings)
        long_recipe.add_recipe(recipe)

    return long_recipe
예제 #2
0
def make_long_recipe(settings, init_steps=tpid_cool_start):
    """
    @param settings: iterable of tuples of (p, i, d) settings.
    @type settings: collections.Iterable[(int | float, int | float, int | float)]
    @param init_steps: A recipe with steps used to initialize the test. This defaults to
                        a short recipe warming water to ~29 before allowing it to settle at
                        28 degrees, the standard test start temp. If using many recipes
                        in a row on a pbs bioreactor, it may be useful to use
                        custom init steps to re-initialize behavior more quickly
                        than the standard recipe does.
    @type init_steps: T <= Recipe
    @return: Recipe
    @rtype: LongRecipe

    """
    recipes = [make_full_test_body(p, i, d, 37) for p, i, d in settings]

    long = LongRecipe()
    long.add_recipe(init_steps)
    long.extend_recipes(recipes)

    return long
예제 #3
0
    def test_print_steps(self):

        r = Recipe()
        self.make_recipe1(r)
        buf = StringIO()
        r.print_steps(buf)
        result1 = buf.getvalue()

        r2 = LongRecipe()
        self.make_recipe1(r2)
        del buf
        buf = StringIO()
        r2.print_steps(buf)
        result2 = buf.getvalue()

        expected = """
Set "foo" to 5
Wait 45 seconds
Set "temppv" to 16
Wait until "barbaz" != bazbar
"""

        self.assertEqual(expected, result1)
        self.assertEqual(expected, result2)