senior-knights / course-schedulizer

📝 Create semester schedules without stress
https://senior-knights.github.io/course-schedulizer/
MIT License
10 stars 4 forks source link

Consider reimplementation of data import/export #266

Open rpruim opened 1 year ago

rpruim commented 1 year ago

The current CSV export is done by writing text. This seems brittle, potentially error prone, and hard to maintain.

I think it would be nicer to have a function that converts the internal representation of the schedule to a standard "data frame like" form and then to use a standard function to export as CSV. I'm assuming something like this must exist in javascript, but I haven't explored. Ideally, this intermediate representation could be transformed to do things like reorder rows and/or columns, filter out part of the schedule, etc.

I have to look at the import code more carefully, but it seems overly complicated with so many call back functions. It feels like it would be cleaner to just read in the raw CSV as is, and then apply transformations to that data structure.

Again I'm imposing my workflow from other contexts (R mostly) where what I'm proposing makes sense. I'm less familiar with standard javascript tools for these operations.

It would also be nice if we could apply some of these operations outside of the app for testing and experimenting.

In any case, it would be good to give this some thought prior to working on data import/export for Workday.