devosoft / Empirical

A library of tools for scientific software development, with emphasis on also being able to build web interfaces using Emscripten.
Other
86 stars 38 forks source link

Clean up emp::DataFile #111

Open mercere99 opened 7 years ago

mercere99 commented 7 years ago

Currently DataFile will collect data from DataNode objects and print it as columns in a file.

Several improvements are needed:

emilydolson commented 6 years ago

What is the thinking behind the timing functions going in World_file rather than in DataFile? On the one hand I see the point that not all DataFiles need to worry about timing. But on the other hand, I think that there are a lot of situations outside of evolution where timing would be relevant (e.g. physics). Also, having the timing functions be in their own class makes inheritance messy if you want to write a class that inherits from DataFile but has timing functions.

The reason I ask is that I'm currently putting together a function to output the data necessary to make a Muller plot. This requires printing out multiple rows per update (one per active taxon). While this situation seems common enough that it's useful to include in the library, it seems rare enough that it shouldn't just be part of DataFile. So inheriting from DataFile seems like the right way to do it. But then if it inherits from World_file too, that's the dreaded multiple inheritance diamond and I suspect we don't want to do that.