Skip to content

(Regression) tests against example datasets from the R MLCM package#23

Merged
guillermoaguilar merged 7 commits into
mainfrom
test/example_sets
Jun 3, 2026
Merged

(Regression) tests against example datasets from the R MLCM package#23
guillermoaguilar merged 7 commits into
mainfrom
test/example_sets

Conversation

@JorisVincent

Copy link
Copy Markdown
Collaborator

The R {{MLCM}} package comes with several example datasets -- primarily the ones on Bumpiness and Glossiness, from Ho, Land and Maloney (2008).

Example (testing) datasets

Here, these datasets are included as part of the test-suite in tests/example_datasets/. Each dataset comes with:

  • the wrangled_<...>.csv data, which is the data as it is included in the R package, though with slightly more informative column headers.
  • an "unwrangled" raw trials_<...>.csv, as it would most likely come out of the experiment (this is reverse-engineered from the wrangled data)
  • a test-suite test_<...>.py, which contains the actual tests. This also has the hardcoded the resulting perceptual scales that are produced by running the MLCM scale estimation in R. These are hardcoded, because those values should be unaffected by any changes we make in this Python package.

Additional changes

Along the way, a few other fixes have been made:

  • clarify some of the other individual test cases, to try and create a more intuitite test suite
  • test the passing of epsilon to the scale estimation
  • we now also test against python==3.14, also as part of the CI
  • fixed some issues caused by the new pandas>=3.0 -- these were warned about through deprecation warnings, so it's good to have tackled them. These fixes are also backwards compatible with pandas<3.0, so nothing lost there.

Setup specific paths for finding R, sometimes necessary.
For each trial response, a comment that explains the reasoning of that row.
Also swap the dimensions around: this clears up the resulting scales a bit. Now, the numerical dimA is on the rows, and separate columns (scales) for the ordinal/categorical dimB.
Changes to how strings are handled in pandas, as well as whether `replace` downcasts.
@guillermoaguilar

guillermoaguilar commented Jun 3, 2026

Copy link
Copy Markdown
Member

I reviewed it, alll good. I added some comments on top of conftest.py, to explain what are those fixtures for, as it was unclear to me the first time I saw it. I took the liberity to push those changes directly.

@guillermoaguilar guillermoaguilar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, merging now.

@guillermoaguilar
guillermoaguilar merged commit 0baa481 into main Jun 3, 2026
12 checks passed
@JorisVincent
JorisVincent deleted the test/example_sets branch June 4, 2026 09:53
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.

2 participants