Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix: Remove redundant demo script causing test collection error

LearningCircuit9b1418b40004
diff --git a/src/local_deep_research/text_optimization/test_citation_formatter.py b/src/local_deep_research/text_optimization/test_citation_formatter.py
deleted file mode 100644
index ad611452c8..0000000000
--- a/src/local_deep_research/text_optimization/test_citation_formatter.py
+++ /dev/null
@@ -1,128 +0,0 @@
-"""Test script to demonstrate citation formatter functionality."""
-
-from local_deep_research.text_optimization.citation_formatter import (
- CitationFormatter,
- CitationMode,
- LaTeXExporter,
-)
-
-
-def test_citation_formatter():
- """Test the citation formatter with different modes."""
-
- # Sample markdown content with citations including multiple citations
- sample_content = """# Research Report
-
-This is a research report about artificial intelligence [1]. Recent advances in
-machine learning [2] have shown significant progress. The work by researchers
-at DeepMind [3] has been particularly influential.
-
-## Key Findings
-
-The analysis reveals several important points:
-- Deep learning models are becoming more efficient [1]
-- Transfer learning enables better generalization [2]
-- Large language models show emergent capabilities [3]
-- Multiple studies confirm these findings [1][2][3]
-- Some research combines different approaches [2][3]
-- Comprehensive surveys cover all aspects [1, 2, 3]
-- Recent work builds on earlier findings [2, 3]
-
-## Sources
-
-[1] Understanding Deep Learning
- URL: https://arxiv.org/abs/2104.12345
-
-[2] Transfer Learning: A Survey
- URL: https://www.nature.com/articles/s41586-021-03819-2
-
-[3] Emergent Abilities of Large Language Models
- URL: https://openai.com/research/emergent-abilities
-"""
-
- print("Original content:")
- print("-" * 50)
- print(sample_content)
- print("\n" + "=" * 70 + "\n")
-
- # Test NUMBER_HYPERLINKS mode
- formatter = CitationFormatter(mode=CitationMode.NUMBER_HYPERLINKS)
- formatted = formatter.format_document(sample_content)
-
- # Assertions for NUMBER_HYPERLINKS mode
- assert "[[1]](https://arxiv.org/abs/2104.12345)" in formatted
- assert (
- "[[2]](https://www.nature.com/articles/s41586-021-03819-2)" in formatted
- )
- assert "[[3]](https://openai.com/research/emergent-abilities)" in formatted
- # Check that consecutive citations are each hyperlinked
- assert (
- "[[1]](https://arxiv.org/abs/2104.12345)[[2]](https://www.nature.com/articles/s41586-021-03819-2)[[3]](https://openai.com/research/emergent-abilities)"
- in formatted
- )
- print("✓ NUMBER_HYPERLINKS mode assertions passed")
-
- # Test DOMAIN_HYPERLINKS mode
- formatter = CitationFormatter(mode=CitationMode.DOMAIN_HYPERLINKS)
- formatted = formatter.format_document(sample_content)
-
- # Assertions for DOMAIN_HYPERLINKS mode
- assert "[[arxiv.org]](https://arxiv.org/abs/2104.12345)" in formatted
- assert (
- "[[nature.com]](https://www.nature.com/articles/s41586-021-03819-2)"
- in formatted
- )
- assert (
- "[[openai.com]](https://openai.com/research/emergent-abilities)"
- in formatted
- )
- print("✓ DOMAIN_HYPERLINKS mode assertions passed")
-
- # Test NO_HYPERLINKS mode
- formatter = CitationFormatter(mode=CitationMode.NO_HYPERLINKS)
- formatted = formatter.format_document(sample_content)
-
- # Assertions for NO_HYPERLINKS mode
- assert "[1]" in formatted
- assert "[2]" in formatted
- assert "[3]" in formatted
- assert "[[1]]" not in formatted # Should not have hyperlink syntax
- assert (
- "https://" not in formatted.split("## Sources")[0]
- ) # URLs should not appear in main content
- print("✓ NO_HYPERLINKS mode assertions passed")
-
- # Test DOMAIN_ID_HYPERLINKS mode (default)
- formatter = CitationFormatter(mode=CitationMode.DOMAIN_ID_HYPERLINKS)
- formatted = formatter.format_document(sample_content)
-
- # Assertions for DOMAIN_ID_HYPERLINKS mode
- # Should use domain names without IDs for first occurrence
- assert (
- "[[arxiv.org]](https://arxiv.org/abs/2104.12345)" in formatted
- or "[[arxiv.org-1]](https://arxiv.org/abs/2104.12345)" in formatted
- )
- print("✓ DOMAIN_ID_HYPERLINKS mode assertions passed")
-
- # Test LaTeX export
- print("\nTesting LaTeX Export:")
- print("-" * 50)
- exporter = LaTeXExporter()
- latex_content = exporter.export_to_latex(sample_content)
-
- # Assertions for LaTeX export
- assert "\\documentclass[12pt]{article}" in latex_content
- assert "\\title{Research Report}" in latex_content
- assert "\\date{\\today}" in latex_content
- assert "\\begin{document}" in latex_content
- assert "\\end{document}" in latex_content
- assert "\\subsection{Key Findings}" in latex_content
- assert "\\bibitem{1}" in latex_content
- assert "\\cite{1}" in latex_content
- print("✓ LaTeX export assertions passed")
-
- print("\nAll tests passed successfully!")
-
-
-if __name__ == "__main__":
- test_citation_formatter()