astronomy-commons / astronomy-commons/lsdb
Joined catalog doesn't have margin cache
- Dominant language
- Python
- Stars
- 55
- Forks
- 26
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 8
Description
**Bug report**
I have two catalogs, both with margin caches. However the joined catalog (`left.join(right)`) doesn't have a margin cache.
Code example (fails), on PSC
```python
from pathlib import Path
import lsdb
HIPSCAT_PATH = Path('/ocean/projects/phy210048p/shared/hipscat/catalogs/')
gaia_distances = lsdb.read_hipscat(
HIPSCAT_PATH / 'gaia_dr3' / 'gaia_edr3_distances',
# str() due to https://github.com/astronomy-commons/lsdb/issues/380
margin_cache = str(HIPSCAT_PATH / 'gaia_dr3' / 'gaia_edr3_distances_10arcs'),
columns=['source_id', 'r_med_geo']
)
gaia = lsdb.read_hipscat(
HIPSCAT_PATH / 'gaia_dr3' / 'gaia',
# str() due to https://github.com/astronomy-commons/lsdb/issues/380
margin_cache=str(HIPSCAT_PATH / 'gaia_dr3' / 'gaia_10arcs'),
columns=['source_id', 'pm'],
)
joined = gaia.join(gaia_distances, left_on='source_id', right_on='source_id')
assert joined.margin is not None
```
The current workaround is performing join after cross-matching.
**Before submitting**
Please check the following:
- [x] I have described the situation in which the bug arose, including what code was executed, information about my environment, and any applicable data others will need to reproduce the problem.
- [x] I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a descriprion of what I expected instead.
- [ ] If I have a solution in mind, I have provided an explanation and/or pseudocode and/or task list.
Contributor guide
No contributing guide indexed for this repository
Research direction
Run the provided Python reproduction using Catalog.join via gaia.join(gaia_distances, ...), then inspect the join entry point and how the margin attribute is propagated. Locate the existing join tests and add coverage for two catalogs with margin caches; done means the joined catalog has a non-None margin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100