Skip to content

Load example data from rheodata instead of bundling it - #32

Merged
marcocaggioni merged 2 commits into
masterfrom
rheofit-rheodata-deps
Sep 30, 2026
Merged

marcocaggioni merged 2 commits into
masterfrom
rheofit-rheodata-deps

Conversation

@marcocaggioni

Copy link
Copy Markdown
Member

rheofit no longer bundles example data — it loads it from the rheodata package (pip install rheopy-rheodata), now live on PyPI at v0.1.0. One source of truth for data.

What changed

  • Dependency: rheopy-rheodata>=0.1 added to pyproject.toml.
  • Deleted bundled data: rheofit/data/*.json, rheofit/data/*.xlsx (4 files) and docs/walkthrough/*.json (3 files). All PNGs/SVGs in docs/walkthrough/ kept.
  • Walkthrough docs rewritten to load via rheodata.to_rheofit(...):
    • walkthrough.md → caggioni_pg_carbopol_2pct / carbopol_2pct (CLI block replaced with the Python API; reproducibility now via seed=0)
    • walkthrough-carreau.md → caggioni_linear_polymer_flow / linear_polymer (flow-curve fit executable; amplitude/frequency sweeps from the same session remain in the comparison figures — those datasets are not in rheodata v0.1.0 yet)
    • walkthrough-carreau-carreau.md → caggioni_wlm_polymer_temp_series / T_18…
    • walkthrough-carbopol-glycerin.md → caggioni_carbopol_glycerin_temp / T_20,T_30,T_40 (also fixes the stale 0/1/2 step indices — sample IDs are explicit now)
  • Demo reworked: demo_source() materializes the Carbopol demo dataset from rheodata as a TRIOS JSON in the temp dir — still no network needed (data ships in the rheodata wheel). CLI --demo and the skill demo flow keep working. DATA_DIR/DEMO_JSON_FILE removed; DEMO_SAMPLE_NAME is now "Carbopol 2% in PG (demo)".
  • Skill (rheofit/skills/ and .github/skills/ copies): demo section rewritten around the rheodata Carbopol dataset (tc vs HB head-to-head); also drops the dead P&G SharePoint fallback URL.
  • README: demo_source() description updated.

Verification

  • Fresh pip install of the branch pulls rheopy-rheodata from PyPI; import rheofit works.
  • Every walkthrough fit re-run end-to-end via rheodata — all documented numbers reproduce exactly: TC 6.018e-04 / HB 3.651e-03 (Carbopol PG), Carreau 3.847e-03 (linear polymer), TC 1.22e-04/2.05e-04/1.42e-04 at 40/30/20 °C (glycerin), carreau_carreau 8.278e-04 (WLM 18 °C).
  • CLI python -m rheofit --demo (print_steps + tc fit) works on the materialized demo.
  • sphinx-build -W -b html docs docs/_build/html: clean for all touched pages (only pre-existing myst.xref_missing warnings for the WASM explorer iframes, which are generated by export_interactive.py in CI).
  • No test suite in CI (docs + app-deploy workflows only); no P&G references introduced.

Follow-up (not in this PR): add the linear-polymer amplitude/frequency sweeps to rheodata so the Carreau walkthrough is fully executable again.

- Add rheopy-rheodata>=0.1 as a dependency; example/walkthrough
  datasets now come from the rheodata package (single source of truth).
- Delete bundled data: rheofit/data/*.json, *.xlsx and
  docs/walkthrough/*.json (PNGs/SVGs kept).
- Walkthrough docs load data via rheodata.to_rheofit(); all documented
  fit numbers verified to reproduce exactly from rheodata.
- demo_source() materializes the Carbopol demo dataset from rheodata
  (no network needed; data ships in the rheodata wheel); CLI --demo
  and the skill demo flow keep working. Drop DATA_DIR/DEMO_JSON_FILE.
- Skill demo reworked around the rheodata Carbopol dataset (tc vs HB).
…walkthrough

rheodata 0.1.1 ships the linear polymer amplitude and frequency sweeps, so
the narrative-only sections become runnable code: load both sweeps via
rheodata.load(), compute |eta*(w)| and eta'(gamma0*w), and compare against
the flow curve with log-RMS on the overlap range. All documented numbers
reproduce (Carreau 3.847e-03, Cox-Merz 2.3 %, Delaware-Rutgers 9 %);
verified end-to-end plus sphinx build with no new warnings.
@marcocaggioni
marcocaggioni merged commit b339e82 into master Sep 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant