commits
- Remove all remaining duplicate functions from platform modules
- Clean up documentation and module structure
- Fix print_stats in Gpx_eio to use sink capability instead of stdout
- Ensure platform modules focus solely on their I/O concerns
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
0/1
Move Statistics to Core:
- Add Doc.stats type and function (comprehensive GPX statistics)
- Add Doc.pp_stats for pretty-printing statistics using Format
- Remove duplicate stats implementations from Gpx_eio and Gpx_unix
Remove Function Duplication:
- Remove redundant accessor functions (waypoint_coords, track_coords, route_coords)
- Remove duplicate constructor functions (make_track_from_coords, make_route_from_coords)
- Remove duplicate count_points implementations
- Users should call core functions directly (Waypoint.to_floats, Track.to_coords, etc.)
Simplify Platform APIs:
- Platform modules now only contain I/O operations and print_stats
- Gpx_eio.print_stats and Gpx_unix.print_stats use Doc.pp_stats
- Removed unused Result binding operators
- Cleaner, more focused platform-specific functionality
This eliminates code duplication while keeping I/O operations
appropriately separated in platform-specific modules.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Parser Enhancements:
- Add parse_author function with email parsing (id@domain format)
- Add parse_copyright function with year/license support
- Add parse_bounds function with coordinate validation
- Add missing author/copyright/bounds cases to metadata parser
Writer Implementation:
- Replace incomplete writer with full GPX 1.1 spec coverage
- Add support for all metadata elements (author, copyright, bounds, time, links)
- Add support for all waypoint elements (elevation, time, GPS accuracy fields)
- Add support for complete route writing with all fields
- Add support for complete track writing with segments and extensions
- Add proper type conversion for degrees, fix_types, and timestamps
- Add email serialization with id/domain attribute format
API Completeness:
- Add missing accessor functions across all modules:
* Metadata: extensions accessor
* Route: comment, source, links, type_, extensions accessors
* Track: comment, source, links, number, type_, extensions accessors
* Track.Segment: extensions accessor
- Ensure full round-trip capability (parse → write → parse)
Test Fixes:
- Fix test data directory resolution for dune sandbox environments
- Restore correct expectations for author/copyright parsing
- All tests now pass including round-trip validation
The library now provides complete coverage of GPX 1.1 specification
with full parsing and writing capabilities for all elements.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Implement production-ready CLI with convert and info commands
- Add proper ANSI color output and formatting
- Replace all get_ accessors with direct field access pattern
- Remove legacy Gpx_doc module in favor of Doc
- Add comprehensive error handling and validation
- Implement track/route point counting and analysis
- Support waypoint to track conversion with sorting options
- Add detailed GPX file analysis with time range calculation
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Split monolithic types.ml into focused modules for better organization:
- coordinate.ml - GPS coordinate types and validation
- error.ml - GPX error types and handling
- extension.ml - GPX extension support
- gpx_doc.ml - Main GPX document structure
- link.ml - Link/URL types
- metadata.ml - GPX metadata types
- route.ml - Route and route point types
- track.ml - Track and track point types
- waypoint.ml - Waypoint types
Updated all dependent modules to use new modular structure.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
0/1
Replace separate *_validated functions with optional validate parameter
across all modules. This provides cleaner API consistency while
maintaining backward compatibility.
Changes:
- Add optional validate parameter to parse/write functions
- Remove separate _validated function variants
- Add utility functions to main Gpx module
- Update examples to use new unified API
- Add GPX example files for testing
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive CLI tool with cmdliner and Eio backend
- Implement waypoint-to-trackset conversion with sorting options
- Add info command with detailed GPX analysis and time range display
- Add GPX 1.0 support alongside existing GPX 1.1 support
- Add ANSI color output with terminal detection using fmt library
- Update documentation with CLI usage examples
- Rename branding from 'MLGpx' to 'mlgpx' throughout
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds a complete test infrastructure covering both Unix and Eio
implementations, along with XML writer/parser fixes for proper round-trip
functionality.
**New Test Infrastructure:**
- Created 9 synthetic GPX test files covering diverse features:
* simple_waypoints.gpx, detailed_waypoints.gpx, simple_route.gpx
* simple_track.gpx, multi_segment_track.gpx, comprehensive.gpx
* minimal.gpx, edge_cases.gpx, invalid.gpx
- Added comprehensive alcotest suite (58 passing tests):
* Unix vs Eio equivalence testing
* Round-trip testing (write→parse→write consistency)
* Validation testing across all test files
* Performance comparison between backends
* Error handling validation
- Added ppx_expect inline tests for parser validation
**New Eio Implementation:**
- Complete Eio-based I/O layer using real Eio APIs
- Exception-based error handling (vs result-based Unix layer)
- Proper Eio.Path and Eio.Flow integration
- Effects-style example with structured concurrency
- Optional compilation when eio_main available
**Critical XML Fixes:**
- Fixed XML writer namespace declaration format
- Corrected XML header generation (removed double declaration)
- Ensured generated XML correctly parses (round-trip compatibility)
- Fixed attribute namespace handling for GPX schema validation
**Enhanced Documentation:**
- Updated README with three-layer architecture description
- Added comprehensive API examples for both Unix and Eio layers
- Documented all major features and usage patterns
All tests pass: Unix parsing, Eio parsing, cross-backend equivalence,
round-trip validation, and error handling work correctly.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Implemented complete GPX 1.1 parsing and writing library
* Core library (gpx): Portable streaming parser/writer with no Unix dependencies
* Unix layer (gpx_unix): Convenient file I/O and validation functions
* Clean module structure: Types, Parser, Writer, Validate (no gpx_ prefixes)
* Comprehensive documentation with usage examples
* Type-safe coordinate validation and GPS data handling
* Memory-efficient streaming XML processing using xmlm
* Extension support for custom XML elements
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove all remaining duplicate functions from platform modules
- Clean up documentation and module structure
- Fix print_stats in Gpx_eio to use sink capability instead of stdout
- Ensure platform modules focus solely on their I/O concerns
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move Statistics to Core:
- Add Doc.stats type and function (comprehensive GPX statistics)
- Add Doc.pp_stats for pretty-printing statistics using Format
- Remove duplicate stats implementations from Gpx_eio and Gpx_unix
Remove Function Duplication:
- Remove redundant accessor functions (waypoint_coords, track_coords, route_coords)
- Remove duplicate constructor functions (make_track_from_coords, make_route_from_coords)
- Remove duplicate count_points implementations
- Users should call core functions directly (Waypoint.to_floats, Track.to_coords, etc.)
Simplify Platform APIs:
- Platform modules now only contain I/O operations and print_stats
- Gpx_eio.print_stats and Gpx_unix.print_stats use Doc.pp_stats
- Removed unused Result binding operators
- Cleaner, more focused platform-specific functionality
This eliminates code duplication while keeping I/O operations
appropriately separated in platform-specific modules.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Parser Enhancements:
- Add parse_author function with email parsing (id@domain format)
- Add parse_copyright function with year/license support
- Add parse_bounds function with coordinate validation
- Add missing author/copyright/bounds cases to metadata parser
Writer Implementation:
- Replace incomplete writer with full GPX 1.1 spec coverage
- Add support for all metadata elements (author, copyright, bounds, time, links)
- Add support for all waypoint elements (elevation, time, GPS accuracy fields)
- Add support for complete route writing with all fields
- Add support for complete track writing with segments and extensions
- Add proper type conversion for degrees, fix_types, and timestamps
- Add email serialization with id/domain attribute format
API Completeness:
- Add missing accessor functions across all modules:
* Metadata: extensions accessor
* Route: comment, source, links, type_, extensions accessors
* Track: comment, source, links, number, type_, extensions accessors
* Track.Segment: extensions accessor
- Ensure full round-trip capability (parse → write → parse)
Test Fixes:
- Fix test data directory resolution for dune sandbox environments
- Restore correct expectations for author/copyright parsing
- All tests now pass including round-trip validation
The library now provides complete coverage of GPX 1.1 specification
with full parsing and writing capabilities for all elements.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Implement production-ready CLI with convert and info commands
- Add proper ANSI color output and formatting
- Replace all get_ accessors with direct field access pattern
- Remove legacy Gpx_doc module in favor of Doc
- Add comprehensive error handling and validation
- Implement track/route point counting and analysis
- Support waypoint to track conversion with sorting options
- Add detailed GPX file analysis with time range calculation
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Split monolithic types.ml into focused modules for better organization:
- coordinate.ml - GPS coordinate types and validation
- error.ml - GPX error types and handling
- extension.ml - GPX extension support
- gpx_doc.ml - Main GPX document structure
- link.ml - Link/URL types
- metadata.ml - GPX metadata types
- route.ml - Route and route point types
- track.ml - Track and track point types
- waypoint.ml - Waypoint types
Updated all dependent modules to use new modular structure.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace separate *_validated functions with optional validate parameter
across all modules. This provides cleaner API consistency while
maintaining backward compatibility.
Changes:
- Add optional validate parameter to parse/write functions
- Remove separate _validated function variants
- Add utility functions to main Gpx module
- Update examples to use new unified API
- Add GPX example files for testing
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive CLI tool with cmdliner and Eio backend
- Implement waypoint-to-trackset conversion with sorting options
- Add info command with detailed GPX analysis and time range display
- Add GPX 1.0 support alongside existing GPX 1.1 support
- Add ANSI color output with terminal detection using fmt library
- Update documentation with CLI usage examples
- Rename branding from 'MLGpx' to 'mlgpx' throughout
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit adds a complete test infrastructure covering both Unix and Eio
implementations, along with XML writer/parser fixes for proper round-trip
functionality.
**New Test Infrastructure:**
- Created 9 synthetic GPX test files covering diverse features:
* simple_waypoints.gpx, detailed_waypoints.gpx, simple_route.gpx
* simple_track.gpx, multi_segment_track.gpx, comprehensive.gpx
* minimal.gpx, edge_cases.gpx, invalid.gpx
- Added comprehensive alcotest suite (58 passing tests):
* Unix vs Eio equivalence testing
* Round-trip testing (write→parse→write consistency)
* Validation testing across all test files
* Performance comparison between backends
* Error handling validation
- Added ppx_expect inline tests for parser validation
**New Eio Implementation:**
- Complete Eio-based I/O layer using real Eio APIs
- Exception-based error handling (vs result-based Unix layer)
- Proper Eio.Path and Eio.Flow integration
- Effects-style example with structured concurrency
- Optional compilation when eio_main available
**Critical XML Fixes:**
- Fixed XML writer namespace declaration format
- Corrected XML header generation (removed double declaration)
- Ensured generated XML correctly parses (round-trip compatibility)
- Fixed attribute namespace handling for GPX schema validation
**Enhanced Documentation:**
- Updated README with three-layer architecture description
- Added comprehensive API examples for both Unix and Eio layers
- Documented all major features and usage patterns
All tests pass: Unix parsing, Eio parsing, cross-backend equivalence,
round-trip validation, and error handling work correctly.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Implemented complete GPX 1.1 parsing and writing library
* Core library (gpx): Portable streaming parser/writer with no Unix dependencies
* Unix layer (gpx_unix): Convenient file I/O and validation functions
* Clean module structure: Types, Parser, Writer, Validate (no gpx_ prefixes)
* Comprehensive documentation with usage examples
* Type-safe coordinate validation and GPS data handling
* Memory-efficient streaming XML processing using xmlm
* Extension support for custom XML elements
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>