| 173 | scale_df.to_excel(writer, sheet_name="Scales", index=False) |
| 174 | |
| 175 | def draw(self): |
| 176 | graph = self.get_dot_graph() |
| 177 | with tempfile.TemporaryDirectory() as tmp_dir: |
| 178 | temp_directory = f"{tmp_dir}/outputs" |
| 179 | graph.render( |
| 180 | self.filename, |
| 181 | directory=temp_directory, |
| 182 | format="svg", |
| 183 | cleanup=not self.dot_string, |
| 184 | ) |
| 185 | source_file = os.path.join(temp_directory, f"{self.filename}.svg") |
| 186 | destination_file = os.path.join(self.directory, f"{self.filename}.svg") |
| 187 | shutil.move(source_file, destination_file) |
| 188 | if self.dot_string: |
| 189 | dot_file = os.path.join(temp_directory, f"{self.filename}") |
| 190 | dot_dest_file = os.path.join(self.directory, f"{self.filename}.dot") |
| 191 | shutil.move(dot_file, dot_dest_file) |
| 192 | |
| 193 | |
| 194 | class QnnTool: |