gaslamp v0.25.0 Release Notes¶
- Released: 2025-09-12
- gaslamp: 64 - v0.25.0
- pilotlamp: 21 - v0.25.0
๐ Major Changes¶
๐ GroupedDataFrame Implementation (Issues #89, #90, #91, #92, #93)¶
Complete GroupedDataFrame functionality - Implemented comprehensive data aggregation capabilities for grouped data analysis:
- Core Aggregation Methods: count(), sum(), mean(), min(), max() with full TypeScript support
- Multiple Column Support: Aggregate multiple columns simultaneously or let the system auto-detect numeric columns
- Flexible Parameters: Support both spread syntax and array parameters for column selection
- Error Handling: Robust validation with clear error messages for non-numeric data and missing columns
// Comprehensive aggregation operations now available
const df = new DataFrame().fromArrays([
['department', 'salary', 'experience'],
['IT', 70000, 3],
['HR', 50000, 2],
['IT', 80000, 5],
['Finance', 60000, 4]
]);
const grouped = df.groupBy('department');
// All aggregation methods now implemented
const counts = grouped.count(); // Count records per group
const totals = grouped.sum('salary'); // Sum salary by department
const averages = grouped.mean(); // Mean of all numeric columns
const ranges = grouped.min('salary').merge(grouped.max('salary'));
๐ Comprehensive Documentation Enhancement¶
Professional documentation system - Created extensive documentation following the 0.24.0 format structure:
- TypeDoc Integration: Updated all GroupedDataFrame docstrings to proper TypeDoc format with beginner-friendly explanations
- Usage Guide: Complete usage documentation at
docs/modules/torch/grouped-dataframe.md - Real-World Examples: Practical business scenarios including sales analysis, employee demographics, and pivot-table operations
- Best Practices: Performance tips, error handling patterns, and memory management guidelines
๐ง Google Apps Script Compatibility Fix¶
BookArtisan URL Support - Enhanced BookArtisan.open() method to support URL parameters:
- URL Detection: Automatic detection of Spreadsheet URLs vs file IDs
- Flexible Input: Accepts both Google Sheets URLs and traditional spreadsheet IDs
- Backward Compatibility: Existing code using file IDs continues to work unchanged
- Error Handling: Improved validation and error messages for invalid URLs or IDs
// Both formats now supported
const bookByUrl = new BookArtisan().open('https://docs.google.com/spreadsheets/d/ABC123/edit');
const bookById = new BookArtisan().open('ABC123'); // Still works
๐ Enhanced Features¶
โจ Advanced GroupedDataFrame Operations¶
Powerful aggregation capabilities - Full-featured implementation matching pandas GroupBy functionality:
- Auto-Detection: Automatically identifies numeric columns for aggregation when no columns specified
- Type Safety: Strong TypeScript typing with proper error handling for invalid operations
- Performance Optimization: Efficient grouping algorithm with Map-based storage for fast lookup
- Chain Operations: Results return DataFrames for further processing and analysis
// Advanced usage patterns
const salesAnalysis = df.groupBy('region', 'quarter').agg({
'sales': 'sum',
'profit': 'mean',
'units': 'max'
});
// Custom calculations (coming in apply() method)
const customMetrics = grouped.apply(group => ({
count: group.length,
salaryRange: Math.max(...group.getColumn('salary')) - Math.min(...group.getColumn('salary'))
}));
๐ Documentation Excellence¶
Industry-standard documentation - Following modern documentation practices:
- Modular Organization: Organized documentation in logical sections from basics to advanced usage
- Interactive Examples: All code examples are runnable and demonstrate real-world scenarios
- Integration Examples: Shows integration with other gaslamp modules (FlameWright, AfterGlow, Gaslets)
- Navigation Enhancement: Updated mkdocs.yml with proper navigation structure
๐ Bug Fixes & Improvements¶
GroupedDataFrame Core Functionality¶
- Fixed fromArrays() Usage: Corrected all documentation examples to use proper array format instead of object format
- Enhanced Error Messages: Clear, actionable error messages for common issues like non-numeric columns
- Type Validation: Proper validation of input parameters with FlameWright integration
- Memory Management: Efficient handling of large datasets with proper cleanup
Documentation System¶
- TypeDoc Compliance: All docstrings now follow TypeDoc standards with proper tags
- Example Accuracy: All code examples verified to work correctly with current API
- Cross-References: Proper linking between related documentation sections
- Visual Formatting: Improved readability with proper code highlighting and structure
Bundle Integration¶
- Export Modules: Proper export of analysis modules for TypeDoc generation
- GAS Compatibility: Ensured all new features work correctly in Google Apps Script environment
- Bundle Size: Optimized bundle output with tree-shaking for analysis modules
๐ง Architecture Improvements¶
GroupedDataFrame Design¶
- Separation of Concerns: Clear separation between grouping logic and aggregation methods
- Extensible Architecture: Easy to add new aggregation methods following established patterns
- Integration Ready: Designed to work seamlessly with existing DataFrame ecosystem
- Performance Focus: Map-based grouping for O(1) group lookups and efficient aggregation
Documentation Architecture¶
- Scalable Structure: Documentation structure that can grow with new features
- Version Consistency: Consistent formatting and structure across all documentation
- Maintainable Content: Clear separation between API docs, usage guides, and examples
- User-Focused Flow: Logical progression from basic concepts to advanced usage
๐งช Testing & Quality¶
Comprehensive Test Coverage¶
- โ GroupedDataFrame Tests: Complete test suite covering all aggregation methods
- โ Edge Case Handling: Tests for empty groups, single-row groups, and mixed data types
- โ Error Conditions: Comprehensive testing of error scenarios and validation
- โ Integration Tests: Cross-module integration testing with DataFrame and other components
Test Results¶
// GroupedDataFrame Test Results
โ
count(): All group counting scenarios
โ
sum(): Numeric aggregation with type validation
โ
mean(): Average calculations with proper handling
โ
min()/max(): Range operations with error handling
โ
Multi-column operations: Spread and array parameter support
โ
Auto-detection: Automatic numeric column identification
Quality Assurance¶
- โ TypeScript Strict Mode: Full compliance with strict TypeScript checking
- โ Documentation Accuracy: All examples verified and tested
- โ API Consistency: Consistent parameter patterns across all methods
- โ Performance Testing: Verified performance with large datasets
๐ Technical Implementation Details¶
GroupedDataFrame Algorithm¶
Efficient Grouping Strategy: Implemented optimized grouping algorithm for performance:
// Core grouping implementation
private groupDataFrame(df: DataFrame, headers: string[]): Map<string, DataFrame> {
const groups = new Map<string, Record<string, any>[]>();
for (let i = 0; i < df.length; i++) {
const row = df.getRow(i, { format: "object" });
const key = headers.map(header => String(row[header])).join("||");
if (!groups.has(key)) {
groups.set(key, []);
}
groups.get(key)!.push(row);
}
return this.convertToDataFrames(groups);
}
Documentation System Enhancement¶
Professional Documentation Pipeline: Established comprehensive documentation workflow:
- TypeDoc Generation: Automatic API documentation from source code
- Usage Guides: Hand-crafted usage documentation with real examples
- Navigation Integration: MkDocs integration with proper categorization
- Cross-References: Linking between API docs and usage guides
BookArtisan URL Support¶
URL Recognition Enhancement: Added intelligent URL detection:
// URL detection and processing
private processSpreadsheetIdentifier(input: string): string {
if (input.includes('docs.google.com/spreadsheets/d/')) {
// Extract ID from URL
const match = input.match(/\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/);
return match ? match[1] : input;
}
return input; // Assume it's already an ID
}
๐ Migration Guide¶
For GroupedDataFrame Users¶
New Functionality Available: All aggregation methods are now fully implemented:
// All these methods now work completely
const grouped = df.groupBy('category');
const counts = grouped.count(); // โ
Implemented
const totals = grouped.sum('amount'); // โ
Implemented
const averages = grouped.mean(); // โ
Implemented
const minimums = grouped.min('price'); // โ
Implemented
const maximums = grouped.max('rating'); // โ
Implemented
// Coming soon
const custom = grouped.apply(fn); // ๐ Planned for next release
const multi = grouped.agg({...}); // ๐ Planned for next release
For BookArtisan Users¶
Enhanced open() Method: URL support added with backward compatibility:
// Both approaches work
const artisan = new BookArtisan();
// New: URL support
artisan.open('https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit#gid=0');
// Existing: ID support (still works)
artisan.open('YOUR_SHEET_ID');
For Documentation Contributors¶
New Documentation Standards: Follow established patterns for consistency:
- Use TypeDoc format for all docstrings
- Include practical, runnable examples
- Follow the established section structure
- Add proper cross-references and navigation
๐ฅ Contributors¶
- @shotakaha - Complete GroupedDataFrame implementation, comprehensive documentation system, and BookArtisan URL support
๐ Links¶
- Documentation: https://gaslamp.readthedocs.io/
- Repository: https://gitlab.com/qumasan/gaslamp
- GroupedDataFrame Guide: https://gaslamp.readthedocs.io/modules/torch/grouped-dataframe/
Full Changelog: v0.24.0...v0.25.0