Add ProHarvest Seeds: 119 varieties + 161 cross-vendor plot reports (#16)
Image rebuild (skip scrape) / build (push) Successful in 5m46s
Image rebuild (skip scrape) / build (push) Successful in 5m46s
Co-authored-by: claude <claude@jpaul.io> Co-committed-by: claude <claude@jpaul.io>
This commit was merged in pull request #16.
This commit is contained in:
@@ -509,6 +509,28 @@ def _render_trial_chunk(sidecar: dict, md_text: str | None = None) -> str:
|
||||
# for each (Golden Harvest / LG Seeds / AgriGold).
|
||||
if source in ("gh_plot_reports", "lg_plot_reports", "agrigold_plot_reports"):
|
||||
return _render_gh_plot_chunk(sidecar)
|
||||
if source == "proharvest_plots":
|
||||
# Structured rows → shared cross-vendor renderer (publisher brand
|
||||
# read from the sidecar). Foreign-format third-party PDFs that
|
||||
# couldn't be parsed into rows carry raw_text=True and the verbatim
|
||||
# table text in the .md body — embed that so they're still found.
|
||||
if sidecar.get("results"):
|
||||
return _render_gh_plot_chunk(sidecar)
|
||||
crop = (sidecar.get("crop") or "").lower()
|
||||
crop_label = {"corn": "Corn", "soybeans": "Soybean"}.get(crop, crop.title())
|
||||
coop = sidecar.get("cooperator") or ""
|
||||
state = sidecar.get("state") or ""
|
||||
year = sidecar.get("year") or ""
|
||||
head = [
|
||||
f"# {crop_label} yield trial — {coop} ({state}, {year})", "",
|
||||
"ProHarvest Seeds plot report (cross-vendor, verbatim from PDF).", "",
|
||||
]
|
||||
body = md_text or ""
|
||||
sep = "## Trial data (verbatim from PDF)"
|
||||
if sep in body:
|
||||
body = body.split(sep, 1)[1].strip()
|
||||
body = re.sub(r"```", "", body).strip()
|
||||
return "\n".join(head) + "\n" + body + "\n"
|
||||
if source == "agripro_trials":
|
||||
header = _render_agripro_trial_chunk(sidecar)
|
||||
if md_text:
|
||||
|
||||
Reference in New Issue
Block a user