Skip to content

Conversation

@esoteric-ephemera
Copy link
Collaborator

@esoteric-ephemera esoteric-ephemera commented Dec 17, 2025

Enhancements:

Expanding scope of lazy loading to:

  • Lazily load a rester for an endpoint only when it is inspected
  • Lazily initialize a rester only when it is called

Some usage examples for the LazyImport class in tests/core/test_utils.py for how it can be used beyond just the resters

Housekeeping:

Focusing on removing (i) boilerplate repeated code and (ii) extraneous dependencies

  • Remove unused dependencies: msgpack
  • Remove smart_open in favor of basic boto / gzip interactions
  • Remove unused test data which has been ported to emmet
  • Make convenience methods for validating formatting of endpoints
  • Homogenize _query_open_data to throw uniform errors when objects cannot be found

@codecov-commenter
Copy link

codecov-commenter commented Dec 17, 2025

Codecov Report

❌ Patch coverage is 98.67550% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.20%. Comparing base (30adeba) to head (767f4ea).

Files with missing lines Patch % Lines
mp_api/client/core/client.py 95.83% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1044      +/-   ##
==========================================
- Coverage   76.19%   73.20%   -2.99%     
==========================================
  Files          51       51              
  Lines        2798     2665     -133     
==========================================
- Hits         2132     1951     -181     
- Misses        666      714      +48     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@esoteric-ephemera esoteric-ephemera changed the title [WIP] Lazy loading Lazy loading Jan 14, 2026
@esoteric-ephemera
Copy link
Collaborator Author

Just to note that these changes are effective: the tests run in roughly 140-160 sec, brought down from 200-210 sec on main

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.

3 participants