diff --git a/LICENSE b/LICENSE index 20f60e77429..6bd650197b0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Jaakko Pasanen +Copyright (c) 2018-2022 Jaakko Pasanen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index b80a067db54..b76249a0edf 100644 --- a/README.md +++ b/README.md @@ -326,7 +326,7 @@ python -m pip install -U pip ``` - Install required packages ```shell -python -m pip install -U -r requirements.txt +python -m pip install -U -e . ``` - Verify installation. If everything went well, you'll see the list of command line parameters AutoEq accepts. ```shell diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000000..f90275f8ce3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,35 @@ +[build-system] +requires = [ + "hatchling", +] +build-backend = "hatchling.build" + +[project] +name = "autoeq" +version = "2.0.0" +authors = [ + { name="Jaakko Pasanen", email="jaakko.o.pasanen@gmail.com" }, +] +description = "Automatic headphone equalizer config generator" +readme = "README.md" +requires-python = ">=3.7" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +dependencies = [ + 'Pillow~=9.2.0', + 'matplotlib~=3.5.2', + 'pandas~=1.4.3', + 'scipy~=1.8.1', + 'numpy~=1.23.1', + 'tabulate~=0.8.10', + 'soundfile~=0.10.2', + 'pyyaml~=6.0', + 'tqdm~=4.64.0', +] + +[project.urls] +"Homepage" = "https://github.com/jaakkopasanen/AutoEq" +"Bug Tracker" = "https://github.com/jaakkopasanen/AutoEq/issues" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index eafd4184a67..00000000000 --- a/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -Pillow~=9.2.0 -matplotlib~=3.5.2 -pandas~=1.4.3 -scipy~=1.8.1 -numpy~=1.23.1 -tabulate~=0.8.10 -soundfile~=0.10.2 -pyyaml~=6.0 -tqdm~=4.64.0 diff --git a/autoeq/__init__.py b/src/autoeq/__init__.py similarity index 100% rename from autoeq/__init__.py rename to src/autoeq/__init__.py diff --git a/autoeq/__main__.py b/src/autoeq/__main__.py similarity index 98% rename from autoeq/__main__.py rename to src/autoeq/__main__.py index d8841efd7a7..bc04dd92a31 100644 --- a/autoeq/__main__.py +++ b/src/autoeq/__main__.py @@ -3,10 +3,10 @@ import multiprocessing import warnings -from .constants import DEFAULT_MAX_GAIN, DEFAULT_TREBLE_F_LOWER, DEFAULT_TREBLE_F_UPPER, \ +from autoeq.constants import DEFAULT_MAX_GAIN, DEFAULT_TREBLE_F_LOWER, DEFAULT_TREBLE_F_UPPER, \ DEFAULT_TREBLE_GAIN_K, DEFAULT_FS, DEFAULT_BIT_DEPTH, DEFAULT_PHASE, DEFAULT_F_RES, DEFAULT_BASS_BOOST_FC, \ DEFAULT_BASS_BOOST_Q, DEFAULT_SMOOTHING_WINDOW_SIZE, DEFAULT_TREBLE_SMOOTHING_WINDOW_SIZE -from .autoeq import batch_processing +from autoeq.batch_processing import batch_processing def cli_args(): diff --git a/autoeq/autoeq.py b/src/autoeq/batch_processing.py similarity index 98% rename from autoeq/autoeq.py rename to src/autoeq/batch_processing.py index 51aac6110ee..d5fd60a14a4 100644 --- a/autoeq/autoeq.py +++ b/src/autoeq/batch_processing.py @@ -4,16 +4,15 @@ from glob import glob import multiprocessing import soundfile as sf -from time import time import numpy as np import tqdm import yaml -from .constants import DEFAULT_MAX_GAIN, DEFAULT_TREBLE_F_LOWER, DEFAULT_TREBLE_F_UPPER, \ +from autoeq.constants import DEFAULT_MAX_GAIN, DEFAULT_TREBLE_F_LOWER, DEFAULT_TREBLE_F_UPPER, \ DEFAULT_TREBLE_GAIN_K, DEFAULT_FS, DEFAULT_BIT_DEPTH, DEFAULT_PHASE, DEFAULT_F_RES, DEFAULT_BASS_BOOST_GAIN, \ DEFAULT_BASS_BOOST_FC, DEFAULT_BASS_BOOST_Q, DEFAULT_SMOOTHING_WINDOW_SIZE, \ DEFAULT_TREBLE_SMOOTHING_WINDOW_SIZE, PEQ_CONFIGS -from .frequency_response import FrequencyResponse +from autoeq.frequency_response import FrequencyResponse def batch_processing(input_dir=None, output_dir=None, new_only=False, standardize_input=False, compensation=None, diff --git a/autoeq/constants.py b/src/autoeq/constants.py similarity index 100% rename from autoeq/constants.py rename to src/autoeq/constants.py diff --git a/autoeq/frequency_response.py b/src/autoeq/frequency_response.py similarity index 99% rename from autoeq/frequency_response.py rename to src/autoeq/frequency_response.py index 9b3cdfadd9f..214923da88c 100644 --- a/autoeq/frequency_response.py +++ b/src/autoeq/frequency_response.py @@ -18,7 +18,7 @@ from PIL import Image import re import warnings -from .constants import DEFAULT_F_MIN, DEFAULT_F_MAX, DEFAULT_STEP, DEFAULT_MAX_GAIN, DEFAULT_TREBLE_F_LOWER, \ +from autoeq.constants import DEFAULT_F_MIN, DEFAULT_F_MAX, DEFAULT_STEP, DEFAULT_MAX_GAIN, DEFAULT_TREBLE_F_LOWER, \ DEFAULT_TREBLE_F_UPPER, DEFAULT_TREBLE_GAIN_K, DEFAULT_SMOOTHING_WINDOW_SIZE, \ DEFAULT_SMOOTHING_ITERATIONS, DEFAULT_TREBLE_SMOOTHING_F_LOWER, DEFAULT_TREBLE_SMOOTHING_F_UPPER, \ DEFAULT_TREBLE_SMOOTHING_WINDOW_SIZE, DEFAULT_TREBLE_SMOOTHING_ITERATIONS, DEFAULT_TILT, DEFAULT_FS, \ @@ -26,7 +26,7 @@ DEFAULT_BASS_BOOST_Q, DEFAULT_GRAPHIC_EQ_STEP, HARMAN_INEAR_PREFENCE_FREQUENCIES, \ HARMAN_ONEAR_PREFERENCE_FREQUENCIES, PREAMP_HEADROOM, DEFAULT_MAX_SLOPE, \ DEFAULT_BIQUAD_OPTIMIZATION_F_STEP -from .peq import PEQ, LowShelf +from autoeq.peq import PEQ, LowShelf warnings.filterwarnings("ignore", message="Values in x were outside bounds during a minimize step, clipping to bounds") diff --git a/autoeq/peq.py b/src/autoeq/peq.py similarity index 99% rename from autoeq/peq.py rename to src/autoeq/peq.py index 640e55ef2ca..e37a9f45e24 100644 --- a/autoeq/peq.py +++ b/src/autoeq/peq.py @@ -7,7 +7,7 @@ from scipy.signal import find_peaks from tabulate import tabulate -from .constants import DEFAULT_SHELF_FILTER_MIN_FC, DEFAULT_SHELF_FILTER_MAX_FC, DEFAULT_SHELF_FILTER_MIN_Q, \ +from autoeq.constants import DEFAULT_SHELF_FILTER_MIN_FC, DEFAULT_SHELF_FILTER_MAX_FC, DEFAULT_SHELF_FILTER_MIN_Q, \ DEFAULT_SHELF_FILTER_MAX_Q, DEFAULT_SHELF_FILTER_MIN_GAIN, DEFAULT_SHELF_FILTER_MAX_GAIN, \ DEFAULT_PEAKING_FILTER_MIN_FC, DEFAULT_PEAKING_FILTER_MAX_FC, DEFAULT_PEAKING_FILTER_MIN_Q, \ DEFAULT_PEAKING_FILTER_MAX_Q, DEFAULT_PEAKING_FILTER_MIN_GAIN, DEFAULT_PEAKING_FILTER_MAX_GAIN, \ diff --git a/setup.py b/tests/__init__.py similarity index 100% rename from setup.py rename to tests/__init__.py diff --git a/tests/test_autoeq.py b/tests/test_autoeq.py index 44e7d63578b..530b122439b 100644 --- a/tests/test_autoeq.py +++ b/tests/test_autoeq.py @@ -6,7 +6,7 @@ import unittest import pandas as pd from autoeq.frequency_response import FrequencyResponse -from autoeq.autoeq import batch_processing +from autoeq.batch_processing import batch_processing from autoeq.constants import DEFAULT_MAX_GAIN, DEFAULT_TREBLE_F_LOWER, DEFAULT_TREBLE_F_UPPER, DEFAULT_TREBLE_GAIN_K, \ DEFAULT_BIT_DEPTH, DEFAULT_F_RES, DEFAULT_BASS_BOOST_GAIN, DEFAULT_BASS_BOOST_FC, DEFAULT_BASS_BOOST_Q, \ DEFAULT_SMOOTHING_WINDOW_SIZE, DEFAULT_TREBLE_SMOOTHING_WINDOW_SIZE, PEQ_CONFIGS