-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheck_links.py
More file actions
65 lines (54 loc) · 2.78 KB
/
Copy pathcheck_links.py
File metadata and controls
65 lines (54 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# SPDX-FileCopyrightText: 2026 bartzbeielstein
#
# SPDX-License-Identifier: AGPL-3.0-or-later
import os
from bs4 import BeautifulSoup
from urllib.parse import urljoin, urlparse
def get_all_html_files(directory):
html_files = []
for root, _, files in os.walk(directory):
for file in files:
if file.endswith(".html"):
html_files.append(os.path.join(root, file))
return html_files
def check_links():
site_dir = "_site"
html_files = get_all_html_files(site_dir)
dead_links = []
for file_path in html_files:
with open(file_path, "r", encoding="utf-8") as f:
soup = BeautifulSoup(f.read(), "html.parser")
import os
from pathlib import Path
def print_sections():
src_dir = Path("src/spotoptim")
sections = {
"SpotOptim": ["SpotOptim.SpotOptim", "SpotOptim.SpotOptimConfig", "SpotOptim.SpotOptimState"],
"Core": ["core", "core.data", "core.experiment"],
"Surrogate Models": ["surrogate", "surrogate.kriging", "surrogate.simple_kriging", "surrogate.mlp_surrogate", "surrogate.nystroem", "surrogate.kernels", "surrogate.pipeline"],
"Sampling": ["sampling", "sampling.design", "sampling.effects", "sampling.lhs", "sampling.mm"],
"Optimization": ["optimizer", "optimizer.schedule_free"],
"Hyperparameters": ["hyperparameters", "hyperparameters.parameters", "hyperparameters.repr_helpers"],
"Neural Networks": ["nn", "nn.linear_regressor", "nn.mlp"],
"Plotting & Visualization": ["plot", "plot.contour", "plot.mo", "plot.visualization"],
"Utilities": ["utils", "utils.boundaries", "utils.eval", "utils.file", "utils.mapping", "utils.pca", "utils.scaler", "utils.stats"],
"Data": ["data", "data.base", "data.diabetes"],
"Exploratory Data Analysis": ["eda", "eda.plots"],
"Multi-Objective": ["mo", "mo.mo_mm", "mo.pareto"],
"Inspection": ["inspection", "inspection.importance", "inspection.predictions"],
"Factor Analyzer": ["factor_analyzer", "factor_analyzer.confirmatory_factor_analyzer", "factor_analyzer.factor_analyzer", "factor_analyzer.factor_analyzer_rotator", "factor_analyzer.factor_analyzer_utils"],
"Functions": ["function", "function.forr08a", "function.mo", "function.remote", "function.so", "function.torch_objective"],
"Tricands": ["tricands", "tricands.tricands"]
}
yaml_str = " sections:\n"
for title, contents in sections.items():
yaml_str += f" - title: \"{title}\"\n"
yaml_str += f" contents:\n"
for c in contents:
yaml_str += f" - {c}\n"
yaml_str += "\n"
with open("generated_sections.yml", "w") as f:
f.write(yaml_str)
print("generated")
if __name__ == "__main__":
print_sections()