Skip to content

Commit 23e8046

Browse files
authored
Merge pull request #241 from pierreaubert/develop
Add global optimiser
2 parents f781934 + 5cd6c76 commit 23e8046

File tree

1,950 files changed

+128382
-26422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,950 files changed

+128382
-26422
lines changed

.deepsource.toml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version = 1
22

3-
test_patterns = ["test/**"]
3+
test_patterns = ["tests/*.py"]
44

55
[[analyzers]]
66
name = "python"
@@ -18,9 +18,20 @@ name = "javascript"
1818
enabled = true
1919

2020
[analyzers.meta]
21-
environment = ["jquery"]
22-
style_guide = "google"
21+
environment = ["browser"]
22+
style_guide = "standard"
23+
module_system = "es-modules"
24+
dialect = "flow"
25+
2326

2427
[[analyzers]]
2528
name = "shell"
2629
enabled = true
30+
31+
[[analyzers]]
32+
name = "secrets"
33+
enabled = true
34+
35+
[[analyzers]]
36+
name = "cxx"
37+
enabled = true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ TAGS
1313
*_large.png
1414
docs
1515
tmp
16+
extracted
1617
logs
1718
asrbook.aux
1819
asrbook.bbl
@@ -45,3 +46,5 @@ cache.*.h5
4546
.sass-cache
4647
build
4748
*.so
49+
bin
50+
coverage.xml

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ repos:
2424
rev: v1.0.5
2525
hooks:
2626
- id: csslint
27+
- repo: https://github.com/charliermarsh/ruff-pre-commit
28+
# Ruff version.
29+
rev: 'v0.0.263'
30+
hooks:
31+
- id: ruff

book/asrbook.tex

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
\date{2020}
1616
\maketitle
1717

18-
% \tableofcontents
19-
% \listoffigures
20-
2118
\pagebreak
2219

2320
\chapter{Introduction}

book/generate_book.py

100644100755
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33
# A library to display spinorama charts
44
#
5-
# Copyright (C) 2020-21 Pierre Aubert pierreaubert(at)yahoo(dot)fr
5+
# Copyright (C) 2020-2023 Pierre Aubert pierre(at)spinorama(dot)org
66
#
77
# This program is free software: you can redistribute it and/or modify
88
# it under the terms of the GNU General Public License as published by
@@ -36,16 +36,12 @@
3636

3737
if __name__ == "__main__":
3838
args = docopt(__doc__, version="generate_book.py version 0.1", options_first=True)
39-
40-
# logging.basicConfig(format='%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s',
41-
# datefmt='%Y-%m-%d:%H:%M:%S')
4239
if args["--log-level"] is not None:
4340
level = args["--log-level"]
4441
if level in ["INFO", "DEBUG", "WARNING", "ERROR"]:
4542
logging.basicConfig(level=level)
46-
47-
# load all metadata from generated json file
4843
json_filename = "../docs/assets/metadata.json"
44+
4945
if not os.path.exists(json_filename):
5046
logging.fatal("Cannot find %s", json_filename)
5147
sys.exit(1)
@@ -71,7 +67,7 @@ def sort_meta(s):
7167
speakers[speaker_name] = {"image": speaker_name, "title": speaker_title}
7268

7369
# configure Mako
74-
mako_templates = TemplateLookup(directories=["."], module_directory="/tmp/mako_modules")
70+
mako_templates = TemplateLookup(directories=["."], module_directory="../build/mako_modules")
7571

7672
# write index.html
7773
for template in ("asrbook",):

book/update_book.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
#!/bin/zsh
12
mkdir -p ./tmp
23
# copy files to tmp
3-
for i in ../docs/[A-Z]*/ASR/asr/2cols.jpg; do
4-
j=${i#../docs/}
5-
speaker1=${j%/ASR/asr/2cols.jpg}
4+
for i in ../docs/speakers/[A-Z]*/ASR/filters_eq.jpg; do
5+
j=${i#../docs/speakers}
6+
speaker1=${j%/ASR/filters_eq.jpg}
67
speaker2=${speaker1// /-}
78
speaker3=${speaker2//./-}
89
cp "$i" ./tmp/$speaker3.jpg

check_404.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
# A library to display spinorama charts
33
#
4-
# Copyright (C) 2020-23 Pierre Aubert pierreaubert(at)yahoo(dot)fr
4+
# Copyright (C) 2020-2023 Pierre Aubert pierre(at)spinorama(dot)org
55
#
66
# This program is free software: you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -17,10 +17,10 @@
1717
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1818

1919

20-
pylinkvalidate.py -P http://spinorama.internet-box.ch
20+
pylinkvalidate.py -P https://www.spinorama.org
2121

2222
for f in docs/speakers/*/*/*/*.html; do
2323
name=${f#docs/}
2424
u=${name// /%20}
25-
pylinkvalidate.py -P "http://spinorama.internet-box.ch/$u"
25+
pylinkvalidate.py -P "https://www.spinorama.org/$u"
2626
done

check_html.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
# A library to display spinorama charts
33
#
4-
# Copyright (C) 2020-23 Pierre Aubert pierreaubert(at)yahoo(dot)fr
4+
# Copyright (C) 2020-2023 Pierre Aubert pierre(at)spinorama(dot)org
55
#
66
# This program is free software: you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by

check_meta.py

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33
# A library to display spinorama charts
44
#
5-
# Copyright (C) 2020-23 Pierre Aubert pierreaubert(at)yahoo(dot)fr
5+
# Copyright (C) 2020-2023 Pierre Aubert pierre(at)spinorama(dot)org
66
#
77
# This program is free software: you can redistribute it and/or modify
88
# it under the terms of the GNU General Public License as published by
@@ -460,9 +460,9 @@ def sanity_check_specifications(name: str, version: str, specs: dict) -> int:
460460
"klippel",
461461
"princeton",
462462
"webplotdigitizer",
463-
"rewstextdump",
464-
"splHVtxt",
465-
"gllHVtxt",
463+
"rew_text_dump",
464+
"spl_hv_txt",
465+
"gll_hv_txt",
466466
)
467467

468468

@@ -481,35 +481,50 @@ def sanity_check_measurement(name: str, version: str, measurement: Measurement)
481481
if k not in MEASUREMENT_KNOWN_KEYS:
482482
logging.error("%s: version %s : %s is not known", name, version, k)
483483
status = 1
484+
continue
484485
if k == "origin" and (
485-
v not in ["ASR", "Misc", "ErinsAudioCorner", "Princeton"] and v[0:8] != "Vendors-"
486+
isinstance(v, str)
487+
and v not in ["ASR", "Misc", "ErinsAudioCorner", "Princeton"]
488+
and v[0:8] != "Vendors-"
486489
):
487490
logging.error("%s: origin %s is not known", name, v)
488491
status = 1
489-
if k == "origin" and v[0:8] == "Vendors-" and not sanity_check_vendor(v):
492+
continue
493+
if (
494+
k == "origin"
495+
and isinstance(v, str)
496+
and v[0:8] == "Vendors-"
497+
and not sanity_check_vendor(v)
498+
):
490499
logging.error("%s: origin %s is known but vendor %s is not!", name, v, v[8:])
491500
status = 1
501+
continue
492502
if k == "format" and v not in FORMAT_KNOWN_KEYS:
493503
logging.error("%s: format %s is not known", name, v)
494504
status = 1
505+
continue
495506
if k == "symmetry" and v not in [
496507
"coaxial",
497508
"horizontal",
498509
"vertical",
499510
]:
500511
logging.error("%s: symmetry %s is not known", name, v)
501512
status = 1
513+
continue
502514
if k == "review" and not isinstance(v, str):
503515
logging.error("%s: review %s is not a string", name, v)
504516
status = 1
517+
continue
505518
if k == "reviews":
506519
if not isinstance(v, dict):
507520
logging.error("%s: review %s is not a dict", name, v)
508521
status = 1
522+
continue
509523
for _, i_v in v.items():
510524
if not isinstance(i_v, str):
511525
logging.error("%s: in reviews %s review %s is not a string", name, v, i_v)
512526
status = 1
527+
continue
513528
if k == "quality" and v not in ("unknown", "low", "medium", "high"):
514529
logging.error(
515530
"%s: in measurement %s quality %s is unknown",
@@ -518,15 +533,21 @@ def sanity_check_measurement(name: str, version: str, measurement: Measurement)
518533
v,
519534
)
520535
status = 1
536+
continue
521537

522-
if k == "specifications" and sanity_check_specifications(name, version, v) != 0:
538+
if (
539+
k == "specifications"
540+
and isinstance(v, dict)
541+
and sanity_check_specifications(name, version, v) != 0
542+
):
523543
logging.error(
524544
"%s: in measurement %s specifications %s is incorrect",
525545
name,
526546
version,
527547
v,
528548
)
529549
status = 1
550+
continue
530551

531552
if version[0:3] == "mis" and "quality" not in measurement.keys():
532553
logging.error("%s: in measurement %s quality is required", name, version)

check_peqs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# A library to display spinorama charts
22
#
3-
# Copyright (C) 2020-23 Pierre Aubert pierreaubert(at)yahoo(dot)fr
3+
# Copyright (C) 2020-2023 Pierre Aubert pierre(at)spinorama(dot)org
44
#
55
# This program is free software: you can redistribute it and/or modify
66
# it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)