Browse Source

fix(position): remove useless altitude argument

BREAKING CHANGE: invoking kosmorro command with the --altitude argument
will now fail with an "unrecognized arguments" error.
tags/v0.3.0
Jérôme Deuchnord 4 years ago
parent
commit
d079fc7b20
No known key found for this signature in database GPG Key ID: BC6F3C345B7D33B0
2 changed files with 3 additions and 6 deletions
  1. +2
    -4
      kosmorro
  2. +1
    -2
      kosmorrolib/data.py

+ 2
- 4
kosmorro View File

@@ -40,7 +40,7 @@ def main():
if day is not None and month is None: if day is not None and month is None:
month = date.today().month month = date.today().month


ephemeris = EphemeridesComputer(Position(args.latitude, args.longitude, altitude=args.altitude))
ephemeris = EphemeridesComputer(Position(args.latitude, args.longitude))
ephemerides = ephemeris.compute_ephemerides(year, month, day) ephemerides = ephemeris.compute_ephemerides(year, month, day)


dump = output_formats[args.format](ephemerides, date(year, month, day)) dump = output_formats[args.format](ephemerides, date(year, month, day))
@@ -84,7 +84,7 @@ def get_args(output_formats: [str]):
parser = argparse.ArgumentParser(description='Compute the ephemerides for a given date, at a given position' parser = argparse.ArgumentParser(description='Compute the ephemerides for a given date, at a given position'
' on Earth.', ' on Earth.',
epilog='By default, the ephemerides will be computed for today (%s) for an' epilog='By default, the ephemerides will be computed for today (%s) for an'
' observer positioned at coordinates (0,0), with an altitude of 0.'
' observer positioned at coordinates (0,0).'
% today.strftime('%a %b %d, %Y')) % today.strftime('%a %b %d, %Y'))


parser.add_argument('--version', '-v', dest='special_action', action='store_const', const=output_version, parser.add_argument('--version', '-v', dest='special_action', action='store_const', const=output_version,
@@ -97,8 +97,6 @@ def get_args(output_formats: [str]):
help="The observer's latitude on Earth") help="The observer's latitude on Earth")
parser.add_argument('--longitude', '-lon', type=float, default=0., parser.add_argument('--longitude', '-lon', type=float, default=0.,
help="The observer's longitude on Earth") help="The observer's longitude on Earth")
parser.add_argument('--altitude', '-alt', type=float, default=0.,
help="The observer's altitude on Earth")
parser.add_argument('--day', '-d', type=int, default=today.day, parser.add_argument('--day', '-d', type=int, default=today.day,
help='A number between 1 and 28, 29, 30 or 31 (depending on the month). The day you want to ' help='A number between 1 and 28, 29, 30 or 31 (depending on the month). The day you want to '
' compute the ephemerides for. Defaults to %d (the current day).' % today.day) ' compute the ephemerides for. Defaults to %d (the current day).' % today.day)


+ 1
- 2
kosmorrolib/data.py View File

@@ -61,10 +61,9 @@ class MoonPhase:




class Position: class Position:
def __init__(self, latitude: float, longitude: float, altitude: float = 0):
def __init__(self, latitude: float, longitude: float):
self.latitude = latitude self.latitude = latitude
self.longitude = longitude self.longitude = longitude
self.altitude = altitude
self.observation_planet = None self.observation_planet = None


def get_planet_topos(self) -> Topos: def get_planet_topos(self) -> Topos:


Loading…
Cancel
Save