Skip to content

Commit

Permalink
perf(position): enhance the position performing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérôme Deuchnord committed Dec 1, 2019
1 parent d079fc7 commit 61536da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kosmorrolib/data.py
Expand Up @@ -65,12 +65,17 @@ def __init__(self, latitude: float, longitude: float):
self.latitude = latitude
self.longitude = longitude
self.observation_planet = None
self._topos = None

def get_planet_topos(self) -> Topos:
if self.observation_planet is None:
raise TypeError('Observation planet must be set.')

return self.observation_planet + Topos(latitude_degrees=self.latitude, longitude_degrees=self.longitude)
if self._topos is None:
self._topos = self.observation_planet + Topos(latitude_degrees=self.latitude,
longitude_degrees=self.longitude)

return self._topos


class AsterEphemerides:
Expand Down

0 comments on commit 61536da

Please sign in to comment.