diff --git a/.github/workflows/build-publish-to-pypi.yml b/.github/workflows/build-publish-to-pypi.yml index fa0c5e7..a919f9a 100644 --- a/.github/workflows/build-publish-to-pypi.yml +++ b/.github/workflows/build-publish-to-pypi.yml @@ -29,13 +29,13 @@ jobs: with: python-version: 3.x - - name: Install and upgrade build dependencies + - name: Install the build frontend run: | - python3 -m pip install --upgrade pip setuptools wheel + python3 -m pip install --upgrade pip build - name: Build a binary wheel and a source tarball for PyTTa distribution package run: | - python3 setup.py sdist bdist_wheel + python3 -m build - name: Publish Pytta distribution package to PyPI uses: pypa/gh-action-pypi-publish@master diff --git a/README.md b/README.md index e55b6f6..a4fa31e 100644 --- a/README.md +++ b/README.md @@ -1,127 +1,133 @@ -

- - PyTTa License - - -PyTTa Python supported versions - - - PyTTa PyPI version - - -PyTTa PyPI downloads - - - PyTTa build workflow status - -

- - -## PyTTa (Python in Technical Acoustics) - -The project began as an effort to create audio, acoustics, and vibration data acquiring and analysis toolbox to a free cost level, high-end results, combining the passion for programming with the expertise in Acoustics and Vibration of the Acoustics Engineers from the Federal University of Santa Maria (Southern Brazil). - -We are students, teachers, engineers, passionate and inquiring people, on the first steps of a journey throughout the Python path to bring Acoustics to the Open Seas, Open Sources, and Open World! - -### Usage - -We strongly recommend using Anaconda Python Distribution, as it integrates an IDE (Spyder) and lots of packages over which PyTTa is based on as Numpy, Scipy, Matplotlib, and PyPI (pip). The latter is used to install Sounddevice and PyTTa itself. - -The toolbox offers some main classes intended to do measurements (Rec, PlayRec, and FRFMeasurement), handle streaming functionalities (Monitor and Streaming), handle signals/processed data (SignalObj and Analysis), filter (OctFilter), communicate with some hardware (LJU3EI1050), and also new features containing an object-oriented implementation. - -There are some assistant functions intended to manipulate and visualize signals and analyses stored as SignalObj and Analysis objects. These functions are called from the toolbox's top level. - -The top-level modules offer tools that receive as arguments and return PyTTa objects. Utilities comprise signal synthesis (pytta.generate), room acoustics parameters calculation (pytta.rooms), and some other calculations according to standards (pytta.iso3741). - -The sub-packages contains some expansion of the toolbox, as general utilities (pytta.utils) and applications built from the toolbox's basic functionalities (pytta.roomir). - -PyTTa is now a multi-paradigm toolbox, which may change in the future. We aim from this point on to be more Pythonic, and therefore, more objected-oriented. - -### Documentation - -This package aims to be an easy interface between acousticians and vibrational engineers in the use of Python for study, engineering, or any other ends that it may suit. From import to each function and attribute we wrote a little documentation that may be useful for understanding everything available, and what is just a means to an end. - -To begin, one can try: - - >>> import pytta - >>> pytta.list_devices() - >>> pytta.default() - -This set of commands will print the available audio I/O devices and the -default parameters as they are on the default class object. - -To read everything ready for use on the package, and assuming the use of Spyder IDE, one can press "ctrl+i" with the cursor in front of the module, submodule, class, methods, or function names; this will open the help menu with the documentation of the respective item. - - >>> pytta| - >>> pytta.properties| - >>> pytta.generate| - >>> pytta.functions| - >>> pytta.classes| - >>> pytta.apps| - >>> pytta.utils| - -The | represents the cursor position to press "ctrl+i" to use the Spyder help -widget. - -Inside each submodule, the user will find instructions on the available tools, -and how to access them. - -The documentation is also available at Read The Docs: -https://pytta.readthedocs.io/ - -### Dependencies - -- Numpy; -- Scipy; -- Matplotlib; -- Sounddevice; -- Soundfile; -- H5py; and -- Numba. - -### Installation - -To install the last version compiled to pip, which can be slightly behind of -development branch, do: - - >>> pip install pytta - -If you want to check the most up to date beta version, please get the -development branch source code, clone our repository to your local git, or -even install it from pip, as follows: - - >>> pip install git+https://github.com/pyttamaster/pytta@development - -### Contributing as a user - -Using the toolbox, you are already contributing. If you experience any bugs, have any suggestions or ideas, have anything to say about it, please consider sending us a message. - -### Contributing as a developer - -Please read our [CodingGuidelines](https://github.com/PyTTAmaster/PyTTa/blob/development/CodingGuidelines) and [Contributing](https://github.com/PyTTAmaster/PyTTa/blob/development/Contributing.md) files. - -### Contact - -Contact us at pytta@eac.ufsm.br . - -### Acknowledge - -If you use PyTTA in your research, work, paper, or university assignment, acknowledge and cite us if possible. - - - PyTTa – Python in Technical Acoustics (GitHub). https://github.com/pyttamaster/pytta, 2020. - - W. D’A. Fonseca, J. V. Paes, M. Lazarin, M. V. Reis, P. H. Mareze, and E. Brandão. *PyTTa: Open source toolbox for acoustic measurement and signal processing*. In 23 International Congress on Acoustics - ICA 2019, pages 1–8, Aachen, Germany, 2019. doi: [10.18154/RWTH-CONV-239980](http://doi.org/10.18154/RWTH-CONV-239980). - - Research Gate Publication Page https://www.researchgate.net/project/PyTTa-Python-in-Technical-Acoustics - -BibTex file [PyTTa.bib](https://github.com/PyTTAmaster/PyTTa/blob/development/docs/PyTTa.bib) - -## More information - - - -[Acoustical Engineering UFSM Website](http://www.eac.ufsm.br) - -[UFSM Website](https://www.ufsm.br) - -[Download Spyder (with Anaconda)](https://www.anaconda.com/download/) - -[Or Miniconda](https://conda.io/en/latest/miniconda) +

