Skip to content

Commit

Permalink
Pre-computed results.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaakkopasanen committed Apr 11, 2021
1 parent 510c99b commit 9928b8e
Show file tree
Hide file tree
Showing 1,198 changed files with 74,349 additions and 7,213 deletions.
8 changes: 8 additions & 0 deletions measurements/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ measurements
A990Z R2.txt
...
```
Sometimes the Zip files don't contain all of the measurement files. This is a bug in Google Drive.

Crawler Jupyter Notebook requires IPyWidgets and the extension
```bash
Expand Down Expand Up @@ -73,6 +74,13 @@ python -m measurements.oratory1990.oratory1990_crawler
python -m measurements.referenceaudioanalyzer.reference_audio_analyzer_crawler
python -m measurements.rtings.rtings_crawler
```
If you just downloaded the Crinacle's raw data and run the crawler like this, you need to create averaged measurements
too.
```bash
python -m measurements.average --input_dir="measurements/crinacle/data/onear/GRAS 43AG-7"
python -m measurements.average --input_dir="measurements/crinacle/data/onear/Ears-711"
python -m measurements.average --input_dir="measurements/crinacle/data/inear"
```

## Updating Measurements and Results
1. Remove measurements that have updates
Expand Down
10 changes: 5 additions & 5 deletions measurements/average.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ def average_measurements(input_dir=None, output_dir=None):

models = {}
for file_path in glob(os.path.join(input_dir, '**', '*.csv'), recursive=True):
model = os.path.split(file_path)[-1]
model = os.path.split(file_path)[-1].replace('.csv', '')
if not re.search(MOD_REGEX, model, re.IGNORECASE):
continue
norm = re.sub(MOD_REGEX, '', model, 0, flags=re.IGNORECASE)
try:
models[norm].append(model)
except KeyError as err:
models[norm] = [model]
if norm not in models:
models[norm] = []
models[norm].append(model)

for norm, origs in models.items():
if len(origs) > 1:
Expand All @@ -46,6 +45,7 @@ def average_measurements(input_dir=None, output_dir=None):
os.makedirs(d, exist_ok=True)
file_path = os.path.join(d, norm + '.csv')
fr.write_to_csv(file_path)
print(f'Saved {norm} to {file_path}')


def create_cli():
Expand Down
5 changes: 3 additions & 2 deletions measurements/crawl.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "c57b79d9-a96a-4d12-9317-626ffdcf0130",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -55,11 +55,12 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"id": "2f64338f-95e1-4102-b3bd-cc1c9b9b9077",
"metadata": {},
"outputs": [],
"source": [
"average_measurements(input_dir=ROOT_PATH.joinpath('measurements', 'crinacle', 'data', 'onear', 'Ears-711'))\n",
"average_measurements(input_dir=ROOT_PATH.joinpath('measurements', 'crinacle', 'data', 'onear', 'GRAS 43AG-7'))\n",
"average_measurements(input_dir=ROOT_PATH.joinpath('measurements', 'crinacle', 'data', 'inear'))"
]
Expand Down
32 changes: 18 additions & 14 deletions measurements/crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,37 +198,41 @@ def search(self, name):
url = f'https://google.com/search?q={quoted}&tbm=isch'
webbrowser.open(url)

def get_name_proposals(self, false_name, n=4, normalize_digits=False, threshold=60):
def get_name_proposals(self, false_name, n=4, normalize_digits=False, normalize_extras=False, threshold=60):
"""Prompts manufacturer, model and form from the user
Args:
false_name: Name as it exists in the measurement source
n: Number of proposals to return
normalize_digits: Normalize all digits to zeros before calculating fuzzy string matching score
normalize_extras: Remove extra details in the parentheses
threshold: Score threshold
Returns:
NameItem
"""
false_name = self.intermediate_name(false_name)
def fuzzy(fn, a, b):
a = a.lower()
b = b.lower()
if normalize_digits:
a = re.sub(r'\d', '0', a).strip()
b = re.sub(r'\d', '0', b).strip()
if normalize_extras:
a = re.sub(r'\(.+\)$', '', a).strip()
b = re.sub(r'\(.+\)$', '', b).strip()
return fn(a, b)

manufacturer, manufacturer_match = self.manufacturers.find(false_name)
if not manufacturer:
return NameIndex([])
false_model = re.sub(re.escape(manufacturer_match), '', false_name, flags=re.IGNORECASE).strip()
# Select only the items with the same manufacturer
models = self.name_proposals[self.name_proposals.manufacturer == manufacturer]
if normalize_digits:
partial_ratios = [fuzz.partial_ratio(
re.sub(r'\d', '0', model.lower()),
re.sub(r'\d', '0', false_model.lower())
) for model in models.model.tolist()]
ratios = [fuzz.ratio(
re.sub(r'\d', '0', model.lower()),
re.sub(r'\d', '0', false_model.lower())
) for model in models.model.tolist()]
else:
partial_ratios = [fuzz.partial_ratio(model.lower(), false_model.lower()) for model in models.model.tolist()]
ratios = [fuzz.ratio(model.lower(), false_model.lower()) for model in models.model.tolist()]

# Calculate ratios
partial_ratios = [fuzzy(fuzz.partial_ratio, model, false_model) for model in models.model.tolist()]
ratios = [fuzzy(fuzz.ratio, model, false_model) for model in models.model.tolist()]

models = models.assign(partial_ratio=partial_ratios)
models = models.assign(ratio=ratios)
models = models[models.partial_ratio >= threshold]
Expand Down
5 changes: 3 additions & 2 deletions measurements/crinacle/crinacle_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,9 @@ def process_new(self, prompt=True):
if manufacturer:
model = re.sub(re.escape(manufacturer_match), '', intermediate_name, flags=re.IGNORECASE)
model = model.strip()
name_proposals = self.get_name_proposals(model)
similar_names = self.get_name_proposals(model, n=6, normalize_digits=True, threshold=0)
name_proposals = self.get_name_proposals(intermediate_name)
similar_names = self.get_name_proposals(
intermediate_name, n=6, normalize_digits=True, normalize_extras=True, threshold=0)
similar_names = [item.true_name for item in similar_names.items]
else:
unknown_manufacturers.append(intermediate_name)
Expand Down
30 changes: 27 additions & 3 deletions measurements/crinacle/name_index.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ A8000 Final Audio A8000 inear
A900X Audio-Technica ATH-A900X onear
A91 Fidue A91 Sirius inear
A990Z Audio-Technica ATH-A990Z onear
AB-1266 Phi Abyss AB-1266 Phi onear
AB-1266 Phi CC Abyss AB-1266 Phi CC onear
AB-1266 Phi CC Lite Abyss AB-1266 Phi CC Lite onear
Ace ignore
Ace 00 Aroma Audio Ace (off-off) inear
Expand All @@ -98,6 +100,7 @@ Aeolus ZMF Aeolus onear
Aeolus (perf Universe suede) ZMF Aeolus (universal perforated suede earpads) onear
Aeolus UP ZMF Aeolus (universal perforated earpads) onear
Aeon 2 Closed Dan Clark Audio Aeon 2 Closed onear
Aeon 2 Noire Dan Clark Audio Aeon 2 Noire onear
Aeon 2 Open Dan Clark Audio Aeon 2 Open onear
Aeon Flow Closed (Medium damping) Dan Clark Audio Aeon Flow Closed (white filter with one notch) onear
Aeon Flow Closed (Minimum damping) Dan Clark Audio Aeon Flow Closed (black filter) onear
Expand Down Expand Up @@ -304,6 +307,8 @@ DH298 SATOLEX Tubomi DH298-A1Bk inear
DH302 SATOLEX Tubomi DH302-A1Bs inear
DH310 SATOLEX Tubomi DH310-A1SS inear
Diana JH Audio Diana inear
Diana Phi Abyss Diana Phi onear
Diana V2 Abyss Diana V2 onear
Dio Elysian Annihilator (sample 1) inear
DIY violator73 violator73 DIY 16 BA inear
Django Noble Audio Django inear
Expand Down Expand Up @@ -352,6 +357,7 @@ Duke C Venture Electronics Duke (CIEM) inear
Dulce Bass Noble Audio Dulce Bass inear
Dunmer Pro Tipsy Dunmer Pro inear
Duoza Zero Audio Duoza ZH-DWX10 inear
Dusk Moondrop x Crinacle Blessing2 Dusk inear
Dusk S2 Moondrop x Crinacle Blessing2 Dusk inear
E10 KZ E10 inear
E1000 Final Audio E1000 inear
Expand All @@ -362,6 +368,7 @@ E2000 S2 Final Audio E2000 (sample 2) inear
E25 Raycon E25 inear
E3000 S2 Final Audio E3000 (sample 2) inear
E3000 S3 Final Audio E3000 (sample 3) inear
E4 Anthem Five E4 (CIEM) inear
E4000 Final Audio E4000 (sample 1) inear
E4000 S2 Final Audio E4000 (sample 2) inear
E5000 Final Audio E5000 (sample 1) inear
Expand Down Expand Up @@ -547,6 +554,8 @@ Gemini Bass qdc Gemini (bass) inear
GK3 Geek Wold GK3 inear
GL20 Gold Planar GL20 inear
GL20 EQ ignore
GL2000 (double) (leather) Gold Planar GL2000 double-sided (leather earpads) onear
GL2000 (double) (perf hybrid) Gold Planar GL2000 double-sided (perforated hybrid earpads) onear
GL2000 (leather) Gold Planar GL2000 (leather earpads) onear
GL2000 (perf hybrid) Gold Planar GL2000 (perforated hybrid earpads) onear
GL850 Gold Planar GL850 onear
Expand Down Expand Up @@ -614,6 +623,7 @@ HE560 V1 S2 HIFIMAN HE560 V1 (sample 2) onear
HE5se HIFIMAN HE5se onear
HE5SE HIFIMAN HE5se onear
HE6 (6-screw) (Velour) HIFIMAN HE6 (6-screw, velour earpads) onear
HE6se HIFIMAN HE6se onear
Heaven 4 Final Audio Heaven 4 inear
Heaven 7 Final Audio Heaven 7 inear
Heaven 8 Final Audio Heaven 8 inear
Expand Down Expand Up @@ -667,8 +677,8 @@ IE800 Sennheiser IE 800 inear
IE800S Sennheiser IE 800 S inear
IE80S Sennheiser IE 80 S (min) inear
IE80S Half Sennheiser IE 80 S (half) inear
IE80S max Sennheiser IE 80 S (max) inear
IE80S Max Sennheiser IE 80 S (max) inear
IE80S max Sennheiser IE 80 S (max) inear
IEX1 Audio-Technica ATH-IEX1 inear
iGE Grado iGE inear
IM01 Audio-Technica ATH-IM01 inear
Expand All @@ -691,6 +701,7 @@ IT01S iBasso IT01S inear
IT03 iBasso IT03 inear
IT03w iBasso IT03w inear
IT04 iBasso IT04 inear
Jade II HIFIMAN Jade II onear
Janus ddHiFi E2020A Janus inear
Jasper AUNE Jasper inear
Jazz Jomo Audio Jazz inear
Expand Down Expand Up @@ -797,6 +808,7 @@ LCD-2C Closed Audeze LCD-2 Closed Back onear
LCD-3 Audeze LCD-3 onear
LCD-3 Dekoni Val ignore
LCD-4 Audeze LCD-4 onear
LCD-GX Audeze LCD-GX onear
LCD-i3 Audeze LCD-i3 inear
LCD-i3 BT Cipher Audeze LCD-i3 (Cipher bluetooth) inear
LCD-i4 Audeze LCD-i4 inear
Expand Down Expand Up @@ -995,8 +1007,8 @@ Nanna Kinera Nanna inear
Nanna 2.0 Kinera Nanna 2.0 inear
NDH 20 Neumann NDH20 onear
NDH20 Neumann NDH20 onear
Nemesis Empire Ears Nemesis inear
nemesis Empire Ears Nemesis inear
Nemesis Empire Ears Nemesis inear
Neo SeeAudio Neo inear
Neptune qdc Neptune inear
nerva X HYLA Nerva X inear
Expand Down Expand Up @@ -1066,6 +1078,7 @@ Piston 1More 1MORE Piston inear
Planamic MEE Audio Planamic inear
Plus Massdrop Plus Universal IEM (sample 1) inear
Plus S2 Massdrop Plus Universal IEM (sample 2) inear
PM-3 Oppo PM3 onear
Pola Shozy x AAW Pola (sample 1) inear
Pola S2 Shozy x AAW Pola inear
Polaris Campfire Audio Polaris (sample 1) inear
Expand Down Expand Up @@ -1173,6 +1186,8 @@ S8Pro Fearless Audio S8Pro inear
S8Z Fearless Audio S8Z inear
SA03 1Custom SA03 inear
SA05 1Custom SA05 inear
SA6 DUNU SA6 (default mode) inear
SA6 On DUNU SA6 (atmospheric Immersion mode) inear
Sage Noble Audio Sage inear
Salsa Jomo Audio Salsa inear
Samba Jomo Audio Samba inear
Expand Down Expand Up @@ -1286,6 +1301,7 @@ SRH440 Shure SRH440 onear
SRH840 Shure SRH840 (sample 1) onear
SRH840 S2 Shure SRH840 (sample 2) onear
SS-10 Sansui SS10 onear
SSP Moondrop SSP inear
SSR Moondrop SSR inear
Star Aroma Audio Star inear
Starfield Moondrop Starfield inear
Expand All @@ -1300,6 +1316,7 @@ Stylish 1MORE Stylish inear
Sultan Noble Audio Sultan inear
Sundara HIFIMAN Sundara onear
Superdarts Atomic Floyd SuperDarts inear
Susvara HIFIMAN Susvara onear
SV Grey ignore
Symphony Effect Audio Symphony inear
T1 Tin HiFi T1 inear
Expand Down Expand Up @@ -1344,6 +1361,11 @@ TF10 Ultimate Ears TripleFi 10 inear
TG334 FitEar TG334 (sample 3) inear
TG334 S1 FitEar TG334 (sample 1) inear
TG334 S2 FitEar TG334 (sample 2) inear
TH500 (worn pads) Fostex TH500 (worn earpads) onear
TH610 Fostex TH610 onear
TH7 Fostex TH7 onear
TH900 Fostex TH900 onear
TH909 Fostex TH909 onear
The Hemp Headphone Grado The Hemp Headphone onear
Thirteen 6 Fender Thirteen 6 inear
Thror Bog Oak Kennerton Thror Bog Oak onear
Expand All @@ -1358,6 +1380,7 @@ TM2 Fostex TM2 inear
Tone Free LG Tone Free inear
Topaz Filterless Yinyoo Topaz (no filter) inear
TP10 Tripowin TP10 inear
TR-80 Fostex TR-80 onear
Track Air Plus Libratone Track Air Plus inear
Treble HYLA TE-5T inear
TRI i3 TRI i3 inear
Expand Down Expand Up @@ -1429,11 +1452,12 @@ UERR Ultimate Ears Reference Remastered inear
UM Pro 10 Westone UM Pro 10 inear
UM Pro 20 Westone UM Pro 20 inear
UM Pro 30 Westone UM Pro 30 inear
UM Pro 50 Westone UM Pro 50 inear
UM pro 50 Westone UM Pro 50 inear
UM Pro 50 Westone UM Pro 50 inear
Uranus qdc Uranus inear
Utopia Focal Utopia (sample 1) onear
Utopia S2 Focal Utopia (sample 2) onear
Utopia S3 Focal Utopia (sample 3) onear
V14 00 ThieAudio Voyager 14 (00 setting) inear
V14 02 ThieAudio Voyager 14 (02 setting) inear
V14 10 ThieAudio Voyager 14 (10 setting) inear
Expand Down
Loading

0 comments on commit 9928b8e

Please sign in to comment.