gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
304 stars 99 forks source link

Saving a matrix in a CSV doesn't discriminate line separators from column separators #3615

Closed ScriBanana closed 1 year ago

ScriBanana commented 1 year ago

Hi,

This exact same issue was raised in #2216 and apparently fixed, but it appears I still get the problem in 1.8.2 and I can't re-open an issue. Feel free to merge or anything if I did wrong.

Describe the bug Saving a matrix to a csv file using save returns a file where all values are separated by ,, despite the matrix containing several rows.

To Reproduce Run the following :

model mat2CSV

global
{
    matrix m <- matrix([[1,2,3],[2,3,4],[3,4,5]]);
    init {
        write m;
        save m to: "./m.csv" type:csv rewrite:true header:false;
    }
}
experiment test;

To obtain the following csv :

1,2,3,2,3,4,3,4,5

Expected behavior A CSV file with different separators for columns and lines, e.g. :

1,2,3;2,3,4;3,4,5

Specs:

AlexisDrogoul commented 1 year ago

You're right; it is supposed to have been fixed in https://github.com/gama-platform/gama/commit/cd2b4a03182718be8ed4d3d2d90551eec4383806.

I will check. Thanks for reporting.