How to use the pycel.excelutil.iterative_eval_tracker function in pycel

To help you get started, we’ve selected a few pycel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dgorissen / pycel / tests / test_excelutil.py View on Github external
def init_tracker():
        # init the tracker
        iterative_eval_tracker(iterations=100, tolerance=0.001)
        assert iterative_eval_tracker.ns.iteration_number == 0
        assert iterative_eval_tracker.ns.iterations == 100
        assert iterative_eval_tracker.ns.tolerance == 0.001
        assert iterative_eval_tracker.tolerance == 0.001
        assert iterative_eval_tracker.done
github dgorissen / pycel / tests / test_excelutil.py View on Github external
def do_test_tracker():
        # test done if no WIP
        iterative_eval_tracker.wip(1)
        assert iterative_eval_tracker.ns.todo == {1}
        assert not iterative_eval_tracker.done
        iterative_eval_tracker.inc_iteration_number()
        assert iterative_eval_tracker.done
github dgorissen / pycel / tests / test_excelutil.py View on Github external
def test_iterative_eval_tracker():
    assert isinstance(iterative_eval_tracker.ns.todo, set)

    def init_tracker():
        # init the tracker
        iterative_eval_tracker(iterations=100, tolerance=0.001)
        assert iterative_eval_tracker.ns.iteration_number == 0
        assert iterative_eval_tracker.ns.iterations == 100
        assert iterative_eval_tracker.ns.tolerance == 0.001
        assert iterative_eval_tracker.tolerance == 0.001
        assert iterative_eval_tracker.done

    def do_test_tracker():
        # test done if no WIP
        iterative_eval_tracker.wip(1)
        assert iterative_eval_tracker.ns.todo == {1}
        assert not iterative_eval_tracker.done
        iterative_eval_tracker.inc_iteration_number()
github dgorissen / pycel / tests / test_excelutil.py View on Github external
def do_test_tracker():
        # test done if no WIP
        iterative_eval_tracker.wip(1)
        assert iterative_eval_tracker.ns.todo == {1}
        assert not iterative_eval_tracker.done
        iterative_eval_tracker.inc_iteration_number()
        assert iterative_eval_tracker.done
github dgorissen / pycel / tests / test_excelutil.py View on Github external
assert iterative_eval_tracker.tolerance == 0.001
        assert iterative_eval_tracker.done

    def do_test_tracker():
        # test done if no WIP
        iterative_eval_tracker.wip(1)
        assert iterative_eval_tracker.ns.todo == {1}
        assert not iterative_eval_tracker.done
        iterative_eval_tracker.inc_iteration_number()
        assert iterative_eval_tracker.done

    init_tracker()
    do_test_tracker()

    # init the tracker
    iterative_eval_tracker(iterations=2, tolerance=5)
    assert iterative_eval_tracker.ns.iteration_number == 0
    assert iterative_eval_tracker.ns.iterations == 2
    assert iterative_eval_tracker.ns.tolerance == 5

    # test done if max iters exceeded
    iterative_eval_tracker.inc_iteration_number()
    assert iterative_eval_tracker.ns.iteration_number == 1
    iterative_eval_tracker.wip(1)
    assert not iterative_eval_tracker.done

    iterative_eval_tracker.inc_iteration_number()
    assert iterative_eval_tracker.ns.iteration_number == 2
    iterative_eval_tracker.wip(1)
    assert iterative_eval_tracker.done

    # check calced / iscalced
github dgorissen / pycel / tests / test_excelutil.py View on Github external
def do_test_tracker():
        # test done if no WIP
        iterative_eval_tracker.wip(1)
        assert iterative_eval_tracker.ns.todo == {1}
        assert not iterative_eval_tracker.done
        iterative_eval_tracker.inc_iteration_number()
        assert iterative_eval_tracker.done
github dgorissen / pycel / tests / test_excelutil.py View on Github external
iterative_eval_tracker.inc_iteration_number()
    assert iterative_eval_tracker.ns.iteration_number == 1
    iterative_eval_tracker.wip(1)
    assert not iterative_eval_tracker.done

    iterative_eval_tracker.inc_iteration_number()
    assert iterative_eval_tracker.ns.iteration_number == 2
    iterative_eval_tracker.wip(1)
    assert iterative_eval_tracker.done

    # check calced / iscalced
    assert not iterative_eval_tracker.is_calced(1)
    iterative_eval_tracker.calced(1)
    assert iterative_eval_tracker.is_calced(1)
    iterative_eval_tracker.inc_iteration_number()
    assert not iterative_eval_tracker.is_calced(1)

    class AThread(threading.Thread):
        def run(self):
            try:
                init_tracker()
                import time
                time.sleep(0.1)
                do_test_tracker()
                self.result = True
            except:  # noqa: E722
                self.result = False

    thread = AThread()
    thread.start()
    init_tracker()
    do_test_tracker()
github dgorissen / pycel / tests / test_excelutil.py View on Github external
def do_test_tracker():
        # test done if no WIP
        iterative_eval_tracker.wip(1)
        assert iterative_eval_tracker.ns.todo == {1}
        assert not iterative_eval_tracker.done
        iterative_eval_tracker.inc_iteration_number()
        assert iterative_eval_tracker.done
github dgorissen / pycel / src / pycel / excelcompiler.py View on Github external
def value_tree_str(self, address, indent=0):
        iterative_eval_tracker.inc_iteration_number()
        yield from self._value_tree_str(address)