Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column type conversions #136

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

Kucharssim
Copy link
Member

fixes https://github.com/jasp-stats/INTERNAL-jasp/issues/2332

Not sure if this is really the best approach, but it does resolve the issue. I still need to check if really everything works as expected, I welcome any input.

Copy link
Contributor

@vandenman vandenman left a comment

Choose a reason for hiding this comment

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

This looks really good!

However, this is a pretty aggressive change. I wonder whether we can create an opt-in way for adding this to a module, like how we once had jaspResults: true in the QML files. Because I can imagine that many hidden issues appear when this is suddenly some R package receives a jaspScale instead of a numeric and that we need to sprinkle some jasp2r calls around.

R/readDataSet.R Outdated Show resolved Hide resolved
@vandenman

This comment was marked as outdated.

@vandenman

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@vandenman
Copy link
Contributor

vandenman commented Sep 14, 2023

/test-downstream

Automatic edit:
Running downstream tests for commit cd4614b, follow the run here.

@github-actions
Copy link

The following downstream tests for commit cd4614b failed:

Module windows-latest macOS-latest ubuntu-latest
jaspAnova
jaspDescriptives
jaspFactor
jaspFrequencies
jaspRegression
jaspTTests

The full log is available here.

@Kucharssim
Copy link
Member Author

Because I can imagine that many hidden issues appear when this is suddenly some R package receives a jaspScale instead of a numeric and that we need to sprinkle some jasp2r calls around.

I am not sure if I am overlooking a case that you have specifically in mind. But in general the code inside of modules will still run on base R types as the data is obtained using readDataSetToEnd which should return either numeric, ordinal, or factor. This whole jaspType shenanigans is used only to simulate readDataSetToEnd's behavior when run from R.

Unless of course we want to fully switch to JASP column types inside of analyses but then indeed we would need to implement this gradually because the current module code is not written for it.

@vandenman
Copy link
Contributor

vandenman commented Sep 18, 2023

/test-downstream

Automatic edit:
Running downstream tests for commit 072d585, follow the run here.

@github-actions
Copy link

The following downstream tests for commit 072d585 failed:

Module windows-latest macOS-latest ubuntu-latest
jaspAnova
jaspDescriptives
jaspFactor
jaspFrequencies
jaspRegression
jaspTTests

The full log is available here.

@vandenman
Copy link
Contributor

I am not sure if I am overlooking a case that you have specifically in mind.

Well, unless the GitHub action is doing something wrong, this PR breaks all unit tests from all modules. So my use case is, do we need to change something in the modules (or jaspTools) to make this PR not break everything? If it needs to be done in each module, I would imagine we prefer to do that incrementally.

@Kucharssim
Copy link
Member Author

I'll check what's wrong in the tests, the PR should definitely not break this.

@Kucharssim
Copy link
Member Author

Kucharssim commented Sep 18, 2023

Ah, of course. I forgot that jaspTools tries to load the dataset through implementing its own readDataSetToEnd that is found by jaspBase using getAnywhere() - a connection that I broke with this PR.

So this PR will need to be accompanied by a little change to jaspTools so that the unit tests are able to load the correct dataset - I'll make a PR for that.

Anyway, I see that some of the downstream tests did not even make it to run the tests because stringi could not be installed/loaded. I think stringi is suggested by pillar which is used for some of the pretty printing of the jaspTypes in R console, but I guess I can remove that. What do you think @vandenman?

- this should not be an issue if we encode dataset anyway but still
@shun2wang
Copy link
Contributor

shun2wang commented Sep 19, 2023

I think I once fixed this error with stringi see https://github.com/jasp-stats/INTERNAL-jasp/issues/2192, the libicu library which is dependence of R packages such as igraph on Linux I guess.

so I made: jasp-stats/jasp-actions#30

@Kucharssim
Copy link
Member Author

Kucharssim commented Sep 29, 2023

So in combination with jasp-stats/jaspTools#38 the common modules now pass their tests on my computer. I will test the rest as well just to make sure that all is really ok.*

*Unless of course we do indeed want to make this something module maintainers can opt-in if they want syntax enabled, but I still think it would be nice to be able to switch everything everywhere all at once

@vandenman
Copy link
Contributor

vandenman commented Sep 29, 2023

/test-downstream

Automatic edit:
Running downstream tests for commit 099df1b, follow the run here.

@vandenman
Copy link
Contributor

🤦‍♂️ this is not using the new jaspTools so of course all the tests fail...

@github-actions
Copy link

The following downstream tests for commit 099df1b failed:

Module windows-latest macOS-latest ubuntu-latest
jaspAnova
jaspDescriptives
jaspFactor
jaspFrequencies
jaspRegression
jaspTTests

The full log is available here.

@Kucharssim
Copy link
Member Author

Kucharssim commented Sep 29, 2023

this is not using the new jaspTools so of course all the tests fail...

yes that's why I was running the tests manually on my computer. Can we specify a specific branch/commit of jaspTools in the downstream tests, or do you want to just merge the jaspTools PR first and then run the tests here? Note that once we merge the jaspTools PR, tests will be broken without having the corresponding changes to jaspBase introduced in this PR.

@JorisGoosen JorisGoosen self-requested a review October 3, 2023 10:53
@JorisGoosen JorisGoosen force-pushed the master branch 2 times, most recently from 8b639a0 to 7bd7444 Compare March 20, 2024 14:06
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.

None yet

3 participants