Skip to content

Commit

Permalink
[Python] Update cantera.data module
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Aug 8, 2022
1 parent ee1ad0b commit 8e17679
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
1 change: 1 addition & 0 deletions interfaces/cython/cantera/__init__.py
Expand Up @@ -7,6 +7,7 @@
from .liquidvapor import *
from .onedim import *
from .utils import *
from .data import *
import cantera.interrupts # Helps with standalone packaging (PyInstaller etc.)

import os
Expand Down
25 changes: 25 additions & 0 deletions interfaces/cython/cantera/data.py
@@ -0,0 +1,25 @@
# This file is part of Cantera. See License.txt in the top-level directory or
# at https://cantera.org/license.txt for license and copyright information.

from pathlib import Path
from ._utils import get_data_directories, add_directory


def list_data_files(ext=".yaml"):
"""
Lists input data files.
:param ext:
Extension of files to be displayed.
:return:
List of input data files.
"""
data_files = []
for folder in get_data_directories():
here = Path(folder)
if here.is_dir():
files = [x.name for x in here.iterdir() if x.name.endswith(ext)]
data_files.extend(files)
data_files = list(set(data_files))
data_files.sort()
return data_files
15 changes: 0 additions & 15 deletions interfaces/cython/cantera/data/__init__.py

This file was deleted.

4 changes: 1 addition & 3 deletions interfaces/cython/setup.cfg.in
Expand Up @@ -46,14 +46,12 @@ install_requires =
python_requires = >=@py_min_ver_str@
packages =
cantera
cantera.data

[options.package_data]
cantera.data = *.*, */*.*
# The module extension needs to be here since we don't want setuptools to compile
# the extension, so there are no ``source`` files in the setup.py ``extension`` and
# we have to treat the module as package data.
cantera = *.pxd, *@module_ext@, test/*.txt, examples/*.txt
cantera = *.pxd, *@module_ext@, test/*.txt, examples/*.txt, data/*.*

[options.extras_require]
hdf5 = h5py
Expand Down

0 comments on commit 8e17679

Please sign in to comment.