Skip to content

Improve PangaeaDataset behavior, logging, and test compatibility#34

Merged
khider merged 9 commits intomainfrom
bug-fix
Mar 27, 2026
Merged

Improve PangaeaDataset behavior, logging, and test compatibility#34
khider merged 9 commits intomainfrom
bug-fix

Conversation

@doswal
Copy link
Copy Markdown
Collaborator

@doswal doswal commented Mar 24, 2026

Summary

This PR improves the PangaeaDataset implementation by aligning its behavior with NOAADataset, refining logging practices, and updating tests accordingly. It also enhances usability by returning results directly and suppressing noisy third-party logs.


Key Changes

1. Return behavior improvements

  • Updated search_studies() to return a DataFrame instead of None
  • Ensures consistency with NOAADataset
  • Prevents breakage in:
    • existing tests
    • tutorial notebooks
    • documentation workflows

2. Logging refactor

  • Replaced warnings.warn with logger.warning
  • Standardized logging across the module
  • Improved message clarity and consistency

3. Test updates

  • Updated tests to use caplog instead of pytest.warns
  • Ensures compatibility with new logging-based warnings
  • Maintains coverage for warning-triggered scenarios

4. Suppress third-party logging noise

  • Suppressed verbose logs from pangaeapy
  • Prevents debug/info messages from appearing in user-facing output
  • Improves usability and cleaner CLI/notebook experience

5. Additional improvements

  • Made search_studies() behavior consistent across dataset providers
  • Added support for additional kwargs (e.g., data_type)
  • Improved handling of collection datasets and related warnings
  • General cleanup and consistency improvements

Motivation

  • Align behavior across dataset providers (NOAADataset vs PangaeaDataset)
  • Improve user experience (clean output, consistent return types)
  • Modernize logging approach (move away from warnings)
  • Ensure tests remain robust and meaningful

Impact

  • No breaking API changes (behavior is now more consistent)
  • Tests updated accordingly
  • Cleaner logs for users and downstream applications

Testing

  • Existing tests updated and passing
  • Verified:
    • search functionality
    • logging behavior via caplog
    • compatibility with tutorial notebooks

TL;DR

  • search_studies() now returns results
  • warnings → logging
  • tests updated
  • noisy pangaeapy logs suppressed

doswal added 9 commits March 19, 2026 10:12
…s. Making search_studies response consistent
…imple logging breaks previous tests and jupter-execute examples while building documentation. Also good in terms of user perspective to return results]. 2. Updating tests to catch log.warning instead of warnings.warning
@khider khider merged commit e619d11 into main Mar 27, 2026
1 check passed
@khider khider deleted the bug-fix branch March 27, 2026 17:13
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