Migration Guide
This guide helps you migrate your code when upgrading between major versions of AsteroidShapeModels.jl.
Migrating to v0.4.2
New Performance Features
Face Maximum Elevation Optimization
The v0.4.2 release includes automatic performance optimizations for illumination calculations. No code changes are required to benefit from these improvements.
# Your existing code works as before, but ~2.5x faster!
illuminated = isilluminated(shape, sun_position, face_idx; with_self_shadowing=true)To disable the optimization (not recommended):
# Explicitly disable optimization
illuminated = isilluminated(
shape, sun_position, face_idx;
with_self_shadowing=true,
use_elevation_optimization=false,
)Migrating to v0.4.1
Breaking Changes
New apply_eclipse_shadowing! API
The parameter order has been changed for better SPICE integration:
# Old API (deprecated)
apply_eclipse_shadowing!(illuminated_faces, shape1, r☉₁, R₁₂, t₁₂, shape2)
# New API (recommended)
apply_eclipse_shadowing!(illuminated_faces, shape1, shape2, r☉₁, r₁₂, R₁₂)Key differences:
shape1andshape2are now grouped togetherr₁₂(shape2's position in shape1's frame) replacest₁₂- More intuitive parameter ordering
Migration example:
# If you have t₁₂, convert it to r₁₂:
r₁₂ = -R₁₂' * t₁₂
# Then use the new API:
apply_eclipse_shadowing!(illuminated, shape1, shape2, sun_position, r₁₂, R₁₂)Migrating to v0.4.0
New Unified Illumination API
The illumination functions have been unified into a single API:
# Old APIs (removed)
isilluminated_pseudoconvex(shape, sun_position, face_idx)
isilluminated_with_self_shadowing(shape, sun_position, face_idx)
# New unified API
isilluminated(shape, sun_position, face_idx; with_self_shadowing=false) # pseudo-convex
isilluminated(shape, sun_position, face_idx; with_self_shadowing=true) # with shadowingBatch Processing
New batch processing functions for better performance:
# Process all faces at once
illuminated = Vector{Bool}(undef, length(shape.faces))
update_illumination!(illuminated, shape, sun_position; with_self_shadowing=true)Future Deprecations (v0.5.0)
Planned Removals
use_elevation_optimizationparameter- Will be removed in v0.5.0
- Optimization will become the default behavior
- Start removing explicit
use_elevation_optimization=truefrom your code
Old
apply_eclipse_shadowing!signature- The deprecated signature with
t₁₂will be removed - Migrate to the new API with
r₁₂parameter
- The deprecated signature with
Getting Help
If you encounter issues during migration:
- Check the CHANGELOG for detailed changes
- Review the API documentation
- Open an issue on GitHub