Skip to content

Add UI network inspectors - #101

Closed
cpaniaguam wants to merge 21 commits into
102-separate-linting-workflow-in-cifrom
add-ui-network-inspectors
Closed

Add UI network inspectors#101
cpaniaguam wants to merge 21 commits into
102-separate-linting-workflow-in-cifrom
add-ui-network-inspectors

Conversation

@cpaniaguam

@cpaniaguam cpaniaguam commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added a Streamlit-based Network Inspectors interface with likelihood comparison and interactive 3D manifold views.
    • Added a command-line launcher for the interface.
    • Added batch training support for multiple Torch models and network configurations, including validation and dry-run mode.
    • Added reusable likelihood and manifold analysis outputs and plotting capabilities.
  • Documentation

    • Added setup, launch, and batch-training instructions to the README.
    • Added UI styling for themes, accessibility, and interactive controls.
  • Tests

    • Expanded coverage for analysis results, plotting figures, validation, and UI-related behavior.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds typed computation contracts and figure builders for network inspectors, a Streamlit inspection UI, a CLI launcher and styling, a batch Torch training script, documentation, packaging configuration, and regression tests.

Changes

Network inspectors

Layer / File(s) Summary
Computation contracts and plotting pipeline
src/lanfactory/network_inspectors/{contracts.py,api.py,plotting.py,__init__.py}, tests/test_network_inspectors_*.py, test_network_inspectors.py
Likelihood and manifold computations now return typed contracts. Plotting accepts those contracts and separates figure construction from rendering. Tests cover computation results, plotting figures, API wiring, validation, and regression cases.
Streamlit inspection interface
src/lanfactory/network_inspectors/streamlit_app.py, src/lanfactory/cli/network_inspectors_ui.py, src/lanfactory/network_inspectors/styles.css, pyproject.toml, README.md, .gitignore
The project adds a Streamlit application, CLI launcher, packaged stylesheet, UI dependency, model discovery, predictor loading, inspection controls, and KDE/manifold views. README instructions and UI-related ignore rules are included.

Batch Torch training

Layer / File(s) Summary
Batch configuration and training execution
scripts/train_torch_models_batch.sh, README.md
The script parses training options, validates pickle data, generates per-model YAML files, runs model/network combinations, and supports dry-run mode. README examples document the supported invocations.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Inspector
  participant StreamlitApp
  participant ModelArtifacts
  participant NetworkAPI
  participant Plotting
  Inspector->>StreamlitApp: Select model and analysis view
  StreamlitApp->>ModelArtifacts: Discover files and load predictor
  StreamlitApp->>NetworkAPI: Compute likelihood comparison or manifold
  NetworkAPI->>Plotting: Build figure
  Plotting-->>StreamlitApp: Return figure
  StreamlitApp-->>Inspector: Render analysis view
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding a network inspectors UI.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-ui-network-inspectors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This comment was marked as spam.

@cpaniaguam
cpaniaguam marked this pull request as ready for review July 31, 2026 14:24

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🧹 Nitpick comments (5)
scripts/train_torch_models_batch.sh (1)

282-291: 🧹 Nitpick | 🔵 Trivial

Fail-fast batch semantics: a single training failure stops all remaining models/network IDs.

set -euo pipefail is active for the whole script. If "${cmd[@]}" at line 289 fails for one model/network-id combination, the script exits immediately and skips every remaining combination in the batch. This may be the intended behavior for reproducibility, but for long batch runs, consider whether the script should continue on failure and report a summary of failed combinations at the end.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/train_torch_models_batch.sh` around lines 282 - 291, Update the batch
execution around the "${cmd[@]}" invocation so a failed model/network-id
combination is recorded and the loop continues processing all remaining
combinations despite set -e. Track each failed combination using the existing
model and net_id identifiers, then report a summary of failures after both loops
complete while preserving successful execution behavior.
src/lanfactory/network_inspectors/streamlit_app.py (2)

286-289: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the commented-out accessibility caption.

This dead code block is commented out and unused. Either restore it as active UI text or remove it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lanfactory/network_inspectors/streamlit_app.py` around lines 286 - 289,
Remove the commented-out accessibility caption block near the Streamlit UI code;
do not restore it as active text unless the surrounding implementation
explicitly requires that caption.

