#!/usr/bin/env python3 """Arithmetic on the basil abstract's numbers, under RULES_abstract_arithmetic.txt (rules A1-A6). Mannino, Caldo and Maffei (2026), Journal of Plant Physiology 326, 154872, doi:10.1016/j.jplph.2026.154872. We could read only the abstract, so these are descriptive numbers, not tests: there are no data, n or spreads. This is the hosted version of the script we first ran on saved copies. It fetches its two inputs by URL under a plain client name and checks them against the copies we used: - PubMed's record of the paper (PMID 42705124): the SHA-256 of the abstract's text (whitespace collapsed, Unicode NFC), not of the whole record, which PubMed may re-index. The record is read in memory, not saved. - The field-model shares from our mint page, lsmod2_sampling.json (our run of LSMOD.2, Korte and Brown 2019, CC BY 4.0): the SHA-256 of the file. The field values in VALUES_UT are the ones published on our mint page, reused, not re-derived. Run: python3 -I abstract_arithmetic.py python3 -I abstract_arithmetic.py (offline) Standard library only. """ import hashlib import json import math import re import sys import unicodedata import urllib.request import xml.etree.ElementTree as ET from pathlib import Path AGENT = "factchecked-research/1.0" PUBMED_URL = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id=42705124&retmode=xml" ABSTRACT_SHA256 = "c20002b591a1fe8866cdaa852470038e82c9a9c9458334239d292ba4d0dc0a56" SAMPLING_URL = "https://factchecked.science/hypomagnetic-mint/lsmod2_sampling.json" SAMPLING_SHA256 = "f72d5e51c8ef203aa3ab2e39b30850d3b4233320f4ea2af42a5702e334385c47" NEEDLES = ("hMF, < 40 nT", "GMF, ∼44 μT", "eugenol and methyl eugenol increasing 1.3- and 1.8-fold, respectively", "the two methyltransferases (ObCOMT and ObEOMT), were significantly downregulated") HMF_NT = 40.0 # I1: "< 40 nT", an upper bound on the coil's field GMF_NT = 44000.0 # I2: "~44 uT", the control field FOLDS = {"eugenol": 1.3, "methyl_eugenol": 1.8} # I3: printed to one decimal VALUES_UT = { # I4: as published on /hypomagnetic-mint/ "LSMOD.2 deepest moment, 5th percentile": 2.3, "LSMOD.2 deepest moment, median": 7.1, "LSMOD.2 deepest moment, 95th percentile": 16.0, "Korte 2019 point minimum, model A": 0.03, "Korte 2019 point minimum, preferred model C": 0.12, "Lava low, La Palma": 3.9, "Lava low, Steens Mountain (about)": 5.0, "Lava, Louchadiere flow (Laschamp)": 12.9, "Today's surface, lowest": 23.0, "Today's surface, highest": 67.0, "The basil paper's control field": 44.0, } SPACE_NT = {"interstellar space": (2, 8), "Moon": (9, 300), "Mars": (10, 5000)} def fetch(url): req = urllib.request.Request(url, headers={"User-Agent": AGENT}) with urllib.request.urlopen(req, timeout=60) as r: return r.read() def sig2(x): return round(x, -int(math.floor(math.log10(abs(x)))) + 1) if x else 0 def main(): out_path = Path(sys.argv[1]) if len(sys.argv) == 4: xml_bytes, sampling_bytes = Path(sys.argv[2]).read_bytes(), Path(sys.argv[3]).read_bytes() else: xml_bytes, sampling_bytes = fetch(PUBMED_URL), fetch(SAMPLING_URL) abstract = " ".join("".join(t.itertext()) for t in ET.fromstring(xml_bytes).iter("AbstractText")) abstract = re.sub(r"\s+", " ", unicodedata.normalize("NFC", abstract)).strip() got = hashlib.sha256(abstract.encode("utf-8")).hexdigest() if got != ABSTRACT_SHA256: sys.exit(f"The abstract's text differs from the one we used (SHA-256 {got}); stopping.") got = hashlib.sha256(sampling_bytes).hexdigest() if got != SAMPLING_SHA256: sys.exit(f"lsmod2_sampling.json differs from the copy we used (SHA-256 {got}); stopping.") abstract_n = unicodedata.normalize("NFKC", abstract) for needle in NEEDLES: if unicodedata.normalize("NFKC", needle) not in abstract_n: sys.exit(f"Not in the abstract: {needle!r}") out = {"rules": "RULES_abstract_arithmetic.txt", "inputs_checked_in_abstract": True, "inputs": {"pubmed": PUBMED_URL, "abstract_text_sha256": ABSTRACT_SHA256, "lsmod2_sampling": SAMPLING_URL, "lsmod2_sampling_sha256": SAMPLING_SHA256}} # A1: the field reduction (both lower bounds, since the coil is below 40 nT) out["A1_field"] = {"reduction_factor_at_least": GMF_NT / HMF_NT, "share_removed_at_least_percent": round(100 * (1 - HMF_NT / GMF_NT), 3)} # A2: the two compounds as percent increases, with the rounding of the printed folds out["A2_percent_increase"] = {k: {"printed": round(100 * (v - 1)), "low": round(100 * (v - 0.05 - 1)), "high": round(100 * (v + 0.05 - 1))} for k, v in FOLDS.items()} # A3: methyl eugenol relative to eugenol, coil against control ratio, lo, hi = 1.8 / 1.3, 1.75 / 1.35, 1.85 / 1.25 out["A3_methyl_eugenol_to_eugenol"] = { "relative_ratio": round(ratio, 3), "low": round(lo, 3), "high": round(hi, 3), "percent_rise": round(100 * (ratio - 1)), "percent_low": round(100 * (lo - 1)), "percent_high": round(100 * (hi - 1)), "lower_bound_above_1": lo > 1, "assumption": "both folds are ratios of group means of the same quantity"} # A4: each field value as a multiple of the coil's 40 nT (at least), and of the mint coil's 30 nT out["A4_times_coil"] = {k: {"uT": v, "times_basil_coil_at_least": sig2(v * 1000 / HMF_NT), "times_mint_coil_30nT": sig2(v * 1000 / 30.0)} for k, v in VALUES_UT.items()} # A5: the share of the surface ever below 40 nT, 44-38 ka, bracketed by the 30 nT and 100 nT rows levels = json.loads(sampling_bytes.decode("utf-8"))["1_degree_1_year"]["levels"] out["A5_share_ever_below_40nT_bracket_percent"] = { "above_this (30 nT row)": round(100 * levels["30"]["share_ever_below"], 4), "below_this (100 nT row)": round(100 * levels["100"]["share_ever_below"], 4), "note": "LSMOD.2, 44-38 ka, 1-degree cells, yearly steps, from the mint page's hosted lsmod2_sampling.json; no new run"} # A6: 40 nT against the ranges a review lists off Earth out["A6_space"] = {k: ("40 nT is above this range" if HMF_NT > b else "40 nT is below this range" if HMF_NT < a else "40 nT lies inside this range") for k, (a, b) in SPACE_NT.items()} text = json.dumps(out, indent=1, ensure_ascii=False) + "\n" with open(out_path, "w", encoding="utf-8", newline="\n") as fh: fh.write(text) sys.stdout.reconfigure(encoding="utf-8") print(text) if __name__ == "__main__": main()