workrb 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. workrb-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +31 -0
  2. workrb-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +36 -0
  3. workrb-0.1.0/.github/workflows/publish.yml +39 -0
  4. workrb-0.1.0/.github/workflows/test.yml +42 -0
  5. workrb-0.1.0/.gitignore +69 -0
  6. workrb-0.1.0/.pre-commit-config.yaml +61 -0
  7. workrb-0.1.0/.vscode/extensions.json +14 -0
  8. workrb-0.1.0/.vscode/launch.json +26 -0
  9. workrb-0.1.0/.vscode/settings.json +62 -0
  10. workrb-0.1.0/CONTRIBUTING.md +563 -0
  11. workrb-0.1.0/LICENSE +201 -0
  12. workrb-0.1.0/NOTICE +5 -0
  13. workrb-0.1.0/PKG-INFO +306 -0
  14. workrb-0.1.0/README.md +271 -0
  15. workrb-0.1.0/examples/custom_model_example.py +169 -0
  16. workrb-0.1.0/examples/custom_task_example.py +149 -0
  17. workrb-0.1.0/examples/list_available_tasks_and_models.py +176 -0
  18. workrb-0.1.0/examples/run_multiple_models.py +38 -0
  19. workrb-0.1.0/examples/usage_example.py +22 -0
  20. workrb-0.1.0/pyproject.toml +201 -0
  21. workrb-0.1.0/src/workrb/__init__.py +24 -0
  22. workrb-0.1.0/src/workrb/config.py +247 -0
  23. workrb-0.1.0/src/workrb/data/__init__.py +15 -0
  24. workrb-0.1.0/src/workrb/data/esco.py +385 -0
  25. workrb-0.1.0/src/workrb/evaluate.py +394 -0
  26. workrb-0.1.0/src/workrb/logging.py +44 -0
  27. workrb-0.1.0/src/workrb/metrics/__init__.py +13 -0
  28. workrb-0.1.0/src/workrb/metrics/classification.py +372 -0
  29. workrb-0.1.0/src/workrb/metrics/ranking.py +196 -0
  30. workrb-0.1.0/src/workrb/metrics/reporting.py +144 -0
  31. workrb-0.1.0/src/workrb/models/__init__.py +14 -0
  32. workrb-0.1.0/src/workrb/models/base.py +91 -0
  33. workrb-0.1.0/src/workrb/models/bi_encoder.py +271 -0
  34. workrb-0.1.0/src/workrb/models/classification_model.py +205 -0
  35. workrb-0.1.0/src/workrb/registry.py +207 -0
  36. workrb-0.1.0/src/workrb/results.py +357 -0
  37. workrb-0.1.0/src/workrb/tasks/__init__.py +35 -0
  38. workrb-0.1.0/src/workrb/tasks/abstract/__init__.py +23 -0
  39. workrb-0.1.0/src/workrb/tasks/abstract/base.py +191 -0
  40. workrb-0.1.0/src/workrb/tasks/abstract/classification_base.py +408 -0
  41. workrb-0.1.0/src/workrb/tasks/abstract/ranking_base.py +187 -0
  42. workrb-0.1.0/src/workrb/tasks/classification/__init__.py +11 -0
  43. workrb-0.1.0/src/workrb/tasks/classification/job2skill.py +191 -0
  44. workrb-0.1.0/src/workrb/tasks/ranking/__init__.py +28 -0
  45. workrb-0.1.0/src/workrb/tasks/ranking/job2skill.py +171 -0
  46. workrb-0.1.0/src/workrb/tasks/ranking/jobnorm.py +135 -0
  47. workrb-0.1.0/src/workrb/tasks/ranking/skill2job.py +187 -0
  48. workrb-0.1.0/src/workrb/tasks/ranking/skill_extraction.py +203 -0
  49. workrb-0.1.0/src/workrb/tasks/ranking/skill_similarity.py +123 -0
  50. workrb-0.1.0/src/workrb/tasks/ranking/skillnorm.py +195 -0
  51. workrb-0.1.0/src/workrb/types.py +73 -0
  52. workrb-0.1.0/tests/__init__.py +3 -0
  53. workrb-0.1.0/tests/test_e2e_checkpointing.py +232 -0
  54. workrb-0.1.0/tests/test_e2e_toy_benchmark.py +219 -0
  55. workrb-0.1.0/tests/test_import.py +60 -0
  56. workrb-0.1.0/tests/test_model_registry.py +206 -0
  57. workrb-0.1.0/tests/test_model_task_compatibility.py +326 -0
  58. workrb-0.1.0/tests/test_task_loading.py +200 -0
  59. workrb-0.1.0/tests/test_task_registry.py +323 -0
  60. workrb-0.1.0/tests/test_utils.py +217 -0
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: "[BUG] "
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Setup details (please complete the following information):**
27
+ - OS: [e.g. iOS, Windows, Linux]
28
+ - Version [e.g. 22]
29
+
30
+ **Additional context**
31
+ Add any other context about the problem here.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea or addition for this project. Examples include new datasets,
4
+ ontologies, tasks, models,...
5
+ title: "[FEATURE]"
6
+ labels: enhancement
7
+ assignees: ''
8
+
9
+ ---
10
+
11
+ ## Problem
12
+ Is your proposal tackling an exisitng problem or limitation?
13
+ - No, it's an addition
14
+ - Yes, the problem is ... (describe problem, or link to bug report)
15
+
16
+ ## Proposal
17
+ Describe what you would like to see happen.
18
+
19
+ - Type:
20
+ - [ ] New Ontology (data source for multiple tasks)
21
+ - [ ] New Task(s)
22
+ - [ ] New Model(s)
23
+ - [ ] New Metric(s)
24
+ - [ ] Other
25
+ - Area(s) of code: paths, modules, or APIs you expect to touch
26
+
27
+ ## Alternatives
28
+ Have you considered other approaches? Briefly list them and why you did not choose them.
29
+
30
+ ## Additional Context
31
+ Links to related issues, PRs, docs, or external references.
32
+ Screenshots or small examples if useful.
33
+
34
+ ## Implementation
35
+ - [ ] I plan to implement this in a PR
36
+ - [ ] I am proposing the idea and would like someone else to pick it up
@@ -0,0 +1,39 @@
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ name: Publish
5
+
6
+ on:
7
+ release:
8
+ types:
9
+ - created
10
+
11
+ jobs:
12
+ publish:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ # IMPORTANT: this permission is mandatory for trusted publishing
16
+ id-token: write
17
+
18
+ # Dedicated environments with protections for publishing are strongly recommended.
19
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
20
+ environment:
21
+ name: pypi
22
+ # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
23
+ # url: https://pypi.org/p/YOURPROJECT
24
+ #
25
+ # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
26
+ # ALTERNATIVE: exactly, uncomment the following line instead:
27
+ url: https://pypi.org/project/workrb/${{ github.event.release.name }}
28
+
29
+ steps:
30
+ - name: Checkout
31
+ uses: actions/checkout@v4
32
+
33
+ - name: Install uv
34
+ uses: astral-sh/setup-uv@v7
35
+
36
+ - name: Publish package
37
+ run: |
38
+ uv build
39
+ uv publish
@@ -0,0 +1,42 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Test
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ python-version: ["3.11"]
20
+ resolution-strategy: ["highest", "lowest-direct"]
21
+ name: Python ${{ matrix.python-version }} (resolution=${{ matrix.resolution-strategy }})
22
+
23
+ steps:
24
+ - name: Checkout
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Install the latest version of uv (with Python ${{ matrix.python-version }})
28
+ uses: astral-sh/setup-uv@v6
29
+ with:
30
+ python-version: ${{ matrix.python-version }}
31
+
32
+ # Make lock file
33
+ - name: Install the project
34
+ run: uv sync --all-extras --dev
35
+
36
+ # Use lock file and skip validating
37
+ - name: Lint package
38
+ run: uv run --no-sync poe lint
39
+
40
+ - name: Test package
41
+ run: uv run --no-sync poe test
42
+
@@ -0,0 +1,69 @@
1
+ # Coverage.py
2
+ htmlcov/
3
+ reports/
4
+
5
+ # Copier
6
+ *.rej
7
+
8
+ # Data
9
+ # *.csv*
10
+ *.dat*
11
+ *.pickle*
12
+ *.xls*
13
+ *.zip*
14
+
15
+ # direnv
16
+ .envrc
17
+
18
+ # dotenv
19
+ .env
20
+
21
+ # Hypothesis
22
+ .hypothesis/
23
+
24
+ # Jupyter
25
+ *.ipynb
26
+ .ipynb_checkpoints/
27
+ notebooks/
28
+
29
+ # macOS
30
+ .DS_Store
31
+
32
+ # mise
33
+ mise.local.toml
34
+
35
+ # mypy
36
+ .dmypy.json
37
+ .mypy_cache/
38
+
39
+ # Node.js
40
+ node_modules/
41
+
42
+ # PyCharm
43
+ .idea/
44
+
45
+ # pyenv
46
+ .python-version
47
+
48
+ # pytest
49
+ .pytest_cache/
50
+
51
+ # Python
52
+ __pycache__/
53
+ *.egg-info/
54
+ *.py[cdo]
55
+ .venv/
56
+ dist/
57
+
58
+ # Ruff
59
+ .ruff_cache/
60
+
61
+ # Terraform
62
+ .terraform/
63
+
64
+ # uv
65
+ uv.lock
66
+
67
+ # Outputs
68
+ tmp/
69
+ results/
@@ -0,0 +1,61 @@
1
+ # https://pre-commit.com
2
+ default_install_hook_types: [commit-msg, pre-commit]
3
+ default_stages: [pre-commit, manual]
4
+ fail_fast: true
5
+ repos:
6
+ - repo: meta
7
+ hooks:
8
+ - id: check-useless-excludes
9
+ - repo: https://github.com/pre-commit/pygrep-hooks
10
+ rev: v1.10.0
11
+ hooks:
12
+ - id: python-check-mock-methods
13
+ - id: python-use-type-annotations
14
+ - id: rst-backticks
15
+ - id: rst-directive-colons
16
+ - id: rst-inline-touching-normal
17
+ - id: text-unicode-replacement-char
18
+ - repo: https://github.com/pre-commit/pre-commit-hooks
19
+ rev: v5.0.0
20
+ hooks:
21
+ - id: check-added-large-files
22
+ - id: check-ast
23
+ - id: check-builtin-literals
24
+ - id: check-case-conflict
25
+ - id: check-docstring-first
26
+ - id: check-illegal-windows-names
27
+ - id: check-json
28
+ exclude: ^.vscode/
29
+ - id: check-merge-conflict
30
+ - id: check-shebang-scripts-are-executable
31
+ - id: check-symlinks
32
+ - id: check-toml
33
+ - id: check-vcs-permalinks
34
+ - id: check-xml
35
+ - id: check-yaml
36
+ - id: debug-statements
37
+ - id: destroyed-symlinks
38
+ - id: detect-private-key
39
+ - id: end-of-file-fixer
40
+ types: [python]
41
+ - id: fix-byte-order-marker
42
+ - id: mixed-line-ending
43
+ - id: name-tests-test
44
+ args: [--pytest-test-first]
45
+ - id: trailing-whitespace
46
+ types: [python]
47
+ - repo: https://github.com/commitizen-tools/commitizen
48
+ rev: v4.9.1
49
+ hooks:
50
+ - id: commitizen
51
+ stages: [commit-msg]
52
+ - repo: https://github.com/astral-sh/ruff-pre-commit
53
+ rev: v0.14.1
54
+ hooks:
55
+ - id: ruff-check
56
+ args: ["--extend-fixable=F401,F841", "--fix-only"]
57
+ # Optional: narrow to Python files if you like
58
+ types_or: [python, pyi]
59
+ - id: ruff-format
60
+ name: ruff format
61
+ types_or: [python, pyi]
@@ -0,0 +1,14 @@
1
+ {
2
+ "recommendations": [
3
+ "charliermarsh.ruff",
4
+ "ms-vscode-remote.remote-ssh",
5
+ "ms-python.python",
6
+ "ms-python.debugpy",
7
+ "ms-toolsai.jupyter",
8
+ "ms-toolsai.jupyter-keymap",
9
+ "ms-toolsai.vscode-jupyter-cell-tags",
10
+ "mechatroner.rainbow-csv",
11
+ "anysphere.cursorpyright", // cursor replacement for pylance
12
+ ],
13
+ "unwantedRecommendations": [],
14
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "Python Debugger: Current File",
9
+ "type": "debugpy",
10
+ "request": "launch",
11
+ "program": "${file}",
12
+ "console": "integratedTerminal",
13
+ "cwd": "${fileDirname}",
14
+ "justMyCode": false,
15
+ },
16
+ {
17
+ "name": "Python Debugger: Jupyter Notebook",
18
+ "type": "debugpy",
19
+ "request": "launch",
20
+ "program": "${file}",
21
+ "console": "integratedTerminal",
22
+ "cwd": "${workspaceFolder}",
23
+ "justMyCode": false
24
+ },
25
+ ]
26
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "python.analysis.extraPaths": [
3
+ "./src"
4
+ ],
5
+ "coverage-gutters.coverageFileNames": [
6
+ "reports/coverage.xml"
7
+ ],
8
+ "editor.codeActionsOnSave": {
9
+ "source.fixAll": "explicit",
10
+ "source.organizeImports": "explicit"
11
+ },
12
+ "editor.formatOnSave": true,
13
+ "[python]": {
14
+ "editor.defaultFormatter": "charliermarsh.ruff",
15
+ "editor.formatOnSave": true,
16
+ },
17
+ "ruff.lineLength": 100,
18
+ "ruff.importStrategy": "fromEnvironment",
19
+ "ruff.configurationPreference": "editorFirst",
20
+ "[toml]": {
21
+ "editor.formatOnSave": false
22
+ },
23
+ "editor.rulers": [
24
+ 100
25
+ ],
26
+ "files.autoSave": "onFocusChange",
27
+ "jupyter.kernels.excludePythonEnvironments": [
28
+ "/usr/local/bin/python",
29
+ "/usr/local/bin/python3",
30
+ "/usr/bin/python",
31
+ "/usr/bin/python3",
32
+ "/bin/python",
33
+ "/bin/python3"
34
+ ],
35
+ "jupyter.debugging": true,
36
+ "jupyter.debugJustMyCode": false,
37
+ "notebook.codeActionsOnSave": {
38
+ "notebook.source.fixAll": "explicit",
39
+ "notebook.source.organizeImports": "explicit"
40
+ },
41
+ "notebook.formatOnSave.enabled": true,
42
+ "python.analysis.typeCheckingMode": "basic",
43
+ "python.analysis.autoImportCompletions": true,
44
+ "python.defaultInterpreterPath": ".venv/bin/python",
45
+ "python.terminal.activateEnvironment": true,
46
+ "python.testing.pytestEnabled": true,
47
+ "python.debugOptions": [
48
+ "DebugStdLib"
49
+ ],
50
+ "python.debugJustMyCode": false,
51
+ "terminal.integrated.env.linux": {
52
+ "GIT_EDITOR": "code --wait"
53
+ },
54
+ "terminal.integrated.env.mac": {
55
+ "GIT_EDITOR": "code --wait"
56
+ },
57
+ "cursorpyright.analysis.autoImportCompletions": true,
58
+ "cursorpyright.analysis.extraPaths": [
59
+ "./src"
60
+ ],
61
+ "cursorpyright.analysis.typeCheckingMode": "basic"
62
+ }