Skip to content

Update to new Pangaeapy version - #62

Merged
khider merged 1 commit into
mainfrom
Pangaea-fix
Aug 12, 2026
Merged

Update to new Pangaeapy version#62
khider merged 1 commit into
mainfrom
Pangaea-fix

Conversation

@khider

@khider khider commented Aug 12, 2026

Copy link
Copy Markdown
Member

pangaeapy 1.1.2 changed PanDataSet.events from a list of PanEvent objects to a dict of {eventLabel: PanEvent}. Every place in pyleotups that did for ev in self._panobj.events: was now iterating over dict keys (plain strings) instead of PanEvent objects, so ev.latitude blew up with AttributeError: 'str' object has no attribute 'latitude'. That one change cascaded into _compute_coverage(), get_geo(), and the "Sites" field of to_summary_dict() — which is why search_studies(), get_summary(), get_geo(), get_variables(), get_funding(), and get_publications() all failed (they all end up calling to_summary_dict()).

Fix

Added PangaeaStudy._iter_events() — a small compatibility shim that returns events.values() if events is a dict, else events itself — and routed the three call sites through it instead of touching self._panobj.events directly. This keeps pyleotups working against both the old list-shaped and new dict-shaped events, so it won't silently break again if the pin drifts either direction.

Verified

pyleotups/tests/test_PangaeaDataset.py: 10/10 pass (was 0/10)
Full suite: 121/121 pass, no regressions elsewhere
Confirmed no other .events usage in the codebase bypasses the new helper
No other pangaeapy API shapes (params, projects, relations, supplement_to, collection_members, isCollection, abstract/title/doi/keywords properties) appear to have changed — all those tests were passing already and stayed green.

Manually tested on the tutorials.

AI Use

Fix was made by Claude. Manually checked on the tutorials to ensure proper working conditions.

@khider
khider merged commit 8dc8cd3 into main Aug 12, 2026
1 check passed
@khider
khider deleted the Pangaea-fix branch August 12, 2026 18:53
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.

1 participant