Circuitscape.py icon indicating copy to clipboard operation
Circuitscape.py copied to clipboard

Add ability to read csv files for network mode

Open bmcrae opened this issue 12 years ago • 5 comments

Ideally we would auto-detect and still accommodate tab-delimited inputs, but moving to csv files with .csv extensions as standard for network inputs makes sense.

bmcrae avatar Nov 25 '13 18:11 bmcrae

Looks like this is working now, just need to add ability to recognize .csv extension to gui, correct? If so I can do that.

bmcrae avatar Dec 05 '13 21:12 bmcrae

This is not done yet. It needs changes to file reading routines in io.py to check for , character in files and pass , as the delimiter for numpy.loadtxt and numpy.savetxt. And of course the .csv extension should be added to the gui also.

I had left it for later as I was not yet decided whether and how we should handle quoted columns, comments etc. But I think it is alright to accept just plain CSV files. So the above should do fine.

tanmaykm avatar Dec 06 '13 03:12 tanmaykm

I am also not sure if this would be very useful because tab separated files can be exported from spreadsheet applications like excel quite easily. It is also good to have a well defined data format, like the current numpy readable format, instead of a generic CSV format which is rather loosely defined.

tanmaykm avatar Dec 06 '13 05:12 tanmaykm

Interesting- I had been running some tests with commas inserted, and everything ran fine. I had assumed this meant you already made the changes. Apparently the read routine is smart enough to parse these.

bmcrae avatar Dec 06 '13 05:12 bmcrae

Ok. Strange that the numpy api docs don't mention this.

tanmaykm avatar Dec 06 '13 07:12 tanmaykm