Skip to content

Preparations for CRAN/PyPI#7

Merged
config-i1 merged 7 commits into
mainfrom
python
Jun 19, 2026
Merged

Preparations for CRAN/PyPI#7
config-i1 merged 7 commits into
mainfrom
python

Conversation

@config-i1

Copy link
Copy Markdown
Collaborator

No description provided.

config-i1 and others added 7 commits June 19, 2026 11:49
Address the actionable items from the CRAN-readiness review:

1. ASCII-ify all roxygen/comments in R/ (em-dash, arrows, approx, times,
   Greek letters, set/minus signs) and regenerate man/.  This removes the
   non-ASCII characters that caused "LaTeX errors when creating PDF
   version" -- the Rd->LaTeX conversion now succeeds (verified; the local
   PDF step only fails for lack of pdflatex in the sandbox).
2. Add runnable @examples to pts() and the pts-methods group (forecast /
   print / fitted / residuals); `R CMD check` examples run OK.
3. Version -> 0.1.0 (DESCRIPTION, NEWS, python/pyproject.toml); Date
   updated.
4. .Rbuildignore: exclude .mypy_cache, .ruff_cache.
5. .Rbuildignore: exclude PYTHON_PORT.md, muse.Rcheck, *.tar.gz, .RData,
   .Rhistory, cran-comments.md.
6. src/Makevars: strip debug symbols on Linux -> installed size NOTE is
   now OK (18 MB -> under 5 MB).  Documented the residual size in the new
   cran-comments.md.
9. Move Rcpp from Depends to Imports (already importFrom'd in NAMESPACE).
10. Date -> 2026-06-19.

Title and Description expansion (items 7, 8) left for the maintainer.

R CMD check --as-cran: no remaining package-level ERROR/WARNING/NOTE; the
ones still shown are sandbox-environmental (no pdflatex / qpdf / tidy / V8,
locale, clock skew).  Tests and vignettes pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Close the gap where the Python front-end only accepted scalar non-seasonal
ARMA orders.  `orders` now takes length-2 ar/ma vectors for
SARMA(p,q)(P,Q)_s, exactly as R does -- with one deliberate API choice:
the seasonal lag comes from the separate top-level `lags`, NOT from
`orders` (passing `orders["lags"]` raises a clear error).

- translate.orders_to_uc(): port of R's .pts_orders_to_uc (minus the
  orders$lags branch) -- normalises ar/ma to per-lag vectors, derives
  lags = [1, seasonal_lag] for length-2, drops trailing zero blocks while
  keeping the non-seasonal block, validates non-negativity and the
  one-seasonal-lag limit.
- translate.arma_spec(): builds the (arma_orders tuple, irregular string),
  2-tuple/arma(p,q) or 5-tuple/arma(p,q,P,Q,s).
- PTS.fit(): thread the per-lag vectors through pts_to_uc, the engine
  (_engine now takes the irregular-option string), the selector, and
  forecasting; $orders reports scalar ar/ma for non-seasonal and vectors
  for SARMA, like R's orders().

Parity: 20/20 pts specs match R within 1e-6 (worst 3.5e-9), including the
new SARMA(1,0)(1,0)_12 / (0,1)(0,1)_12 / mixed cases.  Forecast, simulate,
and select all verified for SARMA.  Functionality suite +4 tests (38 total).
README updated to document seasonal orders + the lags-is-separate rule.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The doc was R-only.  Add the Python package now that it exists:

- Package layout extended with src/python/musecpp2py.cpp, src/muse_compat.h,
  and the full python/ tree (pyproject/CMakeLists, src/muse/core/*.py,
  tests/).
- New "Two front-ends, one engine" subsection: a table mapping the R and
  Python bindings (musecpp2R.cpp vs musecpp2py.cpp; .UCompC/.UCompARMAC vs
  _musecore.ucomp/ucomp_arma; pts() vs PTS; R CMD INSTALL vs scikit-build),
  and how the shared engine + muse_compat.h Rprintf shim + .Rbuildignore
  keep the two builds from colliding.
- New "Python front-end" section: R<->Python module mapping table, the two
  engine entry points, deliberate differences (coef source, orders/lags
  API, no formula/auto-distribution, optional smooth/greybox deps), and the
  test split (functionality in CI, parity vs R out of CI).
- Mental-model pointer to the above.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
"muse" is already registered on PyPI (a yanked 2015 stub), so the
distribution is named "muse-py".  The importable package is unchanged:
pip install muse-py; import muse (wheel.packages still src/muse) -- the
common pip-name != import-name pattern (cf. scikit-learn/sklearn).

- pyproject: [project] name = "muse-py".
- README: document the install/import mapping in the Installation section.

Verified: wheel builds as muse_py-0.1.0, installs as "muse-py" (pip show),
imports as `muse`, and fits.  Nothing else changes -- import code, tests,
CMake, the engine, and the R package (CRAN: muse) are untouched.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…n smooth)

Path filters (run each check only when the relevant code changes):
- R-CMD-check.yaml: triggers on R/, src/ (shared engine) EXCEPT src/python/,
  man/, tests/, vignettes/, DESCRIPTION, NAMESPACE, the workflow itself.
- python-check.yaml: triggers on python/, src/ (engine + src/python/), the
  workflow itself.  (A src/ engine change runs both, as it should.)

Release pipeline (build -> test -> draft -> manual publish), mirroring
smooth's:
- build-release-wheels.yml (manual / workflow_dispatch): cibuildwheel across
  Linux/macOS/Windows x cp310-cp313, smoke-tests each wheel
  (test_functionality.py), builds the sdist, and stages everything on a
  *draft* GitHub release (no tag, no PyPI).  Re-running replaces the draft's
  assets.  muse-specific delta vs smooth: installs system Armadillo (EPEL /
  brew / vcpkg) since muse uses the system Armadillo rather than a vendored
  copy.
- release.yml (on release: published): downloads the staged assets and
  uploads them to PyPI (muse-py) via Trusted Publishing + PEP 740
  attestations.

So the flow is: dispatch build-release-wheels -> review the draft -> click
"Publish release" -> release.yml ships to PyPI.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@config-i1
config-i1 merged commit 26e0dfe into main Jun 19, 2026
6 checks passed
config-i1 added a commit that referenced this pull request Jul 23, 2026
Preparations for CRAN/PyPI
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