Weather Station
Level: Advanced 60–90 minConcepts: StateAlgorithms
Solutions: C# | TypeScript | Python
Implement a weather station system that processes weather data, calculates statistics, and predicts trends. The system should handle various weather parameters and provide meaningful insights.
Requirements
- Process weather data
- Temperature (current, min, max, average)
- Humidity levels
- Barometric pressure
- Wind speed and direction
- Precipitation amounts
- Calculate statistics
- Daily, weekly, and monthly averages
- Trend analysis
- Extreme weather conditions
- Weather patterns
- Generate reports
- Current conditions
- Historical data analysis
- Weather forecasts
- Alert conditions
Hint
Start by implementing the basic data collection and storage, then add the statistical calculations. Consider using a time-series database or similar structure for efficient data storage and retrieval. Think about:
- Data validation and error handling
- Efficient data storage and retrieval
- Statistical accuracy and precision
- Real-time processing requirements
Bonus
- Implement weather prediction algorithms
- Add support for multiple weather stations
- Create a visualization system for weather data
- Implement weather alerts and notifications
- Add support for different units of measurement
Reference Walkthrough
Full C#, TypeScript, and Python implementations live at tddbuddy-reference-katas/weather-station with the same twenty-four scenarios across all three languages, fluent StationBuilder and ReadingBuilder, a Clock collaborator so tests don’t depend on real time, and configurable alert thresholds.
- C# (.NET 8, xUnit, FluentAssertions) — walkthrough
- TypeScript (Node 20, Vitest, strict types) — walkthrough
- Python (3.11, pytest, dataclasses) — walkthrough
This kata ships in middle gear — a single commit per language with the full domain design. The Station aggregate records validated weather readings, computes min/max/average statistics across temperature, humidity, and wind speed, and evaluates configurable alert thresholds. See the repo’s Gears section for why that’s a deliberate teaching choice.