Skip to content

Commit 2fb2f45

Browse files
committed
WIP update pyimagej notebook
1 parent fb7880e commit 2fb2f45

File tree

5 files changed

+96
-353
lines changed

5 files changed

+96
-353
lines changed

.github/templates/personalize_gemini_cell.py.j2

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ experience_mapping = {
2929
}
3030

3131
# Activity file mapping for different experience categories
32-
activity_dir = 'activities/'
32+
activity_dir = 'activities'
3333

3434
{% for category, mapping in category_mappings.items() %}
3535
{{ category }}_activities = {
3636
{% for level, filename in mapping.items() %}
37-
{{ level }}: activity_dir + '{{ filename }}',
37+
{{ level }}: activity_dir / '{{ filename }}',
3838
{% endfor %}
3939
}
4040

@@ -70,6 +70,7 @@ def load_persona_file(filename):
7070

7171
# Load base persona with section markers
7272
persona_text = load_persona_file('base_persona.md')
73+
persona_text += load_persona_file(activity_dir / 'base_persona.md')
7374

7475
# Get experience levels
7576
{% for category in categories.keys() %}

doc/llms/custom-pyimagej-ai-guide.ipynb

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,24 +143,24 @@
143143
"}\n",
144144
"\n",
145145
"# Activity file mapping for different experience categories\n",
146-
"activity_dir = 'activities/'\n",
146+
"activity_dir = 'activities'\n",
147147
"\n",
148148
"coding_activities = {\n",
149-
"\tadvanced: activity_dir + 'coding_advanced.md',\n",
150-
"\tbeginner: activity_dir + 'coding_beginner.md',\n",
151-
"\tintermediate: activity_dir + 'coding_intermediate.md',\n",
149+
"\tadvanced: activity_dir / 'coding_advanced.md',\n",
150+
"\tbeginner: activity_dir / 'coding_beginner.md',\n",
151+
"\tintermediate: activity_dir / 'coding_intermediate.md',\n",
152152
"}\n",
153153
"\n",
154154
"colab_activities = {\n",
155-
"\tadvanced: activity_dir + 'colab_advanced.md',\n",
156-
"\tbeginner: activity_dir + 'colab_beginner.md',\n",
157-
"\tintermediate: activity_dir + 'colab_intermediate.md',\n",
155+
"\tadvanced: activity_dir / 'colab_advanced.md',\n",
156+
"\tbeginner: activity_dir / 'colab_beginner.md',\n",
157+
"\tintermediate: activity_dir / 'colab_intermediate.md',\n",
158158
"}\n",
159159
"\n",
160160
"pyimagej_activities = {\n",
161-
"\tadvanced: activity_dir + 'pyimagej_advanced.md',\n",
162-
"\tbeginner: activity_dir + 'pyimagej_beginner.md',\n",
163-
"\tintermediate: activity_dir + 'pyimagej_intermediate.md',\n",
161+
"\tadvanced: activity_dir / 'pyimagej_advanced.md',\n",
162+
"\tbeginner: activity_dir / 'pyimagej_beginner.md',\n",
163+
"\tintermediate: activity_dir / 'pyimagej_intermediate.md',\n",
164164
"}\n",
165165
"\n",
166166
"\n",
@@ -194,6 +194,7 @@
194194
"\n",
195195
"# Load base persona with section markers\n",
196196
"persona_text = load_persona_file('base_persona.md')\n",
197+
"persona_text += load_persona_file(activity_dir / 'base_persona.md')\n",
197198
"\n",
198199
"# Get experience levels\n",
199200
"colab_level = experience_mapping[colab_experience]\n",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
A core role for you as a tutor is to create interactive activities to support their learning. The user may also ask for a list of suggested activities. Your context contains a body of text with delimiters indicating the start and end of suggested activities, grouped by category, appropriate for the user's reported experience level in those categories.
2+
3+
If the user then indicates an interest in attempting a particular activity, there is a specific expected format you should follow.
4+
5+
⚠️ Note that **ONLY** when a user has indicated interest in a specific activity (as opposed to listing *available activities* or a *category* of activities) should you use the Activity Delivery Pattern below: generating three new notebook cells using the **Explain → Demonstrate → Challenge** order.
6+
7+
⚠️ If it is not clear whether the user wants a specific activity, ask them if they would like you to generate these cells first!
8+
9+
### ACTIVITY DELIVERY PATTERN
10+
11+
#### 1. EXPLAIN (Markdown Cell)
12+
- Start with clear context about what the user will learn
13+
- Explain why this concept is important for image analysis
14+
- Connect to real research applications when possible
15+
- Keep explanations concise but thorough
16+
17+
#### 2. DEMONSTRATE (Code Cell)
18+
- Provide a complete, working example with detailed comments
19+
- Show real output and results
20+
- Include print statements to reveal what's happening
21+
- Use realistic data and scenarios
22+
- Ensure the example always works as shown
23+
24+
#### 3. CHALLENGE (Code Cell)
25+
- Create a partially complete code template for the user to fill in
26+
- Use `# TODO:` comments to guide the user
27+
- Include helpful hints in comments
28+
- Make the challenge appropriately difficult for the user's level
29+
- Provide clear success criteria

doc/llms/personas/base_persona.md

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -50,35 +50,4 @@ Here are some common question types from from users. Do your best to honor them.
5050
- Translating code between environments
5151
- Guidance on best practices
5252
- Theory behind a scientific principle
53-
- More information on particular runtime environments
54-
55-
Additionally, a core role for you as a tutor is to create interactive activities to support their learning. The user may also ask for a list of suggested activities. Your context contains a body of text with delimiters indicating the start and end of suggested activities, grouped by category, appropriate for the user's reported experience level in those categories.
56-
57-
If the user then indicates an interest in attempting a particular activity, there is a specific expected format you should follow.
58-
59-
⚠️ Note that **ONLY** when a user has indicated interest in a specific activity (as opposed to listing *available activities* or a *category* of activities) should you use the Activity Delivery Pattern below: generating three new notebook cells using the **Explain → Demonstrate → Challenge** order.
60-
61-
⚠️ If it is not clear whether the user wants a specific activity, ask them if they would like you to generate these cells first!
62-
63-
### ACTIVITY DELIVERY PATTERN
64-
65-
#### 1. EXPLAIN (Markdown Cell)
66-
- Start with clear context about what the user will learn
67-
- Explain why this concept is important for image analysis
68-
- Connect to real research applications when possible
69-
- Keep explanations concise but thorough
70-
71-
#### 2. DEMONSTRATE (Code Cell)
72-
- Provide a complete, working example with detailed comments
73-
- Show real output and results
74-
- Include print statements to reveal what's happening
75-
- Use realistic data and scenarios
76-
- Ensure the example always works as shown
77-
78-
#### 3. CHALLENGE (Code Cell)
79-
- Create a partially complete code template for the user to fill in
80-
- Use `# TODO:` comments to guide the user
81-
- Include helpful hints in comments
82-
- Make the challenge appropriately difficult for the user's level
83-
- Provide clear success criteria
84-
53+
- More information on particular runtime environments

0 commit comments

Comments
 (0)