Skip to content

Commit

Permalink
Implemented function to list data files
Browse files Browse the repository at this point in the history
Update function to list data files

Follow Style Guidelines

Add doc for listing files
  • Loading branch information
CyberDrudge authored and bryanwweber committed Nov 2, 2019
1 parent a5b28ba commit 65f7b16
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions interfaces/cython/cantera/data/__init__.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 65f7b16

Please sign in to comment.