Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make data loading more efficient by opening each source file once only #712

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

davidorme
Copy link
Collaborator

Description

This PR updates the core.Date.load_data_config method to group data variables by their source file. The load_to_dataarray function and readers in core.readers are then also updated to take a list of variable names rather than just a single variable name and return a dictionary of loaded data arrays keyed by variable name.

The tests and docs are also updated to the new syntax and a few extra tests of multiple loading are included.

Fixes #711

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • Make sure you've run the pre-commit checks: $ pre-commit run -a
  • All tests pass: $ poetry run pytest

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works
  • Relevant documentation reviewed and updated

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.73%. Comparing base (97ee94b) to head (52c44aa).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #712   +/-   ##
========================================
  Coverage    94.72%   94.73%           
========================================
  Files           73       73           
  Lines         4930     4939    +9     
========================================
+ Hits          4670     4679    +9     
  Misses         260      260           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

The Data.load_data_config and loaders open and close each file for each variable
2 participants