From a9b36359659d317afe5095672e8b8497c0c33719 Mon Sep 17 00:00:00 2001
From: David Hendriks <davidhendriks93@gmail.com>
Date: Fri, 29 Nov 2019 22:45:34 +0000
Subject: [PATCH] small commit; will continue this after the workshop

---
 Makefile                         |   2 +-
 binarycpython/utils/functions.py |  37 +++++++++
 testing_doxygen/ding.h           | 127 -------------------------------
 testing_doxygen/test.h           |  61 ---------------
 4 files changed, 38 insertions(+), 189 deletions(-)
 delete mode 100644 testing_doxygen/ding.h
 delete mode 100644 testing_doxygen/test.h

diff --git a/Makefile b/Makefile
index 36703ebb1..c538a849d 100644
--- a/Makefile
+++ b/Makefile
@@ -51,7 +51,7 @@ PY_OPTIONS 			:= build_ext --inplace
 all:
 	$(CC) -DBINARY_C=$(BINARY_C) $(CFLAGS) $(INCDIRS) $(C_SRC) -o $(OBJECTS) $(OBJ_FLAGS) $(LIBS) 
 	$(CC) -DBINARY_C=$(BINARY_C) $(SO_FLAGS) -o $(SO_NAME) $(OBJECTS)
-	$(PY_EXEC) $(PY_SETUP) $(PY_OPTIONS) 
+	$(PY_EXEC) $(PY_SETUP) $(PY_OPTIONS)
 
 test:	
 	@echo OBJECTS: $(OBJECTS)
diff --git a/binarycpython/utils/functions.py b/binarycpython/utils/functions.py
index 539bcf831..d7fd123a3 100644
--- a/binarycpython/utils/functions.py
+++ b/binarycpython/utils/functions.py
@@ -194,3 +194,40 @@ def parse_output(output, selected_header):
             final_values_dict[key].append(value_dict[key])
 
     return final_values_dict
