Josep Pon Farreny commited on
Commit
3ea4ef0
·
1 Parent(s): aa722cf

chore: Add repository structure files

Browse files
Files changed (8) hide show
  1. .gitignore +130 -0
  2. .pre-commit-config.yaml +118 -0
  3. README.md +17 -1
  4. pyproject.toml +132 -0
  5. requirements-dev.txt +55 -0
  6. requirements.txt +25 -1
  7. tdagent/__init__.py +0 -0
  8. uv.lock +0 -0
.gitignore ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ env/
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+
28
+ # PyInstaller
29
+ # Usually these files are written by a python script from a template
30
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ .hypothesis/
48
+ .pytest_cache/
49
+
50
+ # Translations
51
+ *.mo
52
+ *.pot
53
+
54
+ # PyBuilder
55
+ target/
56
+
57
+ # Jupyter Notebook
58
+ .ipynb_checkpoints
59
+
60
+ # pyenv
61
+ .python-version
62
+
63
+ # dotenv
64
+ .env
65
+
66
+ # virtualenv
67
+ .venv
68
+ venv/
69
+ ENV/
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # mkdocs documentation
75
+ /site
76
+ docs/*.png
77
+
78
+ # mypy
79
+ .mypy_cache/
80
+
81
+ # vscode cache
82
+ .vscode
83
+
84
+ # Pycharm files
85
+ .idea
86
+
87
+ ### macOS template
88
+ *.DS_Store
89
+ .AppleDouble
90
+ .LSOverride
91
+
92
+ # serverless
93
+ **/.serverless
94
+ **/node_modules
95
+
96
+ # terraform
97
+ **/.terraform
98
+ *.tfstate*
99
+
100
+ # exclude temp files from source control
101
+ temp/
102
+ tmp/
103
+
104
+ # exclude data from source control by default
105
+ /data/*
106
+
107
+ !/data/sat2023-sample/
108
+ !/data/cnf-sample/
109
+
110
+ !/data/sat2023-cos-similarity-dataset/
111
+ /data/sat2023-cos-similarity-dataset/*
112
+ !/data/sat2023-cos-similarity-dataset/results_main_detailed.csv
113
+
114
+ # Configurations
115
+ /config/
116
+
117
+ # Logs
118
+ lightning_logs/
119
+
120
+ # Models
121
+ /models/
122
+
123
+
124
+ # Poetry code artifact settings
125
+ .poetry/
126
+ poetry.toml
127
+
128
+ # Mise
129
+ .mise.toml
130
+ mise.toml
.pre-commit-config.yaml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v2.4.0
4
+ hooks:
5
+ - id: requirements-txt-fixer
6
+ files: requirements.txt|requirements-dev.txt|requirements-test.txt
7
+ - id: trailing-whitespace
8
+ exclude: |
9
+ (?x)^(
10
+ notebooks/
11
+ )
12
+ args: [--markdown-linebreak-ext=md]
13
+ - id: end-of-file-fixer
14
+ exclude: |
15
+ (?x)^(
16
+ notebooks/
17
+ )
18
+ - id: check-yaml
19
+ - id: check-symlinks
20
+ - id: check-toml
21
+ - id: check-added-large-files
22
+ args: ["--maxkb=1000"]
23
+ - repo: https://github.com/asottile/add-trailing-comma
24
+ rev: v3.1.0
25
+ hooks:
26
+ - id: add-trailing-comma
27
+ - repo: https://github.com/psf/black
28
+ rev: 23.1.0
29
+ hooks:
30
+ - id: black
31
+ exclude: |
32
+ (?x)^(
33
+ notebooks/
34
+ )
35
+ - repo: https://github.com/pycqa/isort
36
+ rev: "5.12.0"
37
+ hooks:
38
+ - id: isort
39
+ exclude: |
40
+ (?x)^(
41
+ notebooks/
42
+ )
43
+ - repo: https://github.com/astral-sh/ruff-pre-commit
44
+ rev: v0.9.7
45
+ hooks:
46
+ - id: ruff # linter
47
+ exclude: |
48
+ (?x)^(
49
+ scripts/|
50
+ notebooks/
51
+ )
52
+ # - id: ruff-format
53
+ - repo: local
54
+ hooks:
55
+ - id: update-req
56
+ name: Update requirements.txt
57
+ stages: [pre-commit]
58
+ language: system
59
+ entry: uv
60
+ files: uv.lock|requirements.txt
61
+ pass_filenames: false
62
+ args:
63
+ [
64
+ "export",
65
+ "--format",
66
+ "requirements-txt",
67
+ "--no-hashes",
68
+ "--no-dev",
69
+ "-o",
70
+ "requirements.txt",
71
+ ]
72
+ - id: update-dev-req
73
+ name: Update requirements-dev.txt
74
+ stages: [pre-commit]
75
+ language: system
76
+ entry: uv
77
+ files: uv.lock|requirements-dev.txt
78
+ pass_filenames: false
79
+ args:
80
+ [
81
+ "export",
82
+ "--format",
83
+ "requirements-txt",
84
+ "--no-hashes",
85
+ "--group",
86
+ "dev",
87
+ "--group",
88
+ "test",
89
+ "-o",
90
+ "requirements-dev.txt",
91
+ ]
92
+ - id: mypy
93
+ name: Running mypy
94
+ stages: [commit]
95
+ language: system
96
+ entry: uv run mypy
97
+ args: [--install-types, --non-interactive]
98
+ types: [python]
99
+ exclude: |
100
+ (?x)^(
101
+ scripts/|
102
+ notebooks/
103
+ )
104
+
105
+ # - id: pytest
106
+ # name: pytest
107
+ # stages: [commit]
108
+ # language: system
109
+ # entry: poetry run pytest
110
+ # types: [python]
111
+
112
+ # - id: pytest-cov
113
+ # name: pytest
114
+ # stages: [push]
115
+ # language: system
116
+ # entry: poetry run pytest --cov --cov-fail-under=100
117
+ # types: [python]
118
+ # pass_filenames: false
README.md CHANGED
@@ -11,4 +11,20 @@ license: apache-2.0
11
  short_description: tdb
12
  ---
13
 
14
- An example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  short_description: tdb
12
  ---
13
 
14
+ # TDA Agent
15
+
16
+ # Development setup
17
+
18
+ To start developing you need the following tools:
19
+
20
+ * [uv](https://docs.astral.sh/uv/)
21
+
22
+ To start, sync all the dependencies with `uv sync --all-groups`.
23
+ Then, install the pre-commit hooks (`uv run pre-commit install`) to
24
+ ensure that future commits comply with the bare minimum to keep
25
+ code _readable_.
26
+
27
+
28
+ ## Old content
29
+
30
+ An example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index).
pyproject.toml ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [project]
2
+ name = "tdagent"
3
+ version = "0.1.0"
4
+ description = "TDA Agent implemented for huggingface hackathon."
5
+ authors = [
6
+ { name = "Pedro Completo Bento", email = "pedrobento988@gmail.com" },
7
+ { name = "Josep Pon Farreny", email = "ponpepo@gmail.com" },
8
+ { name = "Miguel Rodin Rodriguez", email = "miguelrodinrodriguez@gmail.com" },
9
+ { name = "Sofia Jeronimo dos Santos", email = "sofia.santos@siemens.com" },
10
+ { name = "Rodrigo Dominguez Sanz", email = "rodrigo.dominguez-sanz@siemens.com" },
11
+ ]
12
+ requires-python = ">=3.10,<4"
13
+ readme = "README.md"
14
+ license = ""
15
+ dependencies = [
16
+ "huggingface-hub>=0.32.3",
17
+ ]
18
+
19
+ [project.scripts]
20
+
21
+
22
+ [dependency-groups]
23
+ dev = [
24
+ "mypy~=1.14",
25
+ "ruff>=0.9,<1",
26
+ "pre-commit~=3.4",
27
+ "pip-audit>=2.9.0",
28
+ ]
29
+ test = [
30
+ "pytest>=7.4.4,<8",
31
+ "pytest-cov>=4.1.0,<5",
32
+ "pytest-randomly>=3.15.0,<4",
33
+ "xdoctest>=1.1.2,<2",
34
+ ]
35
+
36
+ [build-system]
37
+ requires = ["hatchling"]
38
+ build-backend = "hatchling.build"
39
+
40
+ [tool.uv]
41
+ package = false
42
+ default-groups = ["dev", "test"]
43
+
44
+ [tool.uv.workspace]
45
+ members = ["test"]
46
+
47
+ [tool.black]
48
+ target-version = ["py39", "py310", "py311"]
49
+ line-length = 88
50
+
51
+ [tool.isort]
52
+ profile = "black"
53
+ lines_after_imports = 2
54
+
55
+ [tool.mypy]
56
+ cache_dir = ".cache/mypy/"
57
+ ignore_missing_imports = true
58
+ no_implicit_optional = true
59
+ check_untyped_defs = true
60
+ strict_equality = true
61
+ disallow_any_generics = true
62
+ disallow_subclassing_any = true
63
+ disallow_untyped_calls = true
64
+ disallow_untyped_defs = true
65
+ disallow_incomplete_defs = true
66
+ disallow_untyped_decorators = true
67
+ warn_redundant_casts = true
68
+ warn_unused_ignores = true
69
+ exclude = "docs/"
70
+ plugins = [] # ["numpy.typing.mypy_plugin", "pydantic.mypy"]
71
+
72
+ [[tool.mypy.overrides]]
73
+ module = "tests.*"
74
+ disallow_untyped_defs = false
75
+ disallow_incomplete_defs = false
76
+
77
+ [tool.pytest.ini_options]
78
+ cache_dir = ".cache"
79
+ testpaths = ["tests", "tda_agent"]
80
+ addopts = [
81
+ "--strict",
82
+ "-r sxX",
83
+ "--cov-report=html",
84
+ "--cov-report=term-missing:skip-covered",
85
+ "--no-cov-on-fail",
86
+ "--xdoc",
87
+ ]
88
+ console_output_style = "count"
89
+ markers = ""
90
+ filterwarnings = ["ignore::DeprecationWarning"]
91
+
92
+ [tool.ruff]
93
+ cache-dir = ".cache/ruff"
94
+ exclude = [
95
+ ".git",
96
+ "__pycache__",
97
+ "docs/source/conf.py",
98
+ "old",
99
+ "build",
100
+ "dist",
101
+ ".venv",
102
+ "scripts",
103
+ ]
104
+ line-length = 88
105
+
106
+ [tool.ruff.lint]
107
+ select = ["ALL"]
108
+ ignore = ["D100", "D104", "D107", "D401", "EM102", "ERA001", "TRY003"]
109
+
110
+ [tool.ruff.lint.flake8-quotes]
111
+ inline-quotes = "double"
112
+
113
+ [tool.ruff.lint.flake8-bugbear]
114
+ # Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`.
115
+ extend-immutable-calls = ["typer.Argument", "typer.Option"]
116
+
117
+ [tool.ruff.lint.pep8-naming]
118
+ ignore-names = ["F", "L"]
119
+
120
+ [tool.ruff.lint.isort]
121
+ lines-after-imports = 2
122
+
123
+ [tool.ruff.lint.mccabe]
124
+ max-complexity = 18
125
+
126
+ [tool.ruff.lint.pydocstyle]
127
+ convention = "google"
128
+
129
+ [tool.ruff.lint.per-file-ignores]
130
+ "*/__init__.py" = ["F401"]
131
+ "tdagent/cli/**/*.py" = ["D103", "T201"]
132
+ "tests/*.py" = ["D103", "PLR2004", "S101"]
requirements-dev.txt ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was autogenerated by uv via the following command:
2
+ # uv export --format requirements-txt --no-hashes --group dev --group test -o requirements-dev.txt
3
+ boolean-py==5.0
4
+ cachecontrol==0.14.3
5
+ certifi==2025.4.26
6
+ cfgv==3.4.0
7
+ charset-normalizer==3.4.2
8
+ colorama==0.4.6 ; sys_platform == 'win32'
9
+ coverage==7.8.2
10
+ cyclonedx-python-lib==9.1.0
11
+ defusedxml==0.7.1
12
+ distlib==0.3.9
13
+ exceptiongroup==1.3.0 ; python_full_version < '3.11'
14
+ filelock==3.18.0
15
+ fsspec==2025.5.1
16
+ hf-xet==1.1.2 ; platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'
17
+ huggingface-hub==0.32.3
18
+ identify==2.6.12
19
+ idna==3.10
20
+ iniconfig==2.1.0
21
+ license-expression==30.4.1
22
+ markdown-it-py==3.0.0
23
+ mdurl==0.1.2
24
+ msgpack==1.1.0
25
+ mypy==1.16.0
26
+ mypy-extensions==1.1.0
27
+ nodeenv==1.9.1
28
+ packageurl-python==0.16.0
29
+ packaging==25.0
30
+ pathspec==0.12.1
31
+ pip==25.1.1
32
+ pip-api==0.0.34
33
+ pip-audit==2.9.0
34
+ pip-requirements-parser==32.0.1
35
+ platformdirs==4.3.8
36
+ pluggy==1.6.0
37
+ pre-commit==3.8.0
38
+ py-serializable==2.0.0
39
+ pygments==2.19.1
40
+ pyparsing==3.2.3
41
+ pytest==7.4.4
42
+ pytest-cov==4.1.0
43
+ pytest-randomly==3.16.0
44
+ pyyaml==6.0.2
45
+ requests==2.32.3
46
+ rich==14.0.0
47
+ ruff==0.11.12
48
+ sortedcontainers==2.4.0
49
+ toml==0.10.2
50
+ tomli==2.2.1 ; python_full_version <= '3.11'
51
+ tqdm==4.67.1
52
+ typing-extensions==4.13.2
53
+ urllib3==2.4.0
54
+ virtualenv==20.31.2
55
+ xdoctest==1.2.0
requirements.txt CHANGED
@@ -1 +1,25 @@
1
- huggingface_hub==0.25.2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was autogenerated by uv via the following command:
2
+ # uv export --format requirements-txt --no-hashes --no-dev -o requirements.txt
3
+ certifi==2025.4.26
4
+ charset-normalizer==3.4.2
5
+ colorama==0.4.6 ; sys_platform == 'win32'
6
+ coverage==7.8.2
7
+ exceptiongroup==1.3.0 ; python_full_version < '3.11'
8
+ filelock==3.18.0
9
+ fsspec==2025.5.1
10
+ hf-xet==1.1.2 ; platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'
11
+ huggingface-hub==0.32.3
12
+ idna==3.10
13
+ iniconfig==2.1.0
14
+ packaging==25.0
15
+ pluggy==1.6.0
16
+ pytest==7.4.4
17
+ pytest-cov==4.1.0
18
+ pytest-randomly==3.16.0
19
+ pyyaml==6.0.2
20
+ requests==2.32.3
21
+ tomli==2.2.1 ; python_full_version <= '3.11'
22
+ tqdm==4.67.1
23
+ typing-extensions==4.13.2
24
+ urllib3==2.4.0
25
+ xdoctest==1.2.0
tdagent/__init__.py ADDED
File without changes
uv.lock ADDED
The diff for this file is too large to render. See raw diff