diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index e8bdc6e..2630c41 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -19,14 +19,15 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python 3.12 uses: actions/setup-python@v3 with: python-version: "3.12" + cache: 'pip' # caching pip dependencies - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest + pip install flake8 pytest mypy if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | @@ -34,6 +35,12 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Run mypy + uses: sasanquaneuf/mypy-github-action@releases/v1 + with: + checkName: 'build' # NOTE: this needs to be the same as the job name + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Test with pytest run: | pytest diff --git a/README.md b/README.md index 7b56303..44b9591 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ jupyter lab - https://github.com/miguelrizzog96/Queue_Simulation_Python/blob/master/server.ipynb - https://notebook.community/xunilrj/sandbox/courses/IMTx-Queue-Theory/Week2_Lab_MM1 - https://github.com/eveneveno/MMC_queue +- https://github.com/miguelrizzog96/Queue_Simulation_Python ## Distributions - https://numpy.org/doc/stable/reference/random/generated/numpy.random.exponential.html diff --git a/src/queue.py b/src/queue.py index 271a7fe..54bd249 100644 --- a/src/queue.py +++ b/src/queue.py @@ -7,7 +7,7 @@ def __init__(self, inter_arrival_times, execution_times, executors=1) -> None: self.__execution_times = execution_times self.__departure_times = np.empty_like(inter_arrival_times) self.__wait_times = np.empty_like(inter_arrival_times) - self.__utilization_by_executor = { + self.__utilization_by_executor: dict[int, list[float]] = { executor_id: [] for executor_id in range(0, executors) }