Skip to content

Commit 015a001

Browse files
feat(skore-mlflow-project): Add integration with MLflow (#2527)
Implements #2134 #### Initial interface proposition #2134 (comment) Not much has changed, as anyway, the current plugin interface constraints the choices quite a lot (which is convenient for a first implementation) #### Remaining questions/TODOs: - [X] handling of logging context: decide what do if there is already an active run: - (selected behavior ✔️) crash - OR: log only artifacts (i.e. only plots and HTMLs) and ignore key. - OR: create a nested run - OR (initial behavior): ignore it and create a new independent run - [x] Documentation/Examples: in PR #2532. #### Review guide The diff is scary, but it mainly comes from CI things, the actual code diff is something like +600 (excluding tests). - `skore-mlflow-project/`: the main part of the implementation, it mainly: - inspects report objects and call all the metrics/plots/... - logs those metrics/plots/... into MLFlow - @glemaitre tested this part, I think we can consider it :heavy_check_mark: - `skore/`: :heavy_check_mark: - small changes to plug `skore.Project` with `skore-mlflow-project/` - @thomass-dev has quickly reviewed this part, and I addressed his two comments - CI changes ✔️ - basic changes to run tests `skore-mlflow-project` => validated by @thomass-dev - more complex changes to cover many MLFlow versions are in a separate PR: #2531 #### Coverage report from local coverage run: ``` Name Stmts Miss Cover Missing ----------------------------------------------------------------------- src/skore_mlflow_project/__init__.py 5 0 100% src/skore_mlflow_project/_matplotlib.py 15 0 100% src/skore_mlflow_project/project.py 191 5 97% 200, 231-232, 377, 379 src/skore_mlflow_project/protocol.py 36 0 100% src/skore_mlflow_project/reports.py 145 3 98% 203-204, 264 ----------------------------------------------------------------------- TOTAL 392 8 98% ``` --------- Co-authored-by: Auguste Baum <auguste@probabl.ai>
1 parent 3833482 commit 015a001

File tree

38 files changed

+5195
-25
lines changed

38 files changed

+5195
-25
lines changed

.github/workflows/pr-display-code-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
package: ["skore", "skore-hub-project", "skore-local-project"]
21+
package: ["skore", "skore-hub-project", "skore-local-project", "skore-mlflow-project"]
2222
permissions:
2323
actions: read
2424
contents: read

.github/workflows/pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ defaults:
3939
shell: bash
4040

4141
env:
42-
PACKAGES: '["skore","skore-hub-project","skore-local-project"]'
42+
PACKAGES: '["skore","skore-hub-project","skore-local-project","skore-mlflow-project"]'
4343

4444
jobs:
4545
pytest-changes:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
version="${GITHUB_REF_NAME#*/}"
3333

3434
[[ "${package}" == "${version}" ]] && { >&2 echo "Invalid tag: no package"; exit 1; }
35-
[[ "${package}" =~ ^(skore|skore-(local|hub)-project)$ ]] || { >&2 echo "Invalid tag: invalid package"; exit 1; }
35+
[[ "${package}" =~ ^(skore|skore-(local|hub|mlflow)-project)$ ]] || { >&2 echo "Invalid tag: invalid package"; exit 1; }
3636
[[ "${version}" =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-rc\.(1|[1-9][0-9]*))?$ ]] || { >&2 echo "Invalid tag: invalid version"; exit 1; }
3737

3838
echo "::group::Details"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,5 @@ sphinx/_templates/demo_report_help_generated.html
198198
skore/LICENSE
199199
skore-hub-project/LICENSE
200200
skore-local-project/LICENSE
201+
skore-mlflow-project/LICENSE
201202
.aider*

.pre-commit-config.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ repos:
2020
hooks:
2121

2222
- id: ruff-check
23-
files: ^((skore|skore-hub-project|skore-local-project)/(hatch|src|tests))|(examples)/
23+
files: ^((skore|skore-hub-project|skore-local-project|skore-mlflow-project)/(hatch|src|tests))|(examples)/
2424
args: [--fix, --extend-select, I]
2525

2626
- id: ruff-format
27-
files: ^((skore|skore-hub-project|skore-local-project)/(hatch|src|tests))|(examples)/
27+
files: ^((skore|skore-hub-project|skore-local-project|skore-mlflow-project)/(hatch|src|tests))|(examples)/
2828

2929
- repo: https://github.com/pre-commit/mirrors-mypy
3030
rev: v1.19.1
@@ -70,3 +70,11 @@ repos:
7070
files: ^skore-local-project/
7171
args: [--config-file=skore-local-project/pyproject.toml, skore-local-project]
7272
additional_dependencies: [skore]
73+
74+
- id: mypy
75+
pass_filenames: false
76+
alias: mypy-skore-mlflow-project
77+
name: mypy skore-mlflow-project/
78+
files: ^skore-mlflow-project/
79+
args: [--config-file=skore-mlflow-project/pyproject.toml, skore-mlflow-project]
80+
additional_dependencies: [skore, mlflow]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ Then, you can install skore by using `pip`:
6060
pip install -U skore
6161
# If you wish to interact with Skore Hub as well
6262
pip install -U skore[hub]
63+
# If you wish to log projects to MLflow
64+
pip install -U skore[mlflow]
6365
```
6466

6567
#### With conda

ci/pip-compile.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
#
77
# You can pass any `uv pip compile` parameter:
88
#
9-
# $ bash pip-compile.sh --test-requirements <skore|skore-hub-project|skore-local-project> --upgrade
9+
# $ bash pip-compile.sh --test-requirements <skore|skore-hub-project|skore-local-project|skore-mlflow-project> --upgrade
1010
# $ bash pip-compile.sh --sphinx-requirements --upgrade
1111
#
1212

1313
usage () {
1414
>&2 echo "Usage:"
15-
>&2 echo " $ bash pip-compile.sh --test-requirements <all|skore|skore-hub-project|skore-local-project> [option...]"
15+
>&2 echo " $ bash pip-compile.sh --test-requirements <all|skore|skore-hub-project|skore-local-project|skore-mlflow-project> [option...]"
1616
>&2 echo " $ bash pip-compile.sh --sphinx-requirements [option...]"
1717
}
1818

@@ -33,8 +33,9 @@ case $1 in
3333
PACKAGES+=("skore")
3434
PACKAGES+=("skore-hub-project")
3535
PACKAGES+=("skore-local-project")
36+
PACKAGES+=("skore-mlflow-project")
3637
;;
37-
"skore"|"skore-hub-project"|"skore-local-project")
38+
"skore"|"skore-hub-project"|"skore-local-project"|"skore-mlflow-project")
3839
PACKAGES+=($2)
3940
;;
4041
*)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

0 commit comments

Comments
 (0)