Skip to content

Commit 74652af

Browse files
Typing improvement, bug fixes, docs update.
Added mypy enforcement for the ml_service directory, and dealt with the resulting type issues. Added some clarification on docker quirks in the Dockerfile. Moved some of the packages from environment.yml to environment.dev.yml. Updated the documentation to reflect these changes.
1 parent 15da729 commit 74652af

60 files changed

Lines changed: 5597 additions & 1227 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/quality.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ jobs:
2929
- name: Install tooling
3030
run: |
3131
python -m pip install --upgrade pip
32-
python -m pip install ruff==0.15.4 mypy==1.19.1 types-pyyaml==6.0.12 pytest==9.0.2
32+
python -m pip install ruff==0.15.4 mypy==1.19.1 types-pyyaml==6.0.12 pytest==9.0.2 types-Deprecated==1.3.1.20260130 types-requests==2.32.4.20260324 types-ujson==5.10.0.20250822
3333
3434
- name: Show installed versions
3535
run: |
3636
python --version
37-
pip list | grep -E "ruff|mypy|types-pyyaml|pytest"
37+
pip list | grep -E "ruff|mypy|types-pyyaml|pytest|types-Deprecated|types-requests|types-ujson"
3838
3939
- name: Run ruff
4040
run: ruff check . --config pyproject.toml
4141

4242
- name: Run mypy (non-strict, respects mypy.ini)
43-
run: mypy ml pipelines
43+
run: mypy ml pipelines ml_service
4444

4545
- name: Import layer guardrails
4646
run: python scripts/quality/check_import_layers.py

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ repos:
1010
pass_filenames: false
1111

1212
- id: mypy
13-
name: mypy (ml + pipelines)
13+
name: mypy (ml + pipelines + ml_service)
1414
entry: mypy
1515
language: system
1616
pass_filenames: false
17-
args: ["ml", "pipelines"]
17+
args: ["ml", "pipelines", "ml_service"]
1818

1919
- id: import-layers
2020
name: import layer guardrails

Dockerfile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1+
# conda-lock causes major issues, so it is avoided here.
2+
# Note that a docker build sometimes creates the environment from scratch,
3+
# even when it shouldn't, which is not ideal for development speed.
4+
# However, it ensures that the environment is always clean and consistent with the environment.yml file.
5+
# For faster development iterations, consider using a local Conda environment on your machine with the
6+
# same environment.yml file.
7+
18
# ===== Base image with GPU support =====
29
FROM pytorch/pytorch:2.10.0-cuda12.8-cudnn9-runtime
3-
# NOTE: Uncomment the line below and comment out the line above only if you want to generate fake data. For regular use, stick to the current image. If you use the image below, make sure to also uncomment the torch installation line in this Dockerfile. Likewise, uncomment the sdv dependency in requirements.txt.
10+
# NOTE: Uncomment the line below and comment out the line above only if you want to generate fake data.
11+
# For regular use, stick to the current image. If you use the image below, make sure to also uncomment
12+
# the torch installation line in this Dockerfile. Likewise, uncomment the sdv dependency in
13+
# requirements.txt.
14+
415
# FROM nvidia/cuda:12.8.0-runtime-ubuntu22.04
516

617
# ===== Set working directory =====
@@ -39,7 +50,10 @@ COPY pyproject.toml .
3950
# Install torch (nightly CUDA 12.8)
4051
# This version works with Nvidia RTX 5070 Ti GPU. If you experience issues, change to a compatible version for your GPU.
4152

42-
# NOTE: Uncomment this only if you want to generate fake data. In that case, use the commented out base image at the top of this file. Likewise, uncomment the sdv dependency in requirements.txt. For regular use, stick to the current image.
53+
# NOTE: Uncomment this only if you want to generate fake data. In that case, use the commented out base
54+
# image at the top of this file. Likewise, uncomment the sdv dependency in requirements.txt. For regular
55+
# use, stick to the current image.
56+
4357
# RUN conda run -n hotel_management pip install --pre \
4458
# torch==2.12.0.dev20260320+cu128 \
4559
# --index-url https://download.pytorch.org/whl/nightly/cu128

docs/api/ml/ml/config/best_params.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ <h1 class="modulename">
208208
<div class="attr variable">
209209
<span class="name">MODEL_KEYS</span> =
210210
<input id="MODEL_KEYS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
211-
<label class="view-value-button pdoc-button" for="MODEL_KEYS-view-value"></label><span class="default_value">{&#39;depth&#39;, &#39;border_count&#39;, &#39;colsample_bylevel&#39;, &#39;min_data_in_leaf&#39;, &#39;l2_leaf_reg&#39;, &#39;learning_rate&#39;, &#39;random_strength&#39;}</span>
211+
<label class="view-value-button pdoc-button" for="MODEL_KEYS-view-value"></label><span class="default_value">{&#39;colsample_bylevel&#39;, &#39;depth&#39;, &#39;l2_leaf_reg&#39;, &#39;random_strength&#39;, &#39;learning_rate&#39;, &#39;min_data_in_leaf&#39;, &#39;border_count&#39;}</span>
212212

213213

214214
</div>

docs/api/ml/ml/feature_freezing/freeze_strategies/tabular/persistence.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ <h1 class="modulename">
256256
</span><span id="L-183"><a href="#L-183"><span class="linenos">183</span></a> <span class="s2">&quot;owner&quot;</span><span class="p">:</span> <span class="n">owner</span><span class="p">,</span>
257257
</span><span id="L-184"><a href="#L-184"><span class="linenos">184</span></a> <span class="s2">&quot;feature_type&quot;</span><span class="p">:</span> <span class="s2">&quot;tabular&quot;</span><span class="p">,</span>
258258
</span><span id="L-185"><a href="#L-185"><span class="linenos">185</span></a> <span class="s2">&quot;entity_key&quot;</span><span class="p">:</span> <span class="n">entity_key</span><span class="p">,</span>
259-
</span><span id="L-186"><a href="#L-186"><span class="linenos">186</span></a> <span class="s2">&quot;snapshot_path&quot;</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">snapshot_path</span><span class="p">),</span>
259+
</span><span id="L-186"><a href="#L-186"><span class="linenos">186</span></a> <span class="s2">&quot;snapshot_path&quot;</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">snapshot_path</span><span class="o">.</span><span class="n">as_posix</span><span class="p">()),</span>
260260
</span><span id="L-187"><a href="#L-187"><span class="linenos">187</span></a> <span class="s2">&quot;snapshot_id&quot;</span><span class="p">:</span> <span class="n">snapshot_path</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
261-
</span><span id="L-188"><a href="#L-188"><span class="linenos">188</span></a> <span class="s2">&quot;schema_path&quot;</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">schema_path</span><span class="p">),</span>
261+
</span><span id="L-188"><a href="#L-188"><span class="linenos">188</span></a> <span class="s2">&quot;schema_path&quot;</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">schema_path</span><span class="o">.</span><span class="n">as_posix</span><span class="p">()),</span>
262262
</span><span id="L-189"><a href="#L-189"><span class="linenos">189</span></a> <span class="s2">&quot;data_lineage&quot;</span><span class="p">:</span> <span class="n">data_lineage</span><span class="p">,</span>
263263
</span><span id="L-190"><a href="#L-190"><span class="linenos">190</span></a> <span class="s2">&quot;in_memory_hash&quot;</span><span class="p">:</span> <span class="n">in_memory_hash</span><span class="p">,</span>
264264
</span><span id="L-191"><a href="#L-191"><span class="linenos">191</span></a> <span class="s2">&quot;file_hash&quot;</span><span class="p">:</span> <span class="n">file_hash</span><span class="p">,</span>
@@ -578,9 +578,9 @@ <h1 class="modulename">
578578
</span><span id="create_metadata-184"><a href="#create_metadata-184"><span class="linenos">184</span></a> <span class="s2">&quot;owner&quot;</span><span class="p">:</span> <span class="n">owner</span><span class="p">,</span>
579579
</span><span id="create_metadata-185"><a href="#create_metadata-185"><span class="linenos">185</span></a> <span class="s2">&quot;feature_type&quot;</span><span class="p">:</span> <span class="s2">&quot;tabular&quot;</span><span class="p">,</span>
580580
</span><span id="create_metadata-186"><a href="#create_metadata-186"><span class="linenos">186</span></a> <span class="s2">&quot;entity_key&quot;</span><span class="p">:</span> <span class="n">entity_key</span><span class="p">,</span>
581-
</span><span id="create_metadata-187"><a href="#create_metadata-187"><span class="linenos">187</span></a> <span class="s2">&quot;snapshot_path&quot;</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">snapshot_path</span><span class="p">),</span>
581+
</span><span id="create_metadata-187"><a href="#create_metadata-187"><span class="linenos">187</span></a> <span class="s2">&quot;snapshot_path&quot;</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">snapshot_path</span><span class="o">.</span><span class="n">as_posix</span><span class="p">()),</span>
582582
</span><span id="create_metadata-188"><a href="#create_metadata-188"><span class="linenos">188</span></a> <span class="s2">&quot;snapshot_id&quot;</span><span class="p">:</span> <span class="n">snapshot_path</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
583-
</span><span id="create_metadata-189"><a href="#create_metadata-189"><span class="linenos">189</span></a> <span class="s2">&quot;schema_path&quot;</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">schema_path</span><span class="p">),</span>
583+
</span><span id="create_metadata-189"><a href="#create_metadata-189"><span class="linenos">189</span></a> <span class="s2">&quot;schema_path&quot;</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="n">schema_path</span><span class="o">.</span><span class="n">as_posix</span><span class="p">()),</span>
584584
</span><span id="create_metadata-190"><a href="#create_metadata-190"><span class="linenos">190</span></a> <span class="s2">&quot;data_lineage&quot;</span><span class="p">:</span> <span class="n">data_lineage</span><span class="p">,</span>
585585
</span><span id="create_metadata-191"><a href="#create_metadata-191"><span class="linenos">191</span></a> <span class="s2">&quot;in_memory_hash&quot;</span><span class="p">:</span> <span class="n">in_memory_hash</span><span class="p">,</span>
586586
</span><span id="create_metadata-192"><a href="#create_metadata-192"><span class="linenos">192</span></a> <span class="s2">&quot;file_hash&quot;</span><span class="p">:</span> <span class="n">file_hash</span><span class="p">,</span>

docs/api/ml/ml/pipelines/models.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ <h1 class="modulename">
162162
<section id="VALID_STEPS">
163163
<div class="attr variable">
164164
<span class="name">VALID_STEPS</span> =
165-
<span class="default_value">{&#39;FillCategoricalMissing&#39;, &#39;FeatureSelector&#39;, &#39;SchemaValidator&#39;, &#39;Model&#39;, &#39;FeatureEngineer&#39;}</span>
165+
<span class="default_value">{&#39;FeatureEngineer&#39;, &#39;FeatureSelector&#39;, &#39;SchemaValidator&#39;, &#39;FillCategoricalMissing&#39;, &#39;Model&#39;}</span>
166166

167167

168168
</div>

docs/api/ml/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/ml_service/ml_service/backend.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<h2>Submodules</h2>
3131
<ul>
3232
<li><a href="backend/configs.html">configs</a></li>
33+
<li><a href="backend/dir_viewer.html">dir_viewer</a></li>
3334
<li><a href="backend/limiter.html">limiter</a></li>
3435
<li><a href="backend/main.html">main</a></li>
3536
<li><a href="backend/pipelines.html">pipelines</a></li>

0 commit comments

Comments
 (0)