1
0
mirror of https://github.com/msberends/AMR.git synced 2026-04-06 17:35:58 +02:00

fix: convert Python lists to R vectors in wrapper generator (#270)

* fix: convert Python lists to R vectors in wrapper to prevent R list coercion errors

Fixes #267. Python lists passed to R functions via rpy2 are received as
R lists, not R character/numeric vectors. This causes is.mic(), is.sir(),
is.disk() etc. to return length > 1 logicals, which break R's && operator.

Added convert_to_r() helper that maps Python list/tuple to the appropriate
typed R vector (StrVector, IntVector, FloatVector) based on element types.
The r_to_python decorator now applies this to all args and kwargs before
calling the R function.

* docs: instruct Claude to install git and gh before computing version
This commit is contained in:
Matthijs Berends
2026-04-05 17:26:21 +02:00
committed by GitHub
parent 6c24718893
commit fb8758f36b
2 changed files with 41 additions and 4 deletions

View File

@@ -152,7 +152,16 @@ All PRs are **squash-merged**, so each PR lands as exactly **one commit** on the
#### Computing the correct version number
Run the following from the repo root to determine the version string to use:
**First, ensure `git` and `gh` are installed** — both are required for the version computation and for pushing changes. Install them if missing before doing anything else:
```bash
which git || apt-get install -y git
which gh || apt-get install -y gh
# Also ensure all tags are fetched so git describe works
git fetch --tags
```
Then run the following from the repo root to determine the version string to use:
```bash
currenttag=$(git describe --tags --abbrev=0 | sed 's/v//')