Closed akielaries closed 1 year ago
Tagging @sidsbrmnn for review
@akielaries Thank you for your contribution (to your own project). I have reviewed it and have only found one thing astray.
In modules/core/datatable.hpp/.cpp there is a member function that is implemented within the app instead of being only prototypes in the hpp and implemented in the cpp. The rest of the member function are implemented in the cpp. I would recommend moving the implementation to the cpp file.
Your contribution looks good otherwise! Have a great day!
P.S. I believe my team mates will will be adding their own comments soon to follow!
@kgimlay With C++ template related methods I've found it easier to just leave the implementation in the header file just like with a template C++ class. Otherwise, to my knowledge, I'd have to explicitly instantiate the type of each function. I've just found it as a way to get around having to declare each type of the function at the bottom of an implementation file.
@akielaries this makes sense.
We looked a little more at your code and the only things we can see potential issues with are:
Otherwise, this looks great!
As mentioned in #29, this patch implements the early stages of the openMTPK DataTable class creating 3 specific types.
The DataTable class currently houses 4 functions 2 of which serve as the core of the class,
csv_read
&display
.The
csv_read
function parses CSV files storing them as an std::pair of std::vectors of std::string type. This defaults each value to a string type therefore spawning the creation of conversion methods.display
is a template method that takes in pairs of vectors of any type.Since the default datatype of the
csv_read
functions is a string, methods to convert columns containing numerical types to integers (64-bit) or doubles (varying width, 64-bit on my machine) were put in place. Thedisplay
function does not retain the information of column headers meaning if columns are dropped/lost the DataTable object will not keep the column headers.Moved
struct
dir tocore
and added/modules/core/datatable.cpp
toCMakeLists.txt
for installationFixes #29