Skip to content

Error when handling CircumpolarError in solar calculations #9514

Closed as not planned

Description

@slemesp

When handling CircumpolarError in solar calculations, the following code snippet raises a TypeError: unsupported operand type(s) for +: 'ephem.Date' and 'datetime.timedelta'

except self.ephem.CircumpolarError: # pragma: no cover
# Sun won't rise/set today. Check again tomorrow
# (specifically, after the next anti-transit).
next_utc = (
self.cal.next_antitransit(self.ephem.Sun()) +
timedelta(minutes=1)
)

The error occurs because self.cal.next_antitransit(self.ephem.Sun()) returns an ephem.Date object, which cannot be directly added to a datetime.timedelta object.

Activity

  1. auvipy commented on Jan 28, 2025

    @auvipy
    Member

    you should have follow a project issue template. also can you please elaborate more regarding your usage?

  2. added this to the 5.7.0 milestone on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions