Skip to content
Snippets Groups Projects

Sc209/dropdown menus

Merged Ghost User requested to merge SC209/dropdown-menus into review-window
1 file
+ 2
35
Compare changes
  • Side-by-side
  • Inline
+ 2
35
@@ -45,12 +45,6 @@ class FileReader (ABC):
words = Sentence(ws)
return words
def path(self):
return self._path
def path(self, pth):
self._path = pth
class CSVReader(FileReader):
@@ -104,10 +98,6 @@ class FileWriter(ABC):
def write(self, path, results):
pass
@abstractmethod
def _participant_path(self, number):
pass
class CSVWriter(FileWriter):
@@ -133,18 +123,8 @@ class CSVWriter(FileWriter):
writer.writerows(sc)
writer.writerow(info)
def write_multiple(self, save_dir, analyzed_results):
"""Write multiple CSV files.
Args:
save_dir: Directory paths to save locations
analyzed_results: Analysis results to write to files
"""
for key, results in analyzed_results.items():
path = self._participant_path(save_dir, key)
self.write(path, results)
def write_frame(self, path, results, result_type):
@staticmethod
def write_frame(path, results, result_type):
"""
Write results of given type to appropriate file.
@@ -158,16 +138,3 @@ class CSVWriter(FileWriter):
results.sort_values(by=['participant', 'video', 'condition'],
inplace=True)
results.to_csv(path + '/' + result_type)
def _participant_path(self, dir, key):
"""Create a path for the appropriate participant.
Args:
dir: Directory of the save location
key: Participant key
Returns:
pth: Path to participant save location
"""
pth = dir + '/' + key
return pth
Loading