+ + PyTTa License + + +PyTTa Python supported versions + + + PyTTa PyPI version + + +PyTTa PyPI downloads + + + PyTTa build workflow status + +

+ + +## PyTTa (Python in Technical Acoustics) + +The project began as an effort to create audio, acoustics, and vibration data acquiring and analysis toolbox to a free cost level, high-end results, combining the passion for programming with the expertise in Acoustics and Vibration of the Acoustics Engineers from the Federal University of Santa Maria (Southern Brazil). + +We are students, teachers, engineers, passionate and inquiring people, on the first steps of a journey throughout the Python path to bring Acoustics to the Open Seas, Open Sources, and Open World! + +### Usage + +We strongly recommend using Anaconda Python Distribution, as it integrates an IDE (Spyder) and lots of packages over which PyTTa is based on as Numpy, Scipy, Matplotlib, and PyPI (pip). The latter is used to install Sounddevice and PyTTa itself. + +The toolbox offers some main classes intended to do measurements (Rec, PlayRec, and FRFMeasurement), handle streaming functionalities (Monitor and Streaming), handle signals/processed data (SignalObj and Analysis), filter (OctFilter), communicate with some hardware (LJU3EI1050), and also new features containing an object-oriented implementation. + +There are some assistant functions intended to manipulate and visualize signals and analyses stored as SignalObj and Analysis objects. These functions are called from the toolbox's top level. + +The top-level modules offer tools that receive as arguments and return PyTTa objects. Utilities comprise signal synthesis (pytta.generate), room acoustics parameters calculation (pytta.rooms), and some other calculations according to standards (pytta.iso3741). + +The sub-packages contains some expansion of the toolbox, as general utilities (pytta.utils) and applications built from the toolbox's basic functionalities (pytta.roomir). + +PyTTa is now a multi-paradigm toolbox, which may change in the future. We aim from this point on to be more Pythonic, and therefore, more objected-oriented. + +### Documentation + +This package aims to be an easy interface between acousticians and vibrational engineers in the use of Python for study, engineering, or any other ends that it may suit. From import to each function and attribute we wrote a little documentation that may be useful for understanding everything available, and what is just a means to an end. + +To begin, one can try: + + >>> import pytta + >>> pytta.list_devices() + >>> pytta.default() + +This set of commands will print the available audio I/O devices and the +default parameters as they are on the default class object. + +To read everything ready for use on the package, and assuming the use of Spyder IDE, one can press "ctrl+i" with the cursor in front of the module, submodule, class, methods, or function names; this will open the help menu with the documentation of the respective item. + + >>> pytta| + >>> pytta.properties| + >>> pytta.generate| + >>> pytta.functions| + >>> pytta.classes| + >>> pytta.apps| + >>> pytta.utils| + +The | represents the cursor position to press "ctrl+i" to use the Spyder help +widget. + +Inside each submodule, the user will find instructions on the available tools, +and how to access them. + +The documentation is also available at Read The Docs: +https://pytta.readthedocs.io/ + +### Dependencies + +PyTTa needs Python 3.10 or later, and installs with it NumPy, SciPy, +Matplotlib, Sounddevice, H5py, Numba and Plotly. Sounddevice needs the +PortAudio library, which its wheels for Windows and macOS include; on Linux, +install it with the system package manager (e.g. `sudo apt install +libportaudio2`). + +`pytta.plot_waterfall` needs the extra `waterfall` (more-itertools, and +kaleido to save the figure as an image). + +### Installation + +To install the last version published on PyPI, which can be behind the +development branch: + + pip install pytta + +To install the development branch: + + pip install "pytta @ git+https://github.com/pyttamaster/pytta@development" + +From a clone of the repository, with the optional dependencies: + + pip install -e ".[waterfall,test]" + +With conda, `conda env create -f environment.yml` creates the environment +`pytta-env` with PyTTa installed from the clone. + +### Contributing as a user + +Using the toolbox, you are already contributing. If you experience any bugs, have any suggestions or ideas, have anything to say about it, please consider sending us a message. + +### Contributing as a developer + +Please read our [CodingGuidelines](https://github.com/PyTTAmaster/PyTTa/blob/development/CodingGuidelines) and [Contributing](https://github.com/PyTTAmaster/PyTTa/blob/development/Contributing.md) files. + +### Contact + +Contact us at pytta@eac.ufsm.br . + +### Acknowledge + +If you use PyTTA in your research, work, paper, or university assignment, acknowledge and cite us if possible. + + - PyTTa – Python in Technical Acoustics (GitHub). https://github.com/pyttamaster/pytta, 2020. + - W. D’A. Fonseca, J. V. Paes, M. Lazarin, M. V. Reis, P. H. Mareze, and E. Brandão. *PyTTa: Open source toolbox for acoustic measurement and signal processing*. In 23 International Congress on Acoustics - ICA 2019, pages 1–8, Aachen, Germany, 2019. doi: [10.18154/RWTH-CONV-239980](http://doi.org/10.18154/RWTH-CONV-239980). + - Research Gate Publication Page https://www.researchgate.net/project/PyTTa-Python-in-Technical-Acoustics + +BibTex file [PyTTa.bib](https://github.com/PyTTAmaster/PyTTa/blob/development/docs/PyTTa.bib) + +## More information + + + +[Acoustical Engineering UFSM Website](http://www.eac.ufsm.br) + +[UFSM Website](https://www.ufsm.br) + +[Download Spyder (with Anaconda)](https://www.anaconda.com/download/) + +[Or Miniconda](https://conda.io/en/latest/miniconda) diff --git a/environment.yml b/environment.yml index f17867a..4a113b5 100644 --- a/environment.yml +++ b/environment.yml @@ -1,74 +1,17 @@ +# Conda environment for PyTTa: conda env create -f environment.yml name: pytta-env channels: - - defaults + - conda-forge dependencies: - - _libgcc_mutex=0.1=main - - blas=1.0=mkl - - ca-certificates=2020.1.1=0 - - certifi=2020.4.5.1=py37_0 - - cycler=0.10.0=py37_0 - - dbus=1.13.14=hb2f20db_0 - - expat=2.2.6=he6710b0_0 - - fontconfig=2.13.0=h9420a91_0 - - freetype=2.9.1=h8a8886c_1 - - glib=2.63.1=h3eb4bd4_1 - - gst-plugins-base=1.14.0=hbbd80ab_1 - - gstreamer=1.14.0=hb31296c_0 - - h5py=2.10.0=py37h7918eee_0 - - hdf5=1.10.4=hb1b8bf9_0 - - icu=58.2=he6710b0_3 - - intel-openmp=2020.1=217 - - jpeg=9b=h024ee3a_2 - - kiwisolver=1.2.0=py37hfd86e86_0 - - ld_impl_linux-64=2.33.1=h53a641e_7 - - libedit=3.1.20181209=hc058e9b_0 - - libffi=3.3=he6710b0_1 - - libgcc-ng=9.1.0=hdf63c60_0 - - libgfortran-ng=7.3.0=hdf63c60_0 - - libpng=1.6.37=hbc83047_0 - - libstdcxx-ng=9.1.0=hdf63c60_0 - - libuuid=1.0.3=h1bed415_2 - - libxcb=1.13=h1bed415_1 - - libxml2=2.9.9=hea5a465_1 - - llvmlite=0.32.1=py37hd408876_0 - - matplotlib=3.1.3=py37_0 - - matplotlib-base=3.1.3=py37hef1b27d_0 - - mkl=2020.1=217 - - mkl-service=2.3.0=py37he904b0f_0 - - mkl_fft=1.0.15=py37ha843d7b_0 - - mkl_random=1.1.0=py37hd6b4f25_0 - - ncurses=6.2=he6710b0_1 - - numba=0.49.1=py37h0573a6f_0 - - numpy=1.18.1=py37h4f9e942_0 - - numpy-base=1.18.1=py37hde5b4d6_1 - - openssl=1.1.1g=h7b6447c_0 - - pcre=8.43=he6710b0_0 - - pip=20.0.2=py37_3 - - portaudio=19.6.0=h7b6447c_4 - - pyparsing=2.4.7=py_0 - - pyqt=5.9.2=py37h05f1152_2 - - python=3.7.7=hcff3b4d_5 - - python-dateutil=2.8.1=py_0 - - qt=5.9.7=h5867ecd_1 - - readline=8.0=h7b6447c_0 - - scipy=1.4.1=py37h0b6359f_0 - - setuptools=46.4.0=py37_0 - - sip=4.19.8=py37hf484d3e_0 - - six=1.14.0=py37_0 - - sqlite=3.31.1=h62c20be_1 - - tbb=2020.0=hfd86e86_0 - - tk=8.6.8=hbc83047_0 - - tornado=6.0.4=py37h7b6447c_1 - - wheel=0.34.2=py37_0 - - xz=5.2.5=h7b6447c_0 - - zlib=1.2.11=h7b6447c_3 + - python>=3.10 + - numpy + - scipy + - matplotlib + - h5py + - numba + - plotly + - portaudio + - pip - pip: - - cffi==1.14.0 - - pycparser==2.20 - - sounddevice==0.3.15 - - soundfile==0.10.3.post1 - - plotly - - kaleido - - more-itertools -prefix: /home/joaovitor/miniconda3/envs/pytta-env - + - sounddevice + - -e . diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0d25f1f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,42 @@ +[build-system] +requires = ["setuptools>=77"] +build-backend = "setuptools.build_meta" + +[project] +name = "PyTTa" +version = "0.1.2a" +description = "Signal processing tools for acoustics and vibrations in python, development package." +readme = "README.md" +license = "MIT" +authors = [{name = "João Vitor Paes, Matheus Lazarin, Marcos Reis", email = "pytta@eac.ufsm.br"}] +requires-python = ">=3.10" +# Lower bounds: the first releases with wheels for Python 3.10. +dependencies = [ + "numpy>=1.21", + "scipy>=1.7", + "matplotlib>=3.5", + "sounddevice>=0.4", + "h5py>=3.6", + "numba>=0.55", + "plotly>=5", +] +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering", +] + +[project.optional-dependencies] +waterfall = ["more-itertools", "kaleido"] # plot_waterfall and its image export +test = ["pytest"] +docs = ["sphinx", "sphinx_rtd_theme"] + +[project.urls] +Homepage = "https://github.com/PyTTAmaster/PyTTa" +Documentation = "https://pytta.readthedocs.io/" + +[tool.setuptools.packages.find] +include = ["pytta*"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index f01f3c9..0000000 --- a/requirements.txt +++ /dev/null @@ -1,11 +0,0 @@ -cffi==1.14.0 -h5py==2.10.0 -numba==0.46.0 -numpy==1.17.4 -scipy==1.3.3 -portaudio -sounddevice==0.3.14 -SoundFile==0.10.3.post1 -plotly -kaleido -more-itertools diff --git a/setup.py b/setup.py deleted file mode 100644 index b30310d..0000000 --- a/setup.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -""" -PyTTa setup file -================= - -Authors: - João Vitor Gutkoski Paes, joao.paes@eac.ufsm.br - Matheus Lazarin Alberto, matheus.lazarin@eac.ufsm.br - -""" - -from setuptools import setup -from glob import glob - -with open("README.md", "r") as f: - long_description = f.read() - -settings = { - 'name': 'PyTTa', - 'version': '0.1.2a', - 'description': 'Signal processing tools for acoustics and vibrations in ' + - 'python, development package.', - 'long_description': long_description, - 'long_description_content_type': 'text/markdown', - 'url': 'http://github.com/PyTTAmaster/PyTTa', - 'author': 'João Vitor Paes, Matheus Lazarin, Marcos Reis', - 'author_email': 'pytta@eac.ufsm.br', - 'license': 'MIT', - 'install_requires': ['numpy', 'scipy', 'matplotlib', 'sounddevice', 'soundfile', - 'h5py', 'numba', 'plotly', 'kaleido', 'more-itertools'], - 'packages': ['pytta', 'pytta.classes', 'pytta.apps', 'pytta.utils'], - # 'package_dir': {'classes': 'pytta'}, - # 'package_data': {'pytta': ['examples/*.py', 'examples/RIS/*.mat']} - # 'data_files': [('examples', glob('examples/*'))], - 'classifiers': [ - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", ], - 'python_requires': '>=3.6', -} - -setup(**settings)