+
+
+
+def load_logfile(logfile):
+    with open(logfile, 'r') as f:
+        logfile_data = f.readlines()
+
+    time_list = []
+    m1_list = []
+    m2_list = []
+    k1_list = []
+    k2_list = []
+    sep_list = []
+    ecc_list = []
+    rel_r1_list = []
+    rel_r2_list = []
+    event_list = []
+
+    random_seed = logfile_data[0].split()[-2]
+    random_count = logfile_data[0].split()[-1]
+    probability = logfile_data[-1].split()
+
+    for line in logfile_data[1:-1]:
+        split_line = line.split()
+
+        time_list.append(split_line[0])
+        m1_list.append(split_line[1])
+        m2_list.append(split_line[2])
+        k1_list.append(split_line[3])
+        k2_list.append(split_line[4])
+        sep_list.append(split_line[5])
+        ecc_list.append(split_line[6])
+        rel_r1_list.append(split_line[7])
+        rel_r2_list.append(split_line[8])
+        event_list.append(' '.join(split_line[9:]))
+
+    print(event_list)
\ No newline at end of file
diff --git a/testing_doxygen/ding.h b/testing_doxygen/ding.h
deleted file mode 100644
index 77fc7410a..000000000
--- a/testing_doxygen/ding.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
- * Copyright (C) 2012 by Matteo Franchin                                    *
- *                                                                          *
- * This file is part of Box.                                                *
- *                                                                          *
- *   Box is free software: you can redistribute it and/or modify it         *
- *   under the terms of the GNU Lesser General Public License as published  *
- *   by the Free Software Foundation, either version 3 of the License, or   *
- *   (at your option) any later version.                                    *
- *                                                                          *
- *   Box is distributed in the hope that it will be useful,                 *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
- *   GNU Lesser General Public License for more details.                    *
- *                                                                          *
- *   You should have received a copy of the GNU Lesser General Public       *
- *   License along with Box.  If not, see <http://www.gnu.org/licenses/>.   *
- ****************************************************************************/
-
-/**
- * @file doxygen_c.h
- * @author My Self
- * @date 9 Sep 2012
- * @brief File containing example of doxygen usage for quick reference.
- *
- * Here typically goes a more extensive explanation of what the header
- * defines. Doxygens tags are words preceeded by either a backslash @\
- * or by an at symbol @@.
- * @see http://www.stack.nl/~dimitri/doxygen/docblocks.html
- * @see http://www.stack.nl/~dimitri/doxygen/commands.html
- */
-
-#ifndef _BOX_PROTOTYPES_DOXYGEN_H
-#  define _BOX_PROTOTYPES_DOXYGEN_H
-
-#  include <systemheader1.h>
-#  include <systemheader2.h>
-
-#  include <box/header1.h>
-#  include <box/header2.h>
-
-#  include "local_header1.h"
-#  include "local_header2.h"
-
-/**
- * @brief Use brief, otherwise the index won't have a brief explanation.
- *
- * Detailed explanation.
- */
-typedef enum BoxEnum_enum {
-  BOXENUM_FIRST,  /**< Some documentation for first. */
-  BOXENUM_SECOND, /**< Some documentation for second. */
-  BOXENUM_ETC     /**< Etc. */
-} BoxEnum;
-
-/**
- * @brief Use brief, otherwise the index won't have a brief explanation.
- *
- * Detailed explanation.
- */
-typedef struct BoxStruct_struct {
-  int a;    /**< Some documentation for the member BoxStruct#a. */
-  int b;    /**< Some documentation for the member BoxStruct#b. */
-  double c; /**< Etc. */
-} BoxStruct;
-
-/**
- * @brief Example showing how to document a function with Doxygen.
- *
- * Description of what the function does. This part may refer to the parameters
- * of the function, like @p param1 or @p param2. A word of code can also be
- * inserted like @c this which is equivalent to <tt>this</tt> and can be useful
- * to say that the function returns a @c void or an @c int. If you want to have
- * more than one word in typewriter font, then just use @<tt@>.
- * We can also include text verbatim,
- * @verbatim like this@endverbatim
- * Sometimes it is also convenient to include an example of usage:
- * @code
- * BoxStruct *out = Box_The_Function_Name(param1, param2);
- * printf("something...\n");
- * @endcode
- * Or,
- * @code{.py}
- * pyval = python_func(arg1, arg2)
- * print pyval
- * @endcode
- * when the language is not the one used in the current source file (but
- * <b>be careful</b> as this may be supported only by recent versions
- * of Doxygen). By the way, <b>this is how you write bold text</b> or,
- * if it is just one word, then you can just do @b this.
- * @param param1 Description of the first parameter of the function.
- * @param param2 The second one, which follows @p param1.
- * @return Describe what the function returns.
- * @see Box_The_Second_Function
- * @see Box_The_Last_One
- * @see http://website/
- * @note Something to note.
- * @warning Warning.
- */
-BOXEXPORT BoxStruct *
-Box_The_Function_Name(BoxParamType1 param1, BoxParamType2 param2 /*, ...*/);
-
-/**
- * @brief A simple stub function to show how links do work.
- *
- * Links are generated automatically for webpages (like http://www.google.co.uk)
- * and for structures, like BoxStruct_struct. For typedef-ed types use
- * #BoxStruct.
- * For functions, automatic links are generated when the parenthesis () follow
- * the name of the function, like Box_The_Function_Name().
- * Alternatively, you can use #Box_The_Function_Name.
- * @return @c NULL is always returned.
- */
-BOXEXPORT void *
-Box_The_Second_Function(void);
-
-/**
- * Brief can be omitted. If you configure Doxygen with
- * <tt>JAVADOC_AUTOBRIEF=YES</tt>, then the first Line of the comment is used
- * instead. In this function this would be as if
- * @verbatim @brief Brief can be omitted. @endverbatim
- * was used instead.
- */
-BOXEXPORT void
-Box_The_Last_One(void);
-
-#endif /* _BOX_PROTOTYPES_DOXYGEN_H */
diff --git a/testing_doxygen/test.h b/testing_doxygen/test.h
deleted file mode 100644
index 65e4e70ca..000000000
--- a/testing_doxygen/test.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#pragma once
-#ifndef BINARY_C_PYTHON_H
-#define BINARY_C_PYTHON_H
-
-/**
- * A structure to represent 3d vectors 
- */
-typedef struct
-{
-  /*@{*/
-  double x ; /**< the x coordinate */
-  double y ; /**< the y coordinate */
-  double z ; /**< the z coordinate */
-  /*@}*/
-  /**
-   * @name group 2
-   */
-  /*@{*/
-  char * name       ; /**< the name of the point */
-  int    namelength ; /**< the size of the point name */
-  /*@}*/
-} point3d ;
-
-
-/*
- * Include binary_C's API
- */
-//#include "binary_c_API.h"
-//#include "binary_c_API_prototypes.h"
-
-/* Binary_c's python API prototypes */
-/**
- * Function to run a binary 
- */
-int run_binary (char * argstring,
-                char ** const outstring,
-                char ** const errorstring);
-
-                // size_t * const nbytes);
-
-// int run_binary_with_logfile (char * argstring,
-//                 char ** const outstring,
-//                 char ** const errorstring,
-//                 size_t * const nbytes);
-
-// int run_binary_custom_logging(char * argstring,
-//                long int func_memaddr,
-//                char ** const buffer,
-//                char ** const error_buffer,
-//                size_t * const nbytes);
-
-// int return_arglines(char ** const outstring,
-//                 char ** const errorstring,  
-//                 size_t * const nbytes);
-
-/* C macros */
-#define BINARY_C_APITEST_VERSION 0.1
-#define APIprint(...) APIprintf(__VA_ARGS__);
-#define NO_OUTPUT
-
-#endif // BINARY_C_C_PYTHON_H
-- 
GitLab