Compare commits

..
Author SHA1 Message Date
Lt. Byte
23b67e3f60 chore(safety): escape pod batteries charged 2026-10-15 01:53:00 +02:00
Lt. Byte
25e29539ee chore(hull): hull inspection, no leaks 2026-10-14 14:36:00 +02:00
Lt. Byte
dc213505e7 chore(engines): fuel lines checked for leaks 2026-10-14 01:01:00 +02:00
Ensign Pixel
9a8678cdda fix(routes): correct distance from Venus to Mercury 2026-10-13 16:43:00 +02:00
Ensign Pixel
2a93d5d9c8 chore(engines): fuel lines checked for leaks 2026-10-13 06:51:00 +02:00
Ensign Pixel
9c4da2db4a chore(engines): thrusters test-fired 2026-10-12 19:25:00 +02:00
Ensign Pixel
b2ff61070b feat(nav): add --all option 2026-10-12 10:39:00 +02:00
Lt. Byte
33e91d77cd chore(comms): antenna realigned 2026-10-11 22:30:00 +02:00
Captain Vega
2f788482f6 chore(life-support): cabin pressure sensors tested 2026-10-11 13:49:00 +02:00
Ensign Pixel
9415cffb0a chore(engines): thrusters test-fired 2026-10-11 09:06:00 +02:00
Cmdr. Nova
2269d6a13a chore(galley): galley fridge defrosted 2026-10-10 21:30:00 +02:00
Cmdr. Nova
5d4d5d1526 chore(airlock): airlock seals checked 2026-10-10 10:13:00 +02:00
Cmdr. Nova
1e44e0f344 chore(galley): galley fridge defrosted 2026-10-09 21:39:00 +02:00
Cmdr. Nova
c0b274698d fix(routes): correct distance from Titan to Pluto 2026-10-09 11:52:00 +02:00
Cmdr. Nova
5ee71e2189 fix(nav): update remaining call of plot_course() 2026-10-09 00:05:00 +02:00
Cmdr. Nova
a14a63dca3 refactor(nav): rename plan() to plot_course() 2026-10-08 19:56:00 +02:00
Lt. Byte
07cef1f5ac chore(engines): thrusters test-fired 2026-10-08 13:24:00 +02:00
Lt. Byte
4f037e2459 chore(life-support): cabin pressure sensors tested 2026-10-08 07:20:00 +02:00
Lt. Byte
9d383fb005 chore(coffeed): coffee machine descaled 2026-10-07 20:23:00 +02:00
Cmdr. Nova
197f0e01a1 fix(routes): correct distance from Ceres to Europa 2026-10-07 10:37:00 +02:00
Cmdr. Nova
43cbfb78e5 chore(life-support): oxygen scrubbers replaced 2026-10-07 00:47:00 +02:00
Cmdr. Nova
c0288e3488 chore(morale): debugging duck accounted for 2026-10-06 12:51:00 +02:00
Lt. Byte
d4267196a4 chore(life-support): water recycling filters replaced 2026-10-06 02:02:00 +02:00
Lt. Byte
5654431e70 chore(hull): hull inspection, no leaks 2026-10-05 19:22:00 +02:00
Ensign Pixel
28d3ee65ad chore(safety): fire extinguishers checked 2026-10-05 06:16:00 +02:00
Ensign Pixel
8e008d5304 chore(engines): fuel lines checked for leaks 2026-10-05 00:57:00 +02:00
Captain Vega
8289259265 chore(nav): remove warp drive support
We do not have a warp drive.
2026-10-04 12:39:00 +02:00
Dr. Honk
18a0ff5717 wip: calibrate warp drive 2026-10-04 03:38:00 +02:00
Dr. Honk
14b76e1faf feat(nav): experimental warp drive support 2026-10-03 18:19:00 +02:00
Lt. Byte
7e96c15f69 chore(lights): navigation lights checked 2026-10-03 04:33:00 +02:00
Lt. Byte
58a306da64 chore(safety): escape pod batteries charged 2026-10-02 13:37:00 +02:00
Lt. Byte
3da120fd28 style(nav): add type hints 2026-10-01 23:55:00 +02:00
Lt. Byte
3d44015183 chore(life-support): cabin pressure sensors tested 2026-10-01 10:23:00 +02:00
Lt. Byte
71286bf151 fix(routes): correct distance from Mars to Ceres 2026-09-30 20:40:00 +02:00
Captain Vega
5415839361 chore(lights): navigation lights checked 2026-09-30 16:02:00 +02:00
Dr. Honk
9a793ef77b feat(routes): add Pluto (it still counts for us) 2026-09-30 08:21:00 +02:00
Dr. Honk
0ec9ac0388 perf(nav): compute legs lazily
No need to build a whole list every time.
2026-09-29 23:51:00 +02:00
Ensign Pixel
6bcd1dfca6 feat(routes): add Enceladus 2026-09-29 16:44:00 +02:00
Cmdr. Nova
efe4f989a3 feat(routes): add Titan 2026-09-29 10:35:00 +02:00
Ensign Pixel
3af901eede feat(routes): add Callisto 2026-09-29 04:03:00 +02:00
Lt. Byte
d3d2538783 chore(hull): hull inspection, no leaks 2026-09-28 21:15:00 +02:00
Lt. Byte
51f402b149 chore(nav): gyroscopes recalibrated 2026-09-28 14:42:00 +02:00
Cmdr. Nova
09aee14ce1 feat(routes): add Ganymede 2026-09-28 03:48:00 +02:00
Ensign Pixel
b8638ea0be chore(comms): comms backup tested 2026-09-27 16:31:00 +02:00
Ensign Pixel
9e8007da96 chore(safety): escape pod batteries charged 2026-09-27 06:19:00 +02:00
Ensign Pixel
ef68b32367 docs(readme): document --list 2026-09-26 19:16:00 +02:00
Ensign Pixel
4c1b363e52 feat(routes): add Io 2026-09-26 13:53:00 +02:00
Cmdr. Nova
7b3a33a8d8 feat(routes): add Europa 2026-09-25 23:05:00 +02:00
Ensign Pixel
75bf82b0db feat(routes): add Vesta 2026-09-25 11:34:00 +02:00
Dr. Honk
b80382ca4c feat(routes): add the Restaurant at the End of the Universe 2026-09-25 02:20:00 +02:00
Lt. Byte
4b7daaeef3 chore(galley): galley fridge defrosted 2026-09-24 19:38:00 +02:00
Lt. Byte
69d6213b0a feat(routes): add Ceres 2026-09-24 07:50:00 +02:00
Lt. Byte
32ac7db0b1 chore(safety): escape pod batteries charged 2026-09-23 21:49:00 +02:00
Cmdr. Nova
3c3a858e2b feat(routes): add Mercury 2026-09-23 16:26:00 +02:00
Dr. Honk
69866aa30b feat(nav): route through the asteroid belt 2026-09-23 07:58:00 +02:00
Dr. Honk
149003f869 wip: asteroid belt routing, continued 2026-09-22 20:42:00 +02:00
Dr. Honk
2f5748a5a9 wip: asteroid belt routing 2026-09-22 15:51:00 +02:00
Lt. Byte
74135a2f6f chore(engines): fuel lines checked for leaks 2026-09-22 11:16:00 +02:00
Cmdr. Nova
75c765eb09 chore(nav): gyroscopes recalibrated 2026-09-21 22:19:00 +02:00
Captain Vega
852fd90849 chore(power): solar panels cleaned 2026-09-21 11:32:00 +02:00
Lt. Byte
71ea61b987 chore(life-support): oxygen scrubbers replaced 2026-09-20 22:57:00 +02:00
Captain Vega
4aef25f973 chore(safety): fire extinguishers checked 2026-09-20 16:34:00 +02:00
Ensign Pixel
7a4a8b7193 feat(routes): add Deimos 2026-09-20 05:02:00 +02:00
Dr. Honk
5e3b262382 docs(crew): the debugging duck has a name 2026-09-19 16:16:00 +02:00
Cmdr. Nova
d0aed8fcfb feat(nav): print usage when called without arguments 2026-09-19 01:23:00 +02:00
Cmdr. Nova
f89276f39f chore(safety): fire extinguishers checked 2026-09-18 12:59:00 +02:00
Lt. Byte
d15022ec4e chore(morale): debugging duck accounted for 2026-09-18 07:31:00 +02:00
Cmdr. Nova
41b191ff94 chore(hull): radiation shielding inspected 2026-09-18 02:44:00 +02:00
Lt. Byte
d8e85f81cf chore(life-support): cabin pressure sensors tested 2026-09-17 19:38:00 +02:00
Captain Vega
db86142e81 docs(crew): add mission control 2026-09-17 09:24:00 +02:00
Lt. Byte
515e055375 refactor(nav): extract print_plan() 2026-09-17 05:24:00 +02:00
Captain Vega
803edd6f86 docs(crew): Ensign Pixel is a navigator now 2026-09-16 23:51:00 +02:00
Cmdr. Nova
3da48acf33 chore(comms): antenna realigned 2026-09-16 11:30:00 +02:00
Lt. Byte
0e3f7f5dd4 chore(coffeed): coffee machine descaled 2026-09-16 01:50:00 +02:00
Lt. Byte
367b42ba6b chore(life-support): water recycling filters replaced 2026-09-15 18:10:00 +02:00
Lt. Byte
d13b30ee50 chore(airlock): airlock seals checked 2026-09-15 12:08:00 +02:00
Lt. Byte
0758ca47c7 docs(crew): add coffeed 2026-09-15 03:24:00 +02:00
Ensign Pixel
4552a8a540 docs(readme): fix typo 2026-09-14 16:58:00 +02:00
Lt. Byte
5003acdb3d chore(life-support): water recycling filters replaced 2026-09-14 02:21:00 +02:00
Lt. Byte
9ba9e665de docs(readme): add maintenance section 2026-09-13 14:31:00 +02:00
Captain Vega
a313da141a docs(crew): promote Dr. Honk 2026-09-13 06:04:00 +02:00
Ensign Pixel
901c9caf50 feat(nav): accept destination names in any case 2026-09-12 22:21:00 +02:00
Ensign Pixel
968480e71b wip: case-insensitive destinations 2026-09-12 13:00:00 +02:00
Dr. Honk
6fac0ba2b5 docs(crew): the debugging duck is crew, too 2026-09-11 23:31:00 +02:00
Lt. Byte
50cfe0552a chore(comms): comms backup tested 2026-09-11 09:38:00 +02:00
Captain Vega
feca2ffc74 docs(readme): add a section on contributing 2026-09-11 03:23:00 +02:00
Ensign Pixel
39b347cdf9 chore(morale): debugging duck accounted for 2026-09-10 16:55:00 +02:00
Cmdr. Nova
4c5381065b chore(safety): escape pod batteries charged 2026-09-10 06:05:00 +02:00
Captain Vega
f4fed79b61 chore(power): solar panels cleaned 2026-09-09 18:54:00 +02:00
Lt. Byte
b329abe78e chore(comms): antenna realigned 2026-09-09 11:21:00 +02:00
Cmdr. Nova
1f9f295c48 feat(nav): add --list option 2026-09-08 23:26:00 +02:00
Cmdr. Nova
b9d83cac68 feat(routes): add Phobos 2026-09-08 17:14:00 +02:00
Ensign Pixel
f486acc176 docs(readme): mention that all routes start at Earth 2026-09-08 11:10:00 +02:00
Lt. Byte
ab94a75adf chore(hull): hull inspection, no leaks 2026-09-07 20:48:00 +02:00
Ensign Pixel
2c9ed3bdfe chore(coffeed): coffee machine descaled 2026-09-07 14:19:00 +02:00
Lt. Byte
d3628a4ab6 chore(power): solar panels cleaned 2026-09-07 05:36:00 +02:00
Captain Vega
a836d9806f docs(crew): add Ensign Pixel 2026-09-06 23:52:00 +02:00
Ensign Pixel
659a119421 chore(engines): fuel lines checked for leaks 2026-09-06 15:58:00 +02:00
Ensign Pixel
41e657b6aa docs(nav): add docstrings 2026-09-06 07:44:00 +02:00
Cmdr. Nova
ed677a320b feat(routes): add Venus 2026-09-05 19:37:00 +02:00
Captain Vega
620456dca0 chore(comms): antenna realigned 2026-09-05 08:59:00 +02:00
Ensign Pixel
f85a845685 chore(life-support): water recycling filters replaced 2026-09-05 04:01:00 +02:00
Lt. Byte
4e7cb1c345 chore(life-support): oxygen scrubbers replaced 2026-09-04 18:04:00 +02:00
Captain Vega
9640688cc7 chore(safety): escape pod batteries charged 2026-09-04 06:40:00 +02:00
Lt. Byte
f1348d1987 chore(nav): gyroscopes recalibrated 2026-09-04 00:02:00 +02:00
Lt. Byte
4e43c5e060 feat(nav): helpful error for unknown destinations 2026-09-03 09:47:00 +02:00
Lt. Byte
b07115022a chore(safety): fire extinguishers checked 2026-09-02 19:28:00 +02:00
Lt. Byte
9c8aa1c2c9 chore(comms): antenna realigned 2026-09-02 04:33:00 +02:00
Cmdr. Nova
a6b9b0eb91 chore(safety): escape pod batteries charged 2026-09-01 19:35:00 +02:00
Captain Vega
b061613cd1 docs(crew): add Cmdr. Nova 2026-09-01 14:46:00 +02:00
4 changed files with 161 additions and 9 deletions

View file

@ -1,10 +1,23 @@
# Navigation computer of the SS Probably Fine # Navigation computer of the SS Probably Fine
Computes flight plans for the *SS Probably Fine*: route, distance, Computes flight plans for the *SS Probably Fine*: route, distance,
travel time, and the amout of fuel required. travel time, and the amount of fuel required.
```console ```console
$ python3 nav.py mars $ python3 nav.py mars
``` ```
Requires Python 3.9 or newer; no further dependencies. Requires Python 3.9 or newer; no further dependencies.
All routes start at Earth. Getting back is your own problem.
## Contributing
Use Conventional Commits. Do not push broken code.
(Yes, Dr. Honk, this means you.)
## Maintenance
All maintenance is recorded in `maintenance.md`.
To list all known destinations, run `python3 nav.py --list`.

View file

@ -3,5 +3,10 @@
| Name | Role | | Name | Role |
|------|------| |------|------|
| Captain Vega | Captain | | Captain Vega | Captain |
| Dr. Honk | Ship's doctor | | Dr. Honk | Chief medical officer |
| Lt. Byte | Chief engineer | | Lt. Byte | Chief engineer |
| Cmdr. Nova | Pilot |
| Ensign Pixel | Navigator |
| Quackers, the debugging duck | Morale officer |
| `coffeed` | Beverage officer |
| Mission control | Remote support (does not accept pushes) |

View file

@ -1,3 +1,64 @@
# Maintenance log # Maintenance log
Newest entries at the bottom. Newest entries at the bottom.
- 2026-09-01: Escape pod batteries charged.
- 2026-09-02: Antenna realigned.
- 2026-09-02: Fire extinguishers checked.
- 2026-09-04: Gyroscopes recalibrated.
- 2026-09-04: Escape pod batteries charged.
- 2026-09-04: Oxygen scrubbers replaced.
- 2026-09-05: Water recycling filters replaced.
- 2026-09-05: Antenna realigned.
- 2026-09-06: Fuel lines checked for leaks.
- 2026-09-07: Solar panels cleaned.
- 2026-09-07: Coffee machine descaled.
- 2026-09-07: Hull inspection, no leaks.
- 2026-09-09: Antenna realigned.
- 2026-09-09: Solar panels cleaned.
- 2026-09-10: Escape pod batteries charged.
- 2026-09-10: Debugging duck accounted for.
- 2026-09-11: Comms backup tested.
- 2026-09-14: Water recycling filters replaced.
- 2026-09-15: Airlock seals checked.
- 2026-09-15: Water recycling filters replaced.
- 2026-09-16: Coffee machine descaled.
- 2026-09-16: Antenna realigned.
- 2026-09-17: Cabin pressure sensors tested.
- 2026-09-18: Radiation shielding inspected.
- 2026-09-18: Debugging duck accounted for.
- 2026-09-18: Fire extinguishers checked.
- 2026-09-20: Fire extinguishers checked.
- 2026-09-20: Oxygen scrubbers replaced.
- 2026-09-21: Solar panels cleaned.
- 2026-09-21: Gyroscopes recalibrated.
- 2026-09-22: Fuel lines checked for leaks.
- 2026-09-23: Escape pod batteries charged.
- 2026-09-24: Galley fridge defrosted.
- 2026-09-27: Escape pod batteries charged.
- 2026-09-27: Comms backup tested.
- 2026-09-28: Gyroscopes recalibrated.
- 2026-09-28: Hull inspection, no leaks.
- 2026-09-30: Navigation lights checked.
- 2026-10-01: Cabin pressure sensors tested.
- 2026-10-02: Escape pod batteries charged.
- 2026-10-03: Navigation lights checked.
- 2026-10-05: Fuel lines checked for leaks.
- 2026-10-05: Fire extinguishers checked.
- 2026-10-05: Hull inspection, no leaks.
- 2026-10-06: Water recycling filters replaced.
- 2026-10-06: Debugging duck accounted for.
- 2026-10-07: Oxygen scrubbers replaced.
- 2026-10-07: Coffee machine descaled.
- 2026-10-08: Cabin pressure sensors tested.
- 2026-10-08: Thrusters test-fired.
- 2026-10-09: Galley fridge defrosted.
- 2026-10-10: Airlock seals checked.
- 2026-10-10: Galley fridge defrosted.
- 2026-10-11: Thrusters test-fired.
- 2026-10-11: Cabin pressure sensors tested.
- 2026-10-11: Antenna realigned.
- 2026-10-12: Thrusters test-fired.
- 2026-10-13: Fuel lines checked for leaks.
- 2026-10-14: Fuel lines checked for leaks.
- 2026-10-14: Hull inspection, no leaks.
- 2026-10-15: Escape pod batteries charged.

87
nav.py
View file

@ -2,21 +2,52 @@
"""Navigation computer of the SS Probably Fine. """Navigation computer of the SS Probably Fine.
Usage: python3 nav.py DESTINATION Usage: python3 nav.py DESTINATION
python3 nav.py --list
python3 nav.py --all
""" """
import sys import sys
from collections.abc import Iterator
# Distances between neighboring waypoints, in million km. # Distances between neighboring waypoints, in million km.
DISTANCES = { DISTANCES = {
("earth", "moon"): 0.4, ("earth", "moon"): 0.4,
("earth", "gateway"): 0.4, ("earth", "gateway"): 0.4,
("gateway", "mars"): 225.0, ("gateway", "mars"): 225.0,
("gateway", "venus"): 41.0,
("mars", "phobos"): 0.01,
("mars", "deimos"): 0.02,
("venus", "mercury"): 48.0,
("mars", "ceres"): 265.0,
("gateway", "milliways"): 42.0,
("ceres", "vesta"): 96.0,
("ceres", "europa"): 399.0,
("europa", "io"): 0.25,
("europa", "ganymede"): 0.4,
("ganymede", "callisto"): 0.8,
("europa", "titan"): 655.0,
("titan", "enceladus"): 1.0,
("titan", "pluto"): 4387.0,
} }
# Every route starts at Earth. # Every route starts at Earth.
ROUTES = { ROUTES = {
"moon": ["earth", "moon"], "moon": ["earth", "moon"],
"mars": ["earth", "gateway", "mars"], "mars": ["earth", "gateway", "mars"],
"venus": ["earth", "gateway", "venus"],
"phobos": ["earth", "gateway", "mars", "phobos"],
"deimos": ["earth", "gateway", "mars", "deimos"],
"mercury": ["earth", "gateway", "venus", "mercury"],
"ceres": ["earth", "gateway", "mars", "ceres"],
"milliways": ["earth", "gateway", "milliways"],
"vesta": ["earth", "gateway", "mars", "ceres", "vesta"],
"europa": ["earth", "gateway", "mars", "ceres", "europa"],
"io": ["earth", "gateway", "mars", "ceres", "europa", "io"],
"ganymede": ["earth", "gateway", "mars", "ceres", "europa", "ganymede"],
"callisto": ["earth", "gateway", "mars", "ceres", "europa", "ganymede", "callisto"],
"titan": ["earth", "gateway", "mars", "ceres", "europa", "titan"],
"enceladus": ["earth", "gateway", "mars", "ceres", "europa", "titan", "enceladus"],
"pluto": ["earth", "gateway", "mars", "ceres", "europa", "titan", "pluto"],
} }
NAMES = { NAMES = {
@ -24,6 +55,20 @@ NAMES = {
"moon": "Moon", "moon": "Moon",
"gateway": "Lunar Gateway", "gateway": "Lunar Gateway",
"mars": "Mars", "mars": "Mars",
"venus": "Venus",
"phobos": "Phobos",
"deimos": "Deimos",
"mercury": "Mercury",
"ceres": "Ceres",
"milliways": "Restaurant at the End of the Universe",
"vesta": "Vesta",
"europa": "Europa",
"io": "Io",
"ganymede": "Ganymede",
"callisto": "Callisto",
"titan": "Titan",
"enceladus": "Enceladus",
"pluto": "Pluto",
} }
CRUISE_SPEED = 0.87 # million km per day CRUISE_SPEED = 0.87 # million km per day
@ -31,17 +76,21 @@ FUEL_PER_MKM = 0.142 # tonnes of fuel per million km
LAUNCH_FUEL = 380.0 # tonnes of fuel to escape Earth's gravity LAUNCH_FUEL = 380.0 # tonnes of fuel to escape Earth's gravity
def distance(a, b): def distance(a: str, b: str) -> float:
"""Return the distance between two neighboring waypoints."""
if (a, b) in DISTANCES: if (a, b) in DISTANCES:
return DISTANCES[(a, b)] return DISTANCES[(a, b)]
return DISTANCES[(b, a)] return DISTANCES[(b, a)]
def legs(route): def legs(route: list[str]) -> Iterator[tuple[str, str]]:
return [(route[i], route[i + 1]) for i in range(len(route) - 1)] """Yield the legs (pairs of consecutive waypoints) of a route."""
for i in range(1, len(route) - 1):
yield route[i], route[i + 1]
def plan(destination): def plot_course(destination: str) -> tuple[list[str], float, float, float]:
"""Return route, distance, travel time (days) and fuel (t)."""
route = ROUTES[destination] route = ROUTES[destination]
total = 0.0 total = 0.0
fuel = 0.0 fuel = 0.0
@ -54,14 +103,38 @@ def plan(destination):
return route, total, total / CRUISE_SPEED, fuel return route, total, total / CRUISE_SPEED, fuel
def main(): def asteroid_route(belt: str) -> list[str]:
destination = sys.argv[1] """Return a route through the asteroid belt (currently: via Ceres)."""
route, total, days, fuel = plan(destination) return ROUTES["ceres"] + [belt]
def print_plan(destination: str) -> None:
"""Print the flight plan for a destination."""
route, total, days, fuel = plot_course(destination)
print("Route: " + " -> ".join(NAMES[w] for w in route)) print("Route: " + " -> ".join(NAMES[w] for w in route))
print(f"Distance: {total:.1f} million km") print(f"Distance: {total:.1f} million km")
print(f"Travel time: {round(days)} days") print(f"Travel time: {round(days)} days")
print(f"Fuel required: {round(fuel)} t") print(f"Fuel required: {round(fuel)} t")
def main() -> None:
if len(sys.argv) != 2:
sys.exit(__doc__)
if sys.argv[1] == "--list":
for key in sorted(ROUTES):
print(f"{key:12} {NAMES[key]}")
return
if sys.argv[1] == "--all":
for key in sorted(ROUTES):
print_plan(key)
print()
return
destination = sys.argv[1].lower()
if destination not in ROUTES:
known = ", ".join(sorted(ROUTES))
sys.exit(f"Unknown destination: {destination} (known: {known})")
print_plan(destination)
if __name__ == "__main__": if __name__ == "__main__":
main() main()