Notifications Quick Start Guide
Get up and running with MERA notifications in minutes.
๐ Basic Setup
1. Configuration Files
Create these files in your home directory:
Email (optional) - ~/email.txt
:
your.email@example.com
Zulip (optional) - ~/zulip.txt
:
bot-email@zulip.yourdomain.com
YOUR-API-KEY
https://zulip.yourdomain.com
2. Essential Usage
โ ๏ธ Important:
notifyme()
only sends notifications if you've created config files above- Without configuration, it runs silently
- Sends to ALL configured methods - if both
email.txt
andzulip.txt
exist, you get both email AND Zulip messages - Windows support: Not tested on Windows systems
# Basic notification (email/Zulip if configured, otherwise silent)
notifyme("Calculation finished!")
# Audio notification (always works, no setup needed)
bell() # Plays local sound
# Share research results with team
notifyme("Galaxy temperature analysis complete!",
zulip_channel="research",
zulip_topic="Temperature Study - Aug 2024")
# Attach plots and data automatically
notifyme("Density profile plots ready!",
image_path="density_profile.png")
# Monitor system resources during computation
notifyme("Memory usage after galaxy loading:",
capture_output=`free -h`)
# Track execution time
start_time = time()
# ... run your analysis ...
notifyme("Parameter sweep finished!", start_time=start_time)
โ Test Your Setup
Verify notifications work:
# Test audio (always works)
bell() # Should hear a sound
# Test configured notifications
notifyme("Test notification - setup working!")
# With both email.txt and zulip.txt: Check BOTH your email AND Zulip
# With only one configured: Check that method only
Troubleshooting:
- No email received? Check
~/email.txt
exists and system hasmail
command - No Zulip message? Verify
~/zulip.txt
has correct bot credentials - Silent operation? This is normal if no config files exist
๐ Function Overview
The notifyme
function supports:
- Text messages - Basic notifications
- File attachments - Images, data files, reports
- Output capture - Commands, functions, shell operations
- Time tracking - Automatic timing information
- Exception handling - Error notifications with stack traces
- Progress tracking - Long-running computation updates
๐ Next Steps
- Setup Guide - Detailed configuration
- File Attachments - Images and data sharing
- Output Capture - System monitoring
- Advanced Features - Timing, progress, exceptions
- Examples - Real-world use cases
๐ก Research Workflow Tips
- Organize by project - Use channels like
galaxy-research
,simulations
,data-analysis
- Use descriptive topics -
"Temperature Analysis - Aug 2024"
not just"Results"
- Start simple - Test with basic messages before adding attachments
- Monitor long computations - Use timing features for overnight runs
- Share results efficiently - Images auto-optimized (โค1024px), 25MB file limit
โก Common Research Patterns
# Long-running simulation with progress
tracker = create_progress_tracker(1000, task_name="Galaxy Formation")
for i in 1:1000
simulate_timestep(i)
update_progress!(tracker, i)
end
complete_progress!(tracker, "All timesteps completed!")
# Error-prone computation with safety
result = safe_execute("Critical density calculation") do
calculate_critical_densities(data)
end
# Send multiple plots from analysis
send_results("Paper figures ready!", "./plots/",
zulip_channel="publications",
zulip_topic="Paper 1 - Figures")