git add analyse_xy.py config_xy.py .gitignore
git commit -m "Refactor: Einführung zentraler Konfigurationsdatei für 'analyse_xy.py' - Konfigurationsparameter wie `theme`, `export_fig_visual` und `bib_filename` in `config_netzwerk.py` ausgelagert. - Alle bisherigen Export-Flags abgeleitet von `export_fig_visual` in der Config. - Integration der Konfigurationswerte im Hauptskript per `from config_netzwerk import ...`. - Ersetzung aller bisherigen `export_fig_...` Initialisierungen im Skript durch imports aus Config. - CI-konforme Verwendung der Farben und Plot-Styles aus `plotly_template`. - Verbesserte Responsivität durch `autosize=True` und `automargin=True`. - Achsentick-Ausrichtung vereinheitlicht und textleserlich bei langen Labels verbessert. - Titel um Quellenvermerk ergänzt (`| Quelle: ...`), via `prepare_figure_export(...)`. - `.gitignore` um `config_netzwerk.py` ergänzt, um lokale Änderungen git-external zu halten. Ergebnis: Trennung von Konfiguration und Logik, einheitliches Design, verbesserte Wartbarkeit.
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -22,3 +22,7 @@ __pycache__/
|
|||||||
|
|
||||||
# Logdateien
|
# Logdateien
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
|
# Lokale Konfigurationen (nicht in Git einchecken)
|
||||||
|
config_netzwerk.py
|
||||||
|
config_korrelation.py
|
||||||
|
|||||||
@ -1,6 +1,25 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
# Import theme and all export_fig_... variables from central config before any use
|
||||||
|
from config_korrelation import (
|
||||||
|
theme,
|
||||||
|
export_fig_visual,
|
||||||
|
export_fig_clusteranalyse,
|
||||||
|
export_fig_correlation_suchbegriffe_kategorien,
|
||||||
|
export_fig_correlation_fu_kategorien,
|
||||||
|
export_fig_correlation_fu_suchbegriffe,
|
||||||
|
export_fig_correlation_indizes_kategorien,
|
||||||
|
export_fig_correlation_indizes_suchbegriffe,
|
||||||
|
export_fig_correlation_fu_indizes,
|
||||||
|
export_fig_correlation_fu_fu,
|
||||||
|
export_fig_correlation_suchbegriffe_suchbegriffe,
|
||||||
|
export_fig_correlation_kategorien_kategorien,
|
||||||
|
export_fig_correlation_indizes_indizes,
|
||||||
|
export_fig_summary_plot,
|
||||||
|
bib_filename
|
||||||
|
)
|
||||||
|
|
||||||
# Terminal leeren
|
# Terminal leeren
|
||||||
os.system('cls' if os.name == 'nt' else 'clear')
|
os.system('cls' if os.name == 'nt' else 'clear')
|
||||||
|
|
||||||
@ -29,27 +48,7 @@ import matplotlib.pyplot as plt
|
|||||||
# Debugging and Output
|
# Debugging and Output
|
||||||
from tabulate import tabulate
|
from tabulate import tabulate
|
||||||
|
|
||||||
theme = "light" # "light" oder "dark"
|
|
||||||
|
|
||||||
# Name der BibTeX-Datei für Exportzwecke
|
|
||||||
bib_filename = "Suchergebnisse.bib"
|
|
||||||
|
|
||||||
# Zentrale Steuerung für Export-Flags
|
|
||||||
export_fig_visual = False
|
|
||||||
|
|
||||||
# Export-Flags für Visualisierungen
|
|
||||||
export_fig_clusteranalyse = export_fig_visual
|
|
||||||
export_fig_correlation_suchbegriffe_kategorien = export_fig_visual
|
|
||||||
export_fig_correlation_fu_kategorien = export_fig_visual
|
|
||||||
export_fig_correlation_fu_suchbegriffe = export_fig_visual
|
|
||||||
export_fig_correlation_indizes_kategorien = export_fig_visual
|
|
||||||
export_fig_correlation_indizes_suchbegriffe = export_fig_visual
|
|
||||||
export_fig_correlation_fu_indizes = export_fig_visual
|
|
||||||
export_fig_correlation_fu_fu = export_fig_visual
|
|
||||||
export_fig_correlation_suchbegriffe_suchbegriffe = export_fig_visual
|
|
||||||
export_fig_correlation_kategorien_kategorien = export_fig_visual
|
|
||||||
export_fig_correlation_indizes_indizes = export_fig_visual
|
|
||||||
export_fig_summary_plot = export_fig_visual
|
|
||||||
|
|
||||||
# Universelle Hilfsfunktion für Export und Titelmanipulation
|
# Universelle Hilfsfunktion für Export und Titelmanipulation
|
||||||
def prepare_figure_export(fig, name):
|
def prepare_figure_export(fig, name):
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
from config_netzwerk import theme, export_fig_visual, bib_filename
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
# Clear the terminal
|
# Clear the terminal
|
||||||
@ -24,8 +26,6 @@ import math
|
|||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
export_fig_visual = False # Expot der Visualsierungen gesamt
|
|
||||||
theme = "light" # Optionen: "dark" oder "light"
|
|
||||||
|
|
||||||
# Template
|
# Template
|
||||||
from ci_template import plotly_template
|
from ci_template import plotly_template
|
||||||
@ -33,7 +33,6 @@ plotly_template.set_theme(theme)
|
|||||||
pd.set_option('display.max_columns', None)
|
pd.set_option('display.max_columns', None)
|
||||||
pd.set_option('future.no_silent_downcasting', True)
|
pd.set_option('future.no_silent_downcasting', True)
|
||||||
|
|
||||||
bib_filename = "Suchergebnisse.bib"
|
|
||||||
|
|
||||||
# Optional: slugify-Funktion
|
# Optional: slugify-Funktion
|
||||||
def slugify(value):
|
def slugify(value):
|
||||||
@ -47,22 +46,22 @@ def prepare_figure_export(fig, name):
|
|||||||
safe_filename = slugify(f"{name}_{bib_filename.replace('.bib', '')}")
|
safe_filename = slugify(f"{name}_{bib_filename.replace('.bib', '')}")
|
||||||
return f"{safe_filename}.html"
|
return f"{safe_filename}.html"
|
||||||
|
|
||||||
|
|
||||||
# Zentraler Schalter für Export-Flags
|
# Zentraler Schalter für Export-Flags
|
||||||
|
from config_netzwerk import (
|
||||||
# Export-Flags für Visualisierungen (abhängig vom zentralen Schalter)
|
export_fig_visualize_network,
|
||||||
export_fig_visualize_network = export_fig_visual
|
export_fig_visualize_tags,
|
||||||
export_fig_visualize_tags = export_fig_visual
|
export_fig_visualize_index,
|
||||||
export_fig_visualize_index = export_fig_visual
|
export_fig_visualize_research_questions,
|
||||||
export_fig_visualize_research_questions = export_fig_visual
|
export_fig_visualize_categories,
|
||||||
export_fig_visualize_categories = export_fig_visual
|
export_fig_visualize_time_series,
|
||||||
export_fig_visualize_time_series = export_fig_visual
|
export_fig_visualize_top_authors,
|
||||||
export_fig_visualize_top_authors = export_fig_visual
|
export_fig_visualize_top_publications,
|
||||||
export_fig_visualize_top_publications = export_fig_visual
|
export_fig_create_path_diagram,
|
||||||
export_fig_create_path_diagram = export_fig_visual
|
export_fig_create_sankey_diagram,
|
||||||
export_fig_create_sankey_diagram = export_fig_visual
|
export_fig_visualize_sources_status,
|
||||||
export_fig_visualize_sources_status = export_fig_visual
|
export_fig_create_wordcloud_from_titles
|
||||||
export_fig_create_wordcloud_from_titles = export_fig_visual
|
)
|
||||||
|
|
||||||
|
|
||||||
# Zentrale Exportfunktion für Visualisierungen
|
# Zentrale Exportfunktion für Visualisierungen
|
||||||
def export_figure(fig, name, flag, bib_filename=None):
|
def export_figure(fig, name, flag, bib_filename=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user