Skip to content

Commit

Permalink
Major refactor with architectural placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
konan-ai committed Jul 21, 2023
1 parent 18286bf commit c56ef3a
Show file tree
Hide file tree
Showing 46 changed files with 1,695 additions and 518 deletions.
Binary file added .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[MASTER]
init-hook='import sys; sys.path.append("lib/charsiu/src")'

Binary file added docs/.DS_Store
Binary file not shown.
6 changes: 3 additions & 3 deletions docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ if "%SPHINXBUILD%" == "" (
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
Expand All @@ -21,10 +19,12 @@ if errorlevel 9009 (
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

Expand Down
7 changes: 0 additions & 7 deletions docs/source/api.rst

This file was deleted.

43 changes: 18 additions & 25 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "Lumache"
copyright = "2021, Graziella"
author = "Graziella"
project = 'KonanAI'
copyright = '2023, Joseph Konan'
author = 'Joseph Konan'
release = '0.0.1'

release = "0.1"
version = "0.1.0"
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

# -- General configuration
extensions = []

extensions = [
"sphinx.ext.duration",
"sphinx.ext.doctest",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
]
templates_path = ['_templates']
exclude_patterns = []

intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
}
intersphinx_disabled_domains = ["std"]

templates_path = ["_templates"]

# -- Options for HTML output
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"

# -- Options for EPUB output
epub_show_urls = "footnote"
html_theme = 'alabaster'
html_static_path = ['_static']
30 changes: 14 additions & 16 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
Welcome to Lumache's documentation!
===================================

**Lumache** (/lu'make/) is a Python library for cooks and food lovers
that creates recipes mixing random ingredients.
It pulls data from the `Open Food Facts database <https://world.openfoodfacts.org/>`_
and offers a *simple* and *intuitive* API.
.. KonanAI documentation master file, created by
sphinx-quickstart on Fri Jul 21 15:07:50 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Check out the :doc:`usage` section for further information, including
how to :ref:`installation` the project.
Welcome to KonanAI's documentation!
===================================

.. note::
.. toctree::
:maxdepth: 2
:caption: Contents:

This project is under active development.

Contents
--------

.. toctree::
Indices and tables
==================

usage
api
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
34 changes: 0 additions & 34 deletions docs/source/usage.rst

This file was deleted.

31 changes: 31 additions & 0 deletions list_modules.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import os
import ast

def list_files(startpath):
for root, dirs, files in os.walk(startpath):
level = root.replace(startpath, '').count(os.sep)
indent = ' ' * 4 * (level)
print('{}{}'.format(indent, os.path.basename(root)))
subindent = ' ' * 4 * (level + 1)
for f in files:
if f.endswith('.py'):
print('{}{}'.format(subindent, f))
try:
parse_python_file(os.path.join(root, f), subindent)
except SyntaxError:
print(f"Skipping file {f} due to SyntaxError")

def parse_python_file(file, indent):
with open(file, "r") as source:
try:
tree = ast.parse(source.read())
classes = [node.name for node in ast.walk(tree) if isinstance(node,
ast.ClassDef)]
for c in classes:
print('{}{}'.format(indent + ' ', c))
except SyntaxError:
raise

# Provide the directory you want to start from
list_files('src')

24 changes: 0 additions & 24 deletions lumache.py

This file was deleted.

21 changes: 21 additions & 0 deletions print_imports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import os
import re

def find_imports(file):
with open(file, 'r') as f:
lines = f.readlines()

# Patterns for import statements
import_patterns = [r'^import .+', r'^from .+ import .+']

for line in lines:
for pattern in import_patterns:
if re.match(pattern, line.strip()):
print(line.strip())

# Walk the directory
for root, dirs, files in os.walk('src'):
for file in files:
if file.endswith('.py'):
find_imports(os.path.join(root, file))

8 changes: 0 additions & 8 deletions pyproject.toml

This file was deleted.

53 changes: 53 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from setuptools import setup, find_packages

setup(
name='konanai',
version='0.0.1',
description='''Konanai is a comprehensive Python package providing functionality for the analysis and
modeling of speech, enabling acoustic, phonetic, and linguistic processing, alignment, visualization, and
estimation, enhanced with an assortment of external utilities, including various UMAP models, audio feature
extraction tools, and forced alignment methods.''',
author='Joseph Konan',
author_email='[email protected]',
url='https://github.com/KonanAI-LLC/konanai',
packages=find_packages(where='src'),
package_dir={
"": "src",
"Charsiu": "src/konanai/externals/lib/charsiu/src"
},
install_requires=[
'tensorflow',
'torch',
'torchaudio',
'numpy',
'matplotlib',
'scikit-learn',
'umap-learn',
'pandas',
'opensmile',
'transformers',
'soundfile',
'librosa',
'argparse',
'tqdm',
'datasets',
'g2p_en',
'jiwer',
'praatio',
'scipy',
'nltk',
'g2pM',
'typing-extensions>=3.6.6,<4.6.0' # Add this line
],
python_requires='>=3.10',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
)

Binary file added src/.DS_Store
Binary file not shown.
Binary file added src/konanai/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions src/konanai/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

5 changes: 5 additions & 0 deletions src/konanai/domains/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .time import Time, Waveform
from .time_frequency import Spectrogram, PowerSpectrogram
from .linguistic import LinguisticUnit, Phoneme, Word
from .time_linguistic import Alignment, PhonemeAlignment, WordAlignment
from .representation import DataHandler, Embedding, DecisionBoundary, Plot
Loading

0 comments on commit c56ef3a

Please sign in to comment.