(Regression) tests against example datasets from the R MLCM package#23
Merged
Conversation
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.
3 tasks
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:wrangled_<...>.csvdata, which is the data as it is included in the R package, though with slightly more informative column headers.trials_<...>.csv, as it would most likely come out of the experiment (this is reverse-engineered from the wrangled data)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:
epsilonto the scale estimationpython==3.14, also as part of the CIpandas>=3.0-- these were warned about through deprecation warnings, so it's good to have tackled them. These fixes are also backwards compatible withpandas<3.0, so nothing lost there.