A library that computes the ephemerides.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

exceptions.py 644 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env python3
  2. from datetime import date
  3. class UnavailableFeatureError(RuntimeError):
  4. def __init__(self, msg: str):
  5. super().__init__()
  6. self.msg = msg
  7. class OutOfRangeDateError(RuntimeError):
  8. def __init__(self, min_date: date, max_date: date):
  9. super().__init__()
  10. self.min_date = min_date
  11. self.max_date = max_date
  12. self.msg = "The date must be between %s and %s" % (
  13. min_date.strftime("%Y-%m-%d"),
  14. max_date.strftime("%Y-%m-%d"),
  15. )
  16. class CompileError(RuntimeError):
  17. def __init__(self, msg):
  18. super().__init__()
  19. self.msg = msg