8 add more data - #12
Merged
Merged
Conversation
- Implemented extensive tests for functions in `src/lmlm-audit/run_audit.py`, covering normal, boundary, and edge cases. - Added logging of diagnostic plots to W&B for visual analysis. - Created a new test file `test_equivalence.py` with unit tests for all public functions in `src/lmlm-audit/equivalence.py`, ensuring thorough coverage of functionality. - Included tests for tokenization, normalization, alias handling, and equivalence checking, with W&B visualizations for key metrics.
- tests/conftest.py: new shared W&B session fixture (offline mode by default), matplotlib Agg backend, sys.path setup, shared fake DB classes - tests/test_equivalence.py: new file with 99 tests covering every function in equivalence.py including edge cases and two W&B plots - tests/test_database_states.py: extended from 6 to 65 tests covering DatabaseState enum, TargetFact, target_fact_from_prompt_row, all three extract_lookup_query patterns, is_deleted_triplet alias/case handling, candidate_supports_target_fact all flag combinations, and AuditDatabaseManager FULL/DEL-ON/DEL-OFF/no-target-fact paths - tests/test_metrics.py: extended from 14 to 126 tests covering all rate helpers, _group_results_by_fact, _eligible_state_groups, parametric leakage/retrieval-mediated-correctness/artifact-rate edge cases, and three W&B scatter/bar plots - tests/test_model_loader.py: filled in from empty to 20 tests for _get_best_device (mocked CUDA/MPS), _resolve_database_path (tmp_path), and load_model_and_tokenizer import guard + dotenv + pad_token + device - tests/test_run_audit.py: extended from 2 to 80 tests covering clean_answer (20+ cases), extract_lookup_values, choose_answer, compute_generation_budget, retrieve_lookup_value fallback policy, load_prompts, save_results, and _default_retrieval_trace Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add comprehensive pytest suite with W&B plot logging
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.