As the title says, when casting some csv file into an untyped matrix, it sometimes is converted into a matrix of bool instead of the normal matrix of string.
In addition to this, the operator type_of says the variable is a matrix<string> but the content is clearly booleans and if we try affect that matrix into a real matrix<string> the linter gives us a warning that they are not the same type and the first one contains booleans.
If we force the casting to a type matrix<string> directly then everything works as expected.
This seems to happen only with the csv_file constructor with 4 parameters (file, separator, type and header)
To Reproduce
Steps to reproduce the behavior:
Run this model:
model mat
experiment a {
init {
file f <- csv_file('test.csv',",",string,false);
matrix m <- matrix(f);
write type_of(m);
matrix m2 <- m;
write m;
write matrix<string>(f);
write matrix<string>(m);
}
}
3. The content of the csv file doesn't matter
5. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Additional context**
This used to work as expected in 1.8.1.
Describe the bug
As the title says, when casting some csv file into an untyped matrix, it sometimes is converted into a matrix of bool instead of the normal matrix of string.
In addition to this, the operator
type_of
says the variable is amatrix<string>
but the content is clearly booleans and if we try affect that matrix into a realmatrix<string>
the linter gives us a warning that they are not the same type and the first one contains booleans.If we force the casting to a type
matrix<string>
directly then everything works as expected.This seems to happen only with the
csv_file
constructor with 4 parameters (file, separator, type and header)To Reproduce Steps to reproduce the behavior:
experiment a { init { file f <- csv_file('test.csv',",",string,false); matrix m <- matrix(f); write type_of(m); matrix m2 <- m;
}