Add a cleanup frame.
"| `presorted_qualifiers` | When True, the qualifiers input file is already sorted in the `node1` column. | 'False' |\n",
"| `sort_extras` | Extra parameters for the sort program. The default specifies a path for temporary files. Other useful parameters include '--buffer-size' and '--parallel'. | '--parallel 24 --buffer-size 30% --temporary-directory ' + temp_folder_path |\n",
"| `use_mgzip` | When True, use the mgzip program where appropriate for faster compression. | 'True' |\n",
- "| `verbose` | When True, produce additional feedback messages. | 'True' |\n"
+ "| `verbose` | When True, produce additional feedback messages. | 'True' |\n",
+ "| `cleanup` | When True, remove temporary files at the end of processing. | 'True' |\n"
]
},
{
"presorted_qualifiers = 'False'\n",
"sort_extras = '--parallel 24 --buffer-size 30% --temporary-directory ' + temp_folder_path\n",
"use_mgzip = 'True'\n",
- "verbose = 'True'\n"
+ "verbose = 'True'\n",
+ "cleanup = 'True'\n"
]
},
{
" --filter-key node1 \\\n",
" --output-file {output_path}"
]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Clean Up If Needed\n",
+ "Remove any temporary files.\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import os\n",
+ "if presorted_claims.lower() != \"true\": \n",
+ " print('Removing the sorted claims temporary file: %s' % sorted_qualifiers_path)\n",
+ " os.remove(sorted_claims_path) \n",
+ "if presorted_qualifiers.lower() != \"true\": \n",
+ " print('Removing the sorted qualifiers temporary file: %s' % sorted_qualifiers_path)\n",
+ " os.remove(sorted_qualifiers_path)"
+ ]
}
],
"metadata": {
