The RAM module implements a driver base class also named RAM. The RAM base class performs several important functional procedures including PyFLAGR I/O, linkage and loading of the FLAGR shared library, I/O Dataframe handling, and so on. The majority of the other classes of PyFLAGR derive from this class and inherit its members and properties.
The class constructor takes as argument the eval_pts parameter that determines the elements in the aggregate list on which the evaluation measures (i.e. Precision, and nDCG) will be computed. The most important operation of the constructor is the loading of the FLAGR shared library, according to the underlying operating system. Therefore, if PyFLAGR is executed on a Linux-based system, then pyflagr/pyflagr/flagr.so is loaded; similarly, if PyFLAGR is executed on a Windows-based system, then pyflagr/pyflagr/flagr.dll is loaded. For the time being, FLAGR has not been tested on MacOS-based systems and no pre-compiled shared libraries exist for this platform.
The successful loading of the FLAGR shared/dynamic link library creates the flagr_lib connection handler. flagr_lib acts as a connector between PyFLAGR and FLAGR, making the exposed C functions of FLAGR accessible from RAM and its derived classes.
Other member functions include check_get_input() and check_get_rels_input(). These two functions perform several sanity checks on the provided input files. On the other hand, the role of get_output() is to read the output files created by FLAGR and load their content into two Pandas Dataframes. These two Dataframes are eventually returned to the user.
Implementation file
pyflagr/pyflagr/RAM.py
The following interactive block diagram depicts the architecture of PyFLAGR and its linkage to the FLAGR shared library.
