feat(bib): route the ML library and the LEAD snowball into Zotero collections
All checks were successful
CI / lint (push) Successful in 51s
CI / notebooks-smoke (push) Successful in 1m43s
Deploy / changes (push) Successful in 13s
CI / test (push) Successful in 3m28s
Infra CI / notebooks (push) Successful in 55s
Infra CI / zotero (push) Successful in 23s
Infra CI / docs (push) Successful in 18s
Infra CI / api (push) Successful in 1m10s
Infra CI / bcda (push) Successful in 1m42s
Infra CI / llm (push) Successful in 57s
Deploy / notebooks (push) Has been skipped
Deploy / zotero (push) Has been skipped
Deploy / docs (push) Has been skipped
Infra CI / mc (push) Successful in 21s
Deploy / api (push) Successful in 1m0s
Deploy / bcda (push) Successful in 1m14s
Deploy / mc (push) Has been skipped
Deploy / llm (push) Successful in 1m38s
Deploy / report (push) Successful in 18s
All checks were successful
CI / lint (push) Successful in 51s
CI / notebooks-smoke (push) Successful in 1m43s
Deploy / changes (push) Successful in 13s
CI / test (push) Successful in 3m28s
Infra CI / notebooks (push) Successful in 55s
Infra CI / zotero (push) Successful in 23s
Infra CI / docs (push) Successful in 18s
Infra CI / api (push) Successful in 1m10s
Infra CI / bcda (push) Successful in 1m42s
Infra CI / llm (push) Successful in 57s
Deploy / notebooks (push) Has been skipped
Deploy / zotero (push) Has been skipped
Deploy / docs (push) Has been skipped
Infra CI / mc (push) Successful in 21s
Deploy / api (push) Successful in 1m0s
Deploy / bcda (push) Successful in 1m14s
Deploy / mc (push) Has been skipped
Deploy / llm (push) Successful in 1m38s
Deploy / report (push) Successful in 18s
source:ml-library → ML library / Books | Articles (by ml:book), and source:lead-snowball → LEAD corpus / Cited works. Without a route the sync files items at the top of My Library only (the ML library's first push reported collections: 0).
This commit is contained in:
@@ -474,6 +474,11 @@ def _zotero_collection_path(item: Item) -> list[str]:
|
||||
if guidance:
|
||||
return [*base, guidance]
|
||||
return base
|
||||
if "source:ml-library" in item.tags:
|
||||
return ["ML library", "Books" if "ml:book" in item.tags else "Articles"]
|
||||
if "source:lead-snowball" in item.tags:
|
||||
# Works the LEAD corpus cites, pulled from open-access sources.
|
||||
return ["LEAD corpus", "Cited works"]
|
||||
if "source:lead-corpus" in item.tags:
|
||||
# dev/scripts/import_lead_corpus.py: research papers by the topic
|
||||
# folder they were staged in (first lead-topic: tag), dataset
|
||||
|
||||
@@ -248,6 +248,22 @@ class TestCollectionPathEdge:
|
||||
"Measure specifications",
|
||||
]
|
||||
|
||||
def test_ml_library_books_and_articles(self):
|
||||
book = Source(title="Elements of Statistical Learning")
|
||||
for t in ("source:ml-library", "ml:book"):
|
||||
book.add_tag(t)
|
||||
paper = Source(title="Conformal prediction tutorial")
|
||||
for t in ("source:ml-library", "ml:article"):
|
||||
paper.add_tag(t)
|
||||
assert _zotero_collection_path(book) == ["ML library", "Books"]
|
||||
assert _zotero_collection_path(paper) == ["ML library", "Articles"]
|
||||
|
||||
def test_lead_snowball_cited_works(self):
|
||||
item = Source(title="Pope 2004")
|
||||
item.add_tag("source:lead-snowball")
|
||||
item.add_tag("lead-topic:risk_adjustment")
|
||||
assert _zotero_collection_path(item) == ["LEAD corpus", "Cited works"]
|
||||
|
||||
def test_oig_no_sector_no_guidance(self):
|
||||
"""Line 421: OIG with neither sector nor guidance → base only."""
|
||||
item = Source(title="OIG doc")
|
||||
|
||||
Reference in New Issue
Block a user