From 37e48c65400192cce1de0afed48dfc3e191bf749 Mon Sep 17 00:00:00 2001
From: Kartik Pradeepan
Date: Sat, 29 Mar 2025 09:43:47 -0400
Subject: [PATCH] Add starter template for use cases and fix sidebar links to
function in local
---
.../benchmarks/components/left-sidebar.html | 19 ++--
.../benchmarks/tutorials/tutorial.html | 2 +
.../tutorials/use-cases/use-cases.html | 96 +++++++++++++++++++
benchmarks/urls.py | 3 +
.../css/components/left-sidebar.sass | 11 ++-
5 files changed, 120 insertions(+), 11 deletions(-)
create mode 100644 benchmarks/templates/benchmarks/tutorials/use-cases/use-cases.html
diff --git a/benchmarks/templates/benchmarks/components/left-sidebar.html b/benchmarks/templates/benchmarks/components/left-sidebar.html
index d31121c45..b587fe76c 100644
--- a/benchmarks/templates/benchmarks/components/left-sidebar.html
+++ b/benchmarks/templates/benchmarks/components/left-sidebar.html
@@ -29,21 +29,24 @@
diff --git a/benchmarks/templates/benchmarks/tutorials/tutorial.html b/benchmarks/templates/benchmarks/tutorials/tutorial.html
index aa4fc7d60..a3d19da6a 100644
--- a/benchmarks/templates/benchmarks/tutorials/tutorial.html
+++ b/benchmarks/templates/benchmarks/tutorials/tutorial.html
@@ -34,6 +34,8 @@ Welcome!
Models
Benchmarks
+ Use Cases
+
diff --git a/benchmarks/templates/benchmarks/tutorials/use-cases/use-cases.html b/benchmarks/templates/benchmarks/tutorials/use-cases/use-cases.html
new file mode 100644
index 000000000..28ed9171b
--- /dev/null
+++ b/benchmarks/templates/benchmarks/tutorials/use-cases/use-cases.html
@@ -0,0 +1,96 @@
+{% extends "benchmarks/components/app-view.html" %}
+{% load static %}
+
+{% block banner %}
+ Use Cases
+
+ Below you will find a curated set of examples notebooks demonstrating typical Brain-Score use cases,
+ available as Jupyter Notebooks. To ensure they are always up to date, the notebooks are maintained
+ in our vision repository. Each link
+ below will take you directly to the latest version on GitHub.
+
+{% endblock %}
+
+
+
+{% block info_section %}
+ {% include "benchmarks/tutorials/tutorial-info-section.html" %}
+{% endblock %}
+
+
+{% block content %}
+
+
+
+
Perform Region-Layer Mapping
+
+ Region-Layer Mapping is a fundamental step in converting a BaseModel into a Brain-Score model.
+ Here, `get_layers`are benchmarked against `STANDARD_REGION_BENCHMARKS` and subsequently
+ committed to a specific region.
+
+
+
+ View Notebook on GitHub
+
+
+
+
+
+
+
+
+
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/benchmarks/urls.py b/benchmarks/urls.py
index 19917eb5d..36613432d 100644
--- a/benchmarks/urls.py
+++ b/benchmarks/urls.py
@@ -66,6 +66,9 @@
path('tutorials/benchmarks/create_benchmark',
user.Tutorials.as_view(plugin="benchmarks", tutorial_type="create_benchmark"),
name='benchmark-create-benchmark'),
+ # - use case tutorials
+ path('tutorials/use-cases/use-cases', user.Tutorials.as_view(tutorial_type="use-cases/use-cases"), name='use-case-tutorial'),
+
# - brain model explanation
path('brain_model', brain_model.view, name='brain-model'),
diff --git a/static/benchmarks/css/components/left-sidebar.sass b/static/benchmarks/css/components/left-sidebar.sass
index 41623308a..9e8c8c8fc 100644
--- a/static/benchmarks/css/components/left-sidebar.sass
+++ b/static/benchmarks/css/components/left-sidebar.sass
@@ -6,6 +6,7 @@
left: 0
padding-right: 0
background: $brainscore_gray4
+ z-index: 9998
a
display: block
@@ -51,8 +52,9 @@
background-color: white
min-width: 160px
box-shadow: 0px 8px 16px rgba(0,0,0,0.2)
- z-index: 1
- transform: translateX(67px)
+ z-index: 9999
+ left: 67px
+ top: 100%
// Dropdown links styling
.dropdown-content a
@@ -60,6 +62,7 @@
padding: 12px 16px
text-decoration: none
display: block
+ z-index: 9999
.dropdown:hover > .dropdown-content
display: block
@@ -81,10 +84,12 @@
background-color: white
width: 180px
box-shadow: 0px 8px 16px rgba(0,0,0,0.2)
- z-index: 1
+ z-index: 10000
+
.nested-dropdown-content a
font-size: 0.9em
+ z-index: 10000
// Show nested dropdown on hover
.nested-dropdown:hover .nested-dropdown-content