Commit b62ac956 authored by Ibrahim Ahmed's avatar Ibrahim Ahmed
Browse files

src/controller.py: Actions are written using the csv module;

Previously put_control_action() took an array as an argument but only write the first element to a file. This is good for 1 element action arrays. Now using the csv module tow write 1 row as the action array means in the future actions can be multi dimensional
parent 37a0088b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -145,7 +145,9 @@ def get_settings(parsed_args: Namespace, section: str='DEFAULT', write_settings=
def put_control_action(action: np.ndarray, **settings):
    output = settings['output']
    with open(output, 'w') as f:
        f.write(str(action[0]))
        writer = csv.writer(f)
        writer.writerow(action)
        # f.write(str(action[0]))