Circuitscape.py
Circuitscape.py copied to clipboard
Add ability to read csv files for network mode
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.
Looks like this is working now, just need to add ability to recognize .csv extension to gui, correct? If so I can do that.
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.
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.
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.
Ok. Strange that the numpy api docs don't mention this.