88-97: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add type hints to predictor and _load_predictor's return value.

_load_predictor has no return type annotation, and predictor in _kde_tab/_manifold_tab has no type annotation, even though the same callable type (Callable[[NDArray[np.float32]], Any]) is already used consistently in api.py. Add matching annotations for mypy compatibility.

As per coding guidelines, "Keep the package compatible with mypy type checking."

Also applies to: 152-152, 207-207

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lanfactory/network_inspectors/streamlit_app.py` around lines 88 - 97, Add
type annotations for mypy compatibility by including the return type annotation
on the _load_predictor function and type annotations on the predictor variables
in _kde_tab and _manifold_tab functions. Use the consistent callable type
Callable[[NDArray[np.float32]], Any] that is already established in api.py to
ensure uniform type signatures across the codebase.

Source: Coding guidelines

test_network_inspectors.py (1)

37-239: 🎯 Functional Correctness | 🔵 Trivial

Consider filing follow-up issues for the documented bugs.

These xfail(strict=True) tests are a good way to pin down known bugs without blocking this PR. Several of the documented issues affect correctness in ways users can hit directly: missing parameter_df validation (Line 178), missing torch_mlp_predict validation (Line 223), and the hardcoded 4000-row batch sizing (Line 101) can produce confusing runtime errors or silently wrong results rather than a clear message.

Do you want me to help implement fixes for any of these and remove the corresponding xfail markers?

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test_network_inspectors.py` around lines 37 - 239, File follow-up issues for
the documented bugs, prioritizing validation in kde_vs_lan_likelihoods and
lan_manifold and choice-count-based batch sizing in kde_vs_lan_likelihoods. Keep
the strict xfail tests as regression coverage for now; remove each marker only
when its corresponding implementation fix is completed.
src/lanfactory/cli/network_inspectors_ui.py (1)

19-25: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Forward extra CLI arguments to streamlit run.

sys.argv is replaced entirely with ["streamlit", "run", str(app_path)]. Any arguments a user passes to network-inspectors-ui (for example, --server.port 8502) are silently dropped instead of reaching Streamlit. Forward sys.argv[1:] so users can pass Streamlit configuration options through the wrapper.

🔧 Proposed fix
-    sys.argv = ["streamlit", "run", str(app_path)]
+    sys.argv = ["streamlit", "run", str(app_path), *sys.argv[1:]]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lanfactory/cli/network_inspectors_ui.py` around lines 19 - 25, Update the
CLI entrypoint around app_path and the sys.argv assignment to preserve and
append the wrapper’s original sys.argv[1:] arguments after the Streamlit app
path, ensuring options such as --server.port reach stcli.main() while retaining
the existing streamlit run invocation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 153-172: Wrap the two multi-line shell command examples in the
"Batch Training Multiple Torch Models" section with bash code fences. The first
example demonstrates scripts/train_torch_models_batch.sh with
--training-data-base and --networks-path-base flags, and the second example
shows the same script with --training-data-folder flag. Enclose each full
multi-line command (from the script invocation through all its continued lines
with backslash) in ```bash ``` code fences to ensure proper Markdown rendering
of the shell continuation syntax.

In `@scripts/train_torch_models_batch.sh`:
- Around line 143-177: Update resolve_model_training_folder so the
missing-directory branch echoes candidate_folder instead of an empty string,
allowing the caller’s “Training data folder not found” message to include the
attempted path. Preserve the existing resolution behavior for valid directories.
- Around line 194-223: Update the validation_out assignment in the batch
validation flow to use an unambiguous plain command substitution by removing the
extra opening parenthesis after $( and its matching closing parenthesis.
Preserve the existing uv run python heredoc and validation behavior unchanged.

In `@src/lanfactory/network_inspectors/plotting.py`:
- Line 161: Split the function signature for build_manifold_figure across
multiple lines to comply with the 88-character line limit. Apply the same
multi-line formatting pattern already established in build_kde_vs_lan_figure to
maintain consistency. Ensure each resulting line stays within the 88-character
limit while preserving the function's parameters (computation:
ManifoldComputation, cfg: PlotConfig) and return type annotation (go.Figure).

In `@src/lanfactory/network_inspectors/streamlit_app.py`:
- Around line 188-198: Wrap the likelihood computation and figure construction
inside the “Run KDE vs LAN” block with try/except handling for ValueError,
matching the predictor-loading error path. Display the caught validation error
through st.error instead of allowing a raw traceback, while preserving the
existing spinner and successful comparison/figure flow.
- Around line 370-374: Add a min_value parameter to the st.number_input call for
rt_step_2c that enforces a positive value constraint (use a small positive
threshold to prevent zero or negative step values that would break the
downstream KDE grid computation).
- Around line 207-272: Update _manifold_tab so the Run Manifold computation
handles unsupported models and other expected failures without exposing a
traceback: wrap compute_lan_manifold and figure construction in a try/except,
display the exception through st.error, and return without rendering results
when computation fails. Preserve the existing validation and successful plotting
flow.

In `@tests/test_network_inspectors_plotting.py`:
- Around line 23-40: Update
test_build_kde_vs_lan_figure_returns_matplotlib_figure to close the returned
Figure after the isinstance assertion, using the existing matplotlib
figure-closing mechanism so the test does not leave build_kde_vs_lan_figure
resources open.

---

Nitpick comments:
In `@scripts/train_torch_models_batch.sh`:
- Around line 282-291: Update the batch execution around the "${cmd[@]}"
invocation so a failed model/network-id combination is recorded and the loop
continues processing all remaining combinations despite set -e. Track each
failed combination using the existing model and net_id identifiers, then report
a summary of failures after both loops complete while preserving successful
execution behavior.

In `@src/lanfactory/cli/network_inspectors_ui.py`:
- Around line 19-25: Update the CLI entrypoint around app_path and the sys.argv
assignment to preserve and append the wrapper’s original sys.argv[1:] arguments
after the Streamlit app path, ensuring options such as --server.port reach
stcli.main() while retaining the existing streamlit run invocation.

In `@src/lanfactory/network_inspectors/streamlit_app.py`:
- Around line 286-289: Remove the commented-out accessibility caption block near
the Streamlit UI code; do not restore it as active text unless the surrounding
implementation explicitly requires that caption.
- Around line 88-97: Add type annotations for mypy compatibility by including
the return type annotation on the _load_predictor function and type annotations
on the predictor variables in _kde_tab and _manifold_tab functions. Use the
consistent callable type Callable[[NDArray[np.float32]], Any] that is already
established in api.py to ensure uniform type signatures across the codebase.

In `@test_network_inspectors.py`:
- Around line 37-239: File follow-up issues for the documented bugs,
prioritizing validation in kde_vs_lan_likelihoods and lan_manifold and
choice-count-based batch sizing in kde_vs_lan_likelihoods. Keep the strict xfail
tests as regression coverage for now; remove each marker only when its
corresponding implementation fix is completed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ac5f072b-5544-4729-9d60-e83008105aab

📥 Commits

Reviewing files that changed from the base of the PR and between d725ae3 and 51a5659.

📒 Files selected for processing (14)
  • .gitignore
  • README.md
  • pyproject.toml
  • scripts/train_torch_models_batch.sh
  • src/lanfactory/cli/network_inspectors_ui.py
  • src/lanfactory/network_inspectors/__init__.py
  • src/lanfactory/network_inspectors/api.py
  • src/lanfactory/network_inspectors/contracts.py
  • src/lanfactory/network_inspectors/plotting.py
  • src/lanfactory/network_inspectors/streamlit_app.py
  • src/lanfactory/network_inspectors/styles.css
  • test_network_inspectors.py
  • tests/test_network_inspectors_api.py
  • tests/test_network_inspectors_plotting.py

Comment thread README.md
Comment on lines +143 to +177
resolve_model_training_folder() {
local candidate_folder="$1"
local model="$2"

if [[ ! -d "$candidate_folder" ]]; then
echo ""
return
fi

# Preferred: pickle shards directly in the provided folder.
if find "$candidate_folder" -maxdepth 1 -type f -name '*.pickle' | grep -q .; then
echo "$candidate_folder"
return
fi

# Common layout: one subfolder per model.
if [[ -d "$candidate_folder/$model" ]] && find "$candidate_folder/$model" -maxdepth 1 -type f -name '*.pickle' | grep -q .; then
echo "$candidate_folder/$model"
return
fi

# Fallback: if exactly one immediate subfolder contains pickle shards, use it.
local subdir_count
subdir_count="$(find "$candidate_folder" -mindepth 1 -maxdepth 1 -type d | wc -l | tr -d ' ')"
if [[ "$subdir_count" == "1" ]]; then
local only_subdir
only_subdir="$(find "$candidate_folder" -mindepth 1 -maxdepth 1 -type d | head -n 1)"
if find "$only_subdir" -maxdepth 1 -type f -name '*.pickle' | grep -q .; then
echo "$only_subdir"
return
fi
fi

echo "$candidate_folder"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Uninformative error message when the candidate folder is missing.

resolve_model_training_folder echoes "" at line 148 when $candidate_folder does not exist. At line 257 this produces Training data folder not found for model 'x': with a blank path, which does not tell the user what path was actually attempted. Echo the candidate path instead so the failing path shows up in the error message.

🐛 Proposed fix
     if [[ ! -d "$candidate_folder" ]]; then
-        echo ""
+        echo "$candidate_folder"
         return
     fi

Also applies to: 256-259

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/train_torch_models_batch.sh` around lines 143 - 177, Update
resolve_model_training_folder so the missing-directory branch echoes
candidate_folder instead of an empty string, allowing the caller’s “Training
data folder not found” message to include the attempted path. Preserve the
existing resolution behavior for valid directories.

