Skip to content

Commit

Permalink
Made project structure and files PyPi compatible. Changed install ins…
Browse files Browse the repository at this point in the history
…tructions to install using pyproject.toml. Removed requirements.txt. Removed setup.py.
  • Loading branch information
jaakkopasanen committed Oct 30, 2022
1 parent a041598 commit 59f68ba
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 20 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
9 changes: 0 additions & 9 deletions requirements.txt

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions autoeq/__main__.py → src/autoeq/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
5 changes: 2 additions & 3 deletions autoeq/autoeq.py → src/autoeq/batch_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
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, \
DEFAULT_F_RES, DEFAULT_BASS_BOOST_GAIN, DEFAULT_BASS_BOOST_FC, \
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")

Expand Down
2 changes: 1 addition & 1 deletion autoeq/peq.py → src/autoeq/peq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_autoeq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 59f68ba

Please sign in to comment.