Add metadata (WIP)
This commit is contained in:
+1
-7
@@ -3,17 +3,11 @@
|
||||
|
||||
# Folder-level metadata that applies to all plots in this folder
|
||||
title: "Analysis Results"
|
||||
description: "Comprehensive analysis of ttbar events in Run 2 data"
|
||||
description: "ttbar"
|
||||
experiment: "CMS"
|
||||
dataset: "Run2_2016_nano_v9"
|
||||
analysis_type: "ttbar_analysis"
|
||||
|
||||
# Author information
|
||||
author:
|
||||
name: "Klaus Schmidt"
|
||||
email: "kschmidt@example.com"
|
||||
institution: "Example University"
|
||||
|
||||
# Analysis parameters that apply to all plots in this folder
|
||||
parameters:
|
||||
luminosity: "35.9 fb^-1"
|
||||
|
||||
@@ -67,8 +67,10 @@ def load_folder_metadata(folder_path: Path) -> Dict[str, Any]:
|
||||
return {}
|
||||
|
||||
|
||||
def merge_metadata(parent_metadata: Dict[str, Any],
|
||||
child_metadata: Dict[str, Any]) -> Dict[str, Any]:
|
||||
def merge_metadata(
|
||||
parent_metadata: Dict[str, Any],
|
||||
child_metadata: Dict[str, Any]
|
||||
) -> Dict[str, Any]:
|
||||
"""
|
||||
Merge parent and child metadata, with child values overriding parent
|
||||
values.
|
||||
@@ -85,9 +87,10 @@ def merge_metadata(parent_metadata: Dict[str, Any],
|
||||
return merged
|
||||
|
||||
|
||||
def resolve_metadata_for_plot(plot_path: Path,
|
||||
inherited_metadata: Dict[str, Any]
|
||||
) -> Dict[str, Any]:
|
||||
def resolve_metadata_for_plot(
|
||||
plot_path: Path,
|
||||
inherited_metadata: Dict[str, Any]
|
||||
) -> Dict[str, Any]:
|
||||
"""
|
||||
Resolve metadata for a specific plot by merging inherited metadata
|
||||
with plot-specific metadata.
|
||||
@@ -113,9 +116,10 @@ def resolve_metadata_for_plot(plot_path: Path,
|
||||
return inherited_metadata.copy()
|
||||
|
||||
|
||||
def save_metadata_cache(web_dir: Path,
|
||||
plot_metadata_cache: Dict[str, Dict[str, Any]]
|
||||
) -> None:
|
||||
def save_metadata_cache(
|
||||
web_dir: Path,
|
||||
plot_metadata_cache: Dict[str, Dict[str, Any]]
|
||||
) -> None:
|
||||
"""
|
||||
Save plot metadata cache to meta_cache.json in the web directory.
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<a href="{{ item.pdf_href }}">
|
||||
<img src="{{ item.png_href }}" alt="{{ item.name }}">
|
||||
</a>
|
||||
<button class="metadata-btn" onclick="event.stopPropagation(); showMetadataPopup(this, '{{ item.name|e }}', {{ item.metadata|default('{}')|tojson }})" title="View metadata">
|
||||
<button class="metadata-btn" onclick="event.stopPropagation(); showMetadataPopup(this, '{{ item.name|e }}', {{ (item.metadata or {})|tojson }})" title="View metadata">
|
||||
⋯
|
||||
</button>
|
||||
<div class="plot-name" title="{{ item.name }}">{{ item.name }}</div>
|
||||
|
||||
Reference in New Issue
Block a user