Skip to content

Add Harris Globular Cluster catalog loader#384

Merged
brickbots merged 4 commits intobrickbots:mainfrom
casazza:harris-pr
Feb 28, 2026
Merged

Add Harris Globular Cluster catalog loader#384
brickbots merged 4 commits intobrickbots:mainfrom
casazza:harris-pr

Conversation

@casazza
Copy link

@casazza casazza commented Feb 17, 2026

Second attempt to deliver a pull request with the 8 files involved in adding the Harris Globular Catalog to PiFinder.

@brickbots
Copy link
Owner

brickbots commented Feb 17, 2026

Hi @casazza this is looking great! One thing that seems to be missing is the pifinder_objects.db file. This file is what is generated from the all the various imports and is read at runtime by the PiFinder software. When adding a new catalog, adding the updated version of the database (along with the menu changes) is what actually makes the catalog available 🎉

Please go ahead and run the catalog_imports.main module to generate the pifinder_objects.db file and add it along with this PR.

Copy link
Owner

@brickbots brickbots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few typing issues here, which can be pretty annoying. I think only the 'any' vs 'Any' will cause issues and need to be fixed before this can be merged, but please let me know if this is getting too in the weeds for you and we can merge this and I'll fix up any type related issues

for (start, end), (_, field_dtype) in zip(col_specs, dtype)
)

def parse_field(value: str, field_dtype: str) -> any:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your type annotations are really welcome.... but they are using some typing features from newer versions of python and are failing the mypy tests and will likely error in 3.9. For 3.9 compatibility can use:
from typing import Any

and use 'Any' as the return value 👍

Returns:
dict with ra, dec, mag, size, catalog_names, common_names, description, primary_name
"""
result: Dict[str, any] = {}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is another place you can swap for Any

result["primary_name"]: str = f"Har {seq}"

# Process catalog ID (first field)
cluster_id = entry["ID"].strip()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might want entry["ID"].item().strip() here?

logging.info("Loading Harris Globular Cluster catalog")
catalog: str = "Har"
obj_type: str = "Gb" # Globular Cluster
conn, _ = objects_db.get_conn_cursor()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm.. mypy is going to complain a bit here due to the way that objects_db is defined/initialized. This is not really a problem that you want to fix in this PR (unless you do!) so I'd suggest leaving this function untyped to avoid mypy checking it

If you remove the -> None: from the function definition, it will be an untyped function and mypy will happily ignore it 👍

@casazza
Copy link
Author

casazza commented Feb 17, 2026 via email

@mrosseel mrosseel mentioned this pull request Feb 21, 2026
Copy link
Author

@casazza casazza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Third times the charm.

Unit test updated to expect 20 catalogs
harris_loader corrected to correct catalog sources and remove spaces
corrected database

@brickbots brickbots merged commit 0a44fe3 into brickbots:main Feb 28, 2026
1 check passed
@brickbots
Copy link
Owner

Thank you @casazza !!!!

@casazza casazza deleted the harris-pr branch March 3, 2026 23:06
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.

2 participants