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

dsc2 doesn't like R NULL objects #25

Closed
dcgerard opened this issue Jul 6, 2016 · 2 comments
Closed

dsc2 doesn't like R NULL objects #25

dcgerard opened this issue Jul 6, 2016 · 2 comments

Comments

@dcgerard
Copy link
Member

dcgerard commented Jul 6, 2016

File

dsc_null_error.zip

Code

dsc_null_error$ dsc exec settings.dsc
INFO: Constructing DSC from settings.dsc ...
INFO: DSC exported to settings.html
INFO: Building output database dsc_result.rds ...
INFO: Elapsed time 0.402 seconds.
ERROR: 'list' object has no attribute 'shape'
ERROR: 'list' object has no attribute 'shape'
@gaow
Copy link
Member

gaow commented Jul 6, 2016

This is tricky. This patch b994d88 currently ignores NULL results. But later today I'll try to convert NULL to NA first and throw an error message when I detect problematic dimensions when combing multiple data.

Same as #24 The problem is again in building the final data base with Python. Python / Numpy does not have NULL or NA types. All it has is NaN. So:

NA

For NA data in R I convert them to NaN when generating the query database.

NULL

NULL in return may result in undesirable behavior. For example in one data set:

res <- c(1, 1)

you end up with a vector of 1, 1. But if the return in another data set:

res <- c(NULL, 1)

then you end up with a scale of 1 because NULL will be ignored. The right way to do this for the 2nd data set is

res <-c(NA, 1)

So that DSC2 can properly put together results from different parameter combinations of the same step into a table format.

But DSC2 has no control over user's behavior. Later today I'll change the DSC2 code such that it converts NULL to NA when the return is NULL; and it will throw an error message when down the line it runs into an issue trying to make a table out of different data-sets, for example, it will complain about NA being different in length compared to 1 1.

@gaow
Copy link
Member

gaow commented Jul 7, 2016

Implemented as proposed above. Let me know if you dislike the behavior @dcgerard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants