Skip to content

Planet names - replace generic planet identifiers PL 1 and PL 2 with meaningful planet names …#390

Open
Git4me2day wants to merge 1 commit intobrickbots:mainfrom
Git4me2day:main
Open

Planet names - replace generic planet identifiers PL 1 and PL 2 with meaningful planet names …#390
Git4me2day wants to merge 1 commit intobrickbots:mainfrom
Git4me2day:main

Conversation

@Git4me2day
Copy link

Planet Display Changes

Summary

Two code changes across two files to replace generic planet identifiers
(PL1, PL2) with meaningful planet names in both the object list and
the details/navigation screen.


Change 1 — Object List: Abbreviated Planet Name as Row Label

File: python/PiFinder/ui/object_list.py
Method: create_shortname_text

What it does

Replaces the generic PL1, PL2 row labels in the object list with
3-letter planet abbreviations (e.g. MER, VEN). All other catalogs
are unaffected.

Before

def create_shortname_text(self, obj: CompositeObject) -> str:
    name = f"{obj.catalog_code}{obj.sequence}"
    return name

After

def create_shortname_text(self, obj: CompositeObject) -> str:
    # Use 3-letter abbreviations for planets instead of PL1, PL2, etc.
    # Falls back to full name if planet is not in the dictionary.
    if obj.catalog_code == "PL" and obj.names:
        planet_abbrevs = {
            "Mercury": "MER",
            "Venus":   "VEN",
            "Moon":    "MON",
            "Mars":    "MAR",
            "Jupiter": "JUP",
            "Saturn":  "SAT",
            "Uranus":  "URA",
            "Neptune": "NEP",
            "Pluto":   "PLU",
        }
        return planet_abbrevs.get(obj.names[0], obj.names[0])
    return f"{obj.catalog_code}{obj.sequence}"

Change 2 — Object Details Screen: Full Planet Name as Designator

File: python/PiFinder/composite_object.py
Property: display_name

What it does

display_name drives the header, title bar, and name deduplication on the
Object Details screen. Overriding it here for planets fixes all of those in
one place — the screen now shows Mercury instead of PL 1.

Before

@property
def display_name(self):
    """
    Returns the display name for this object
    """
    return f"{self.catalog_code} {self.sequence}"

After

@property
def display_name(self):
    """
    Returns the display name for this object.
    For the Planet catalog, returns the full planet name (e.g. "Mercury")
    instead of the generic sequence label (e.g. "PL 1").
    """
    # Planets use their common name; all other catalogs use the standard format.
    if self.catalog_code == "PL" and self.names:
        return self.names[0]
    return f"{self.catalog_code} {self.sequence}"

Files Changed

File Method / Property Purpose
python/PiFinder/ui/object_list.py create_shortname_text Abbreviated planet name as list row label
python/PiFinder/composite_object.py display_name Full planet name on Object Details screen

…in both the object list and the details/navigation screen
@Git4me2day Git4me2day changed the title Planet names - replace generic planet identifiers (, ) with meaningful planet names … Planet names - replace generic planet identifiers PL 1 and PL 2 with meaningful planet names … Mar 3, 2026
@Git4me2day
Copy link
Author

Please hold on processing this PR, I may have found an issue. I’ll update with more details once I have finished my analysis.

@Git4me2day
Copy link
Author

Everything looks good, I was just dealing with some low RaspPi power throttling issues which have been resolved. Go ahead and continue with the PR process.

@Git4me2day
Copy link
Author

Git4me2day commented Mar 5, 2026

I didn't have any errors in test mode but during my under the sky testing I'm getting this error:

$ sudo systemctl status pifinder
● pifinder.service - PiFinder
Loaded: loaded (/lib/systemd/system/pifinder.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2026-03-04 20:05:34 EST; 20s ago
Process: 1069 ExecStart=/usr/bin/python -m PiFinder.main (code=exited, status=1/FAILURE)
Main PID: 1069 (code=exited, status=1/FAILURE)
CPU: 2min 21.235s

Mar 04 20:05:34 pifinder python[1069]: File "/home/pifinder/PiFinder/python/PiFinder/ui/object_details.py", line 108, in init
Mar 04 20:05:34 pifinder python[1069]: self.update_object_info()
Mar 04 20:05:34 pifinder python[1069]: File "/home/pifinder/PiFinder/python/PiFinder/ui/object_details.py", line 224, in update_object_info
Mar 04 20:05:34 pifinder python[1069]: self.config_object.equipment.calc_tfov(),
Mar 04 20:05:34 pifinder python[1069]: File "/home/pifinder/PiFinder/python/PiFinder/equipment.py", line 141, in calc_tfov
Mar 04 20:05:34 pifinder python[1069]: return eyepiece.field_stop / telescope.focal_length_mm * 57.2958
Mar 04 20:05:34 pifinder python[1069]: TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'
Mar 04 20:05:34 pifinder systemd[1]: pifinder.service: Main process exited, code=exited, status=1/FAILURE
Mar 04 20:05:34 pifinder systemd[1]: pifinder.service: Failed with result 'exit-code'.

This was not my code causing the issue, I just stumbled on to it as I had added some eyepieces with "None" in the "Field Stop" Field. I'll be checking if this has been reported and make a Bug report accordingly. So far my under sky testing is going very well.

@mrosseel
Copy link
Collaborator

mrosseel commented Mar 5, 2026

hi,

Thx for your efforts, the PR as it is is fine - although I had something a bit more in mind for this change. Nothing wrong with merging this and improving later of course. My idea was that for each object, we indicate if it's catalog name leading or display name leading, so we can fix this for all catalogs.
E.G NGC is CNL (catalog name leading), but planets is DNL. Other display name leading catalogs could be 'bright stars', 'comets' (although this is the case now already), asteroids (if they come) and maybe catalogs like WDS who have no natural catalog name.

@brickbots
Copy link
Owner

@Git4me2day Let us know if you want to merge this as is, or if you want to tackle the more general case of marking either individual objects, or whole catalogs, as 'Display Name Leading'.

If you want to tackle the broader issue for any catalog, let me know and I can write a quick specification and provide some pointers on where you may want to think about making changes.

If not, we can get this merged so people can get some planet name love ASAP.

@Git4me2day
Copy link
Author

@Git4me2day Let us know if you want to merge this as is, or if you want to tackle the more general case of marking either individual objects, or whole catalogs, as 'Display Name Leading'.

If you want to tackle the broader issue for any catalog, let me know and I can write a quick specification and provide some pointers on where you may want to think about making changes.

I’m very interested in looking at and making the more global Name leading updates. I’m headed for the Staunton River Star Party on the 16th and will be back home on the 22nd but when I get back, I can dive back in to the code. So you’ll have a bit of time to write up the specifications and other information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants