Skip to content

Fix --log-file handling and correct stale CLI docs - #26

Open
youngdashu wants to merge 3 commits into
mainfrom
fix/cli-log-file-and-stale-docs
Open

Fix --log-file handling and correct stale CLI docs#26
youngdashu wants to merge 3 commits into
mainfrom
fix/cli-log-file-and-stale-docs

Conversation

@youngdashu

@youngdashu youngdashu commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Three changes.

--log-file before the sub-command — the top-level parser and the sub-parsers both defined -v/--verbose and --log-file, and the sub-parser defaults overwrote the values that the top-level parser had put in the namespace. So fridata --log-file x.log generate_embeddings ... silently dropped the log file. Both flags now come from a shared add_logging_arguments() with default=argparse.SUPPRESS, so a flag given before the sub-command survives. This also gives create_dataset and generate_data a --log-file flag, which they never had, and removes a duplicate -v/--verbose definition.

Stale CLI invocations in the docs — the src/ layout removed fridata.py, so the AFDB example in the README and on the docs page now calls python -m fridata. demo.ipynb used two forms the CLI does not accept: create_dashboard --dataset X (the argument is positional) and fridata load, a sub-command that no longer exists; the latter is replaced by a short Python snippet that prints the same dataset object.

scripts/setup_env.sh interpreter choice — the script took whatever python3 was on PATH and then failed inside pip when that interpreter was older than the requires-python floor (a conda base environment, for example). It now prefers the newest Python >= 3.11 that it finds, accepts --python EXEC (or PYTHON=...) and rejects a too-old interpreter up front. .venv/ and venv/ are now ignored.

Testing

Local run on Python 3.13 with pip install -e ".[embeddings,test]": 137 passed, 1 skipped. Every command in the corrected docs was checked against create_parser().

youngdashu and others added 3 commits August 7, 2026 01:41
The top-level parser and the sub-parsers both defined -v/--verbose and
--log-file. Because the sub-parser defaults overwrite the values that the
top-level parser puts in the namespace, `fridata --log-file x.log
generate_embeddings ...` silently dropped the log file.

Move both flags into a shared add_logging_arguments() that sets
default=argparse.SUPPRESS, so a flag that is not given after the
sub-command keeps the top-level value. This also adds --log-file to
create_dataset and generate_data, which had no such flag, and removes a
duplicate -v/--verbose definition.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The src/ layout removed fridata.py, so the AFDB example must call
`python -m fridata` with PYTHONPATH pointing at src/.

demo.ipynb used two forms that the CLI does not accept: `create_dashboard
--dataset X` (the argument is positional) and `fridata load`, a
sub-command that no longer exists. Replace the second one with a short
Python snippet that prints the same dataset object.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
setup_env.sh used whatever python3 was on PATH. If that interpreter was
older than the requires-python floor (a conda base environment, for
example), the script created the venv and only failed later, inside pip.

Auto-detect now tries python3.14 down to python3.11 before plain
python3/python and takes the first one that is at least 3.11. A new
--python EXEC option (or PYTHON=...) selects an interpreter explicitly and
is rejected up front when it is too old. The floor lives in
MIN_MAJOR/MIN_MINOR, to be kept in sync with pyproject.toml.

Also ignore .venv/ and venv/, and document the new option in the README.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant