diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d359dacd..ec1faea9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,60 +11,42 @@ include: file: acc_py_devtools/templates/gitlab-ci/python.yml variables: - project_name: caimira + PY_VERSION: "3.11" # ################################################################################################### # Test code - CAiMIRA (model) and CERN CAiMIRA (CERN's UI) - # A full installation of CAiMIRA, tested with pytest. -test_install: - extends: .acc_py_full_test - variables: - project_root: ./caimira - project_name: caimira +.py_full_test: + image: registry.cern.ch/docker.io/library/python:${PY_VERSION} + stage: test + before_script: + - pip install -e ${caimira_root}[test] + - pip install -e ${cern_caimira_root}[test] + script: + - cd ${caimira_root} + - python -m pytest + - cd ../${cern_caimira_root} + - python -m pytest -# A development installation of CAiMIRA tested with pytest. -test_dev: - extends: .acc_py_dev_test +# A full installation of CAiMIRA, tested with pytest. +caimira_full_test: + extends: .py_full_test variables: - project_root: ./caimira - project_name: caimira + caimira_root: ./caimira + cern_caimira_root: ./cern_caimira # A development installation of CAiMIRA tested with pytest. -test_dev-39: +caimira_full_test-39: + extends: .py_full_test variables: PY_VERSION: "3.9" - project_root: ./caimira - project_name: caimira - extends: .acc_py_dev_test - -# A full installation of CERN CAiMIRA, tested with pytest. -test_install_cern_caimira: - extends: .acc_py_full_test - variables: - project_root: ./_cern_caimira - project_name: cern_caimira + caimira_root: ./caimira + cern_caimira_root: ./cern_caimira -# A development installation of CERN CAiMIRA tested with pytest. -test_dev_cern_caimira: - extends: .acc_py_dev_test - variables: - project_root: ./_cern_caimira - project_name: cern_caimira - - -# A development installation of CERN CAiMIRA tested with pytest. -test_dev-39_cern_caimira: - variables: - PY_VERSION: "3.9" - project_root: ./_cern_caimira - project_name: cern_caimira - extends: .acc_py_dev_test - # ################################################################################################### # Test OpenShift config diff --git a/caimira/pyproject.toml b/caimira/pyproject.toml index d98ad751..9281524a 100644 --- a/caimira/pyproject.toml +++ b/caimira/pyproject.toml @@ -18,27 +18,21 @@ classifiers = [ ] requires-python = ">=3.9" dependencies = [ - "ipykernel", - "ipympl>=0.9.0", - "ipywidgets<8.0", - "Jinja2", - "loky", "matplotlib", "memoization", "mistune", "numpy", "pandas", - "psutil", "pyinstrument", - "pyjwt", "python-dateutil", + "requests", "retry", "ruptures", "scipy", "scikit-learn", + "tabulate", "timezonefinder", "tornado", - "types-retry", ] [project.optional-dependencies] @@ -51,7 +45,8 @@ test = [ "numpy-stubs @ git+https://github.com/numpy/numpy-stubs.git", "types-dataclasses", "types-python-dateutil", - "types-requests" + "types-requests", + "types-retry", ] doc = [ "sphinx", @@ -71,40 +66,7 @@ addopts = "--mypy" [tool.mypy] no_warn_no_return = true exclude = "caimira/profiler.py" -ignore_missing_imports = true # TODO what to do here? - -[tool.mypy-loky] -ignore_missing_imports = true - -[tool.mypy-ipympl] -ignore_missing_imports = true - -[tool.mypy-ipywidgets] -ignore_missing_imports = true - -[tool.mypy-matplotlib] -ignore_missing_imports = true - -[tool.mypy-mistune] -ignore_missing_imports = true - -[tool.mypy-qrcode] -ignore_missing_imports = true - -[tool.mypy-scipy] -ignore_missing_imports = true - -[tool.mypy-timezonefinder] -ignore_missing_imports = true - -[tool.mypy-pandas] -ignore_missing_imports = true - -[tool.mypy-pstats] -follow_imports = "skip" - -[tool.mypy-tabulate] -ignore_missing_imports = true -[tool.mypy-ruptures] +[[tool.mypy.overrides]] +module = ["pandas", "ruptures", "scipy.*", "setuptools", "sklearn.*", "tabulate"] ignore_missing_imports = true diff --git a/caimira/src/caimira/calculator/models/monte_carlo/sampleable.py b/caimira/src/caimira/calculator/models/monte_carlo/sampleable.py index eddb4d24..e5fa361f 100644 --- a/caimira/src/caimira/calculator/models/monte_carlo/sampleable.py +++ b/caimira/src/caimira/calculator/models/monte_carlo/sampleable.py @@ -1,7 +1,7 @@ import typing import numpy as np -from sklearn.neighbors import KernelDensity # type: ignore +from sklearn.neighbors import KernelDensity from caimira.calculator.models import models diff --git a/caimira/src/caimira/scripts/data/vaccine_effectiveness.py b/caimira/src/caimira/scripts/data/vaccine_effectiveness.py index 87be7e6b..ee98ac00 100644 --- a/caimira/src/caimira/scripts/data/vaccine_effectiveness.py +++ b/caimira/src/caimira/scripts/data/vaccine_effectiveness.py @@ -1,5 +1,5 @@ -# import pandas as pd -# from tabulate import tabulate +import pandas as pd +from tabulate import tabulate ''' Script file to generate the vaccine effectiveness values. diff --git a/cern_caimira/pyproject.toml b/cern_caimira/pyproject.toml index 70d1600b..690c9847 100644 --- a/cern_caimira/pyproject.toml +++ b/cern_caimira/pyproject.toml @@ -70,7 +70,11 @@ addopts = "--mypy" [tool.mypy] no_warn_no_return = true -ignore_missing_imports = true # TODO what to do here? + +[[tool.mypy.overrides]] +module = ["caimira.*", "ipympl.*", "loky", "ipywidgets", "setuptools", "pandas"] +ignore_missing_imports = true + [tool.mypy-loky] ignore_missing_imports = true diff --git a/cern_caimira/src/cern_caimira/__init__.py b/cern_caimira/src/cern_caimira/__init__.py new file mode 100644 index 00000000..e69de29b