From 65f7b16f01a7848f000c4be4d9c424ba9e9c68ec Mon Sep 17 00:00:00 2001 From: CyberDrudge Date: Thu, 17 Jan 2019 00:35:27 +0530 Subject: [PATCH] Implemented function to list data files Update function to list data files Follow Style Guidelines Add doc for listing files --- interfaces/cython/cantera/data/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/interfaces/cython/cantera/data/__init__.py b/interfaces/cython/cantera/data/__init__.py index e69de29bb..1c56cfaff 100644 --- a/interfaces/cython/cantera/data/__init__.py +++ b/interfaces/cython/cantera/data/__init__.py @@ -0,0 +1,15 @@ +from pathlib import Path + + +def list_data_files(ext=''): + """ + Lists input data files. + + :param ext: + Extension of files to be displayed. + :return: + List of input data files. + """ + here = Path(__file__).parent + data_files = [x.name for x in here.iterdir() if not x.name.startswith('__') and x.name.endswith(ext)] + return data_files