Comment on lines +194 to +223
local validation_out
if ! validation_out="$((uv run python - "$folder" <<'PY'
import glob
import os
import pickle
import sys

folder = sys.argv[1]
files = sorted(glob.glob(os.path.join(folder, "*.pickle")))
if not files:
print("ERR_NO_PICKLES")
raise SystemExit(2)

with open(files[0], "rb") as f:
obj = pickle.load(f)

if not isinstance(obj, dict):
print("ERR_NOT_DICT")
raise SystemExit(3)

keys = set(obj.keys())
required = {"lan_data", "lan_labels"}
if not required.issubset(keys):
print("ERR_BAD_KEYS")
print(",".join(sorted(keys)))
raise SystemExit(4)

print("OK_KEYS")
PY
))"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Fix the $(( command-substitution ambiguity flagged by shellcheck.

Line 195 writes validation_out="$((uv run python - "$folder" <<'PY' ... ))". The double opening parenthesis after $( is unintentional: the goal is a plain command substitution, not a nested subshell or arithmetic expression. Shellcheck reports this as SC1102 (error level) because shells disambiguate $(( differently: some parse it as arithmetic and fail, others fall back to command substitution. Remove the redundant parentheses so the intent is unambiguous.

🐛 Proposed fix
-    if ! validation_out="$((uv run python - "$folder" <<'PY'
+    if ! validation_out="$(uv run python - "$folder" <<'PY'
 import glob
 import os
 import pickle
 import sys
@@
 print("OK_KEYS")
 PY
-))"; then
+)"; then
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
local validation_out
if ! validation_out="$((uv run python - "$folder" <<'PY'
import glob
import os
import pickle
import sys
folder = sys.argv[1]
files = sorted(glob.glob(os.path.join(folder, "*.pickle")))
if not files:
print("ERR_NO_PICKLES")
raise SystemExit(2)
with open(files[0], "rb") as f:
obj = pickle.load(f)
if not isinstance(obj, dict):
print("ERR_NOT_DICT")
raise SystemExit(3)
keys = set(obj.keys())
required = {"lan_data", "lan_labels"}
if not required.issubset(keys):
print("ERR_BAD_KEYS")
print(",".join(sorted(keys)))
raise SystemExit(4)
print("OK_KEYS")
PY
))"; then
local validation_out
if ! validation_out="$(uv run python - "$folder" <<'PY'
import glob
import os
import pickle
import sys
folder = sys.argv[1]
files = sorted(glob.glob(os.path.join(folder, "*.pickle")))
if not files:
print("ERR_NO_PICKLES")
raise SystemExit(2)
with open(files[0], "rb") as f:
obj = pickle.load(f)
if not isinstance(obj, dict):
print("ERR_NOT_DICT")
raise SystemExit(3)
keys = set(obj.keys())
required = {"lan_data", "lan_labels"}
if not required.issubset(keys):
print("ERR_BAD_KEYS")
print(",".join(sorted(keys)))
raise SystemExit(4)
print("OK_KEYS")
PY
)"; then
🧰 Tools
🪛 Shellcheck (0.11.0)

[error] 195-195: Shells disambiguate $(( differently or not at all. For $(command substitution), add space after $( . For $((arithmetics)), fix parsing errors.

(SC1102)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/train_torch_models_batch.sh` around lines 194 - 223, Update the
validation_out assignment in the batch validation flow to use an unambiguous
plain command substitution by removing the extra opening parenthesis after $(
and its matching closing parenthesis. Preserve the existing uv run python
heredoc and validation behavior unchanged.

Source: Linters/SAST tools

Comment thread src/lanfactory/network_inspectors/plotting.py Outdated
Comment on lines +188 to +198
if st.button("Run KDE vs LAN", use_container_width=True):
with st.spinner("Computing likelihoods..."):
comparison = compute_kde_vs_lan_likelihoods(
parameter_df=parameter_df,
model=model,
torch_mlp_predict=predictor,
n_samples=n_samples,
n_reps=n_reps,
grid=grid_spec,
)
fig = build_kde_vs_lan_figure(comparison, plot_cfg)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Wrap likelihood computation in error handling, consistent with predictor loading.

The "Run KDE vs LAN" block calls compute_kde_vs_lan_likelihoods and build_kde_vs_lan_figure without a try/except. Any ValueError from validation (for example an empty or malformed parameter frame) surfaces as a raw traceback instead of a st.error message, unlike the predictor-loading path at lines 407-411.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lanfactory/network_inspectors/streamlit_app.py` around lines 188 - 198,
Wrap the likelihood computation and figure construction inside the “Run KDE vs
LAN” block with try/except handling for ValueError, matching the
predictor-loading error path. Display the caught validation error through
st.error instead of allowing a raw traceback, while preserving the existing
spinner and successful comparison/figure flow.

Comment thread src/lanfactory/network_inspectors/streamlit_app.py Outdated
Comment thread src/lanfactory/network_inspectors/streamlit_app.py
Comment thread tests/test_network_inspectors_plotting.py
@cpaniaguam
cpaniaguam marked this pull request as draft July 31, 2026 15:09
@cpaniaguam
cpaniaguam changed the base branch from main to 102-separate-linting-workflow-in-ci August 3, 2026 15:16
@cpaniaguam
cpaniaguam changed the base branch from 102-separate-linting-workflow-in-ci to main August 3, 2026 16:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 39 out of 40 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

src/lanfactory/trainers/torch_mlp.py:454

  • -torch.log(1 + torch.exp(-x)) can overflow for large negative x (because torch.exp(-x) can become inf), producing -inf/nan. Using the numerically-stable softplus implementation avoids overflow while preserving the same value.
        elif self.train_output_type == "logits":
            return -torch.log(
                1 + torch.exp(-self.layers[-1](x))
            )  # log ( 1 / (1 + exp(-x))), where x = log(p / (1 - p))

src/lanfactory/trainers/jax_mlp.py:128

  • -jnp.log(1 + jnp.exp(-x)) can overflow for large negative x and produce -inf/nan. Prefer the numerically-stable softplus-based formulation to compute log(sigmoid(x)).
        if (not self.train) and (self.train_output_type == "logits"):
            x = -jnp.log(1 + jnp.exp(-x))

Comment on lines +195 to +223
if ! validation_out="$((uv run python - "$folder" <<'PY'
import glob
import os
import pickle
import sys

folder = sys.argv[1]
files = sorted(glob.glob(os.path.join(folder, "*.pickle")))
if not files:
print("ERR_NO_PICKLES")
raise SystemExit(2)

with open(files[0], "rb") as f:
obj = pickle.load(f)

if not isinstance(obj, dict):
print("ERR_NOT_DICT")
raise SystemExit(3)

keys = set(obj.keys())
required = {"lan_data", "lan_labels"}
if not required.issubset(keys):
print("ERR_BAD_KEYS")
print(",".join(sorted(keys)))
raise SystemExit(4)

print("OK_KEYS")
PY
))"; then
@cpaniaguam
cpaniaguam changed the base branch from main to 102-separate-linting-workflow-in-ci August 4, 2026 18:40
@cpaniaguam

cpaniaguam commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Cleaned up in #106

@cpaniaguam cpaniaguam closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants