Skip to content

metadata access counter; closes #3472 - #3475

Open
petrelharp wants to merge 2 commits into
tskit-dev:mainfrom
petrelharp:metadata_cache
Open

metadata access counter; closes #3472#3475
petrelharp wants to merge 2 commits into
tskit-dev:mainfrom
petrelharp:metadata_cache

Conversation

@petrelharp

Copy link
Copy Markdown
Contributor

As lengthily discussed in #3472, if top-level metadata is large then doing ts.metadata a lot of times can be verrrrry slow, because of both the decoding and making a copy of the data (in roughly equal measure). Seeing no straightforward way around this, I'm proposing this stopgap: if someone does TreeSequence.metadata or TableCollection.metadata 20 times then they get a Warning suggesting they do something else. The warning only occurs once.

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.68%. Comparing base (12b196a) to head (2a49b78).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3475   +/-   ##
=======================================
  Coverage   91.67%   91.68%           
=======================================
  Files          38       38           
  Lines       32188    32214   +26     
  Branches     5151     5157    +6     
=======================================
+ Hits        29509    29535   +26     
  Misses       2346     2346           
  Partials      333      333           
Flag Coverage Δ
C 82.23% <ø> (ø)
c-python 77.54% <ø> (ø)
python-tests 96.44% <100.00%> (+0.01%) ⬆️
python-tests-no-jit 33.20% <38.46%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Python API 98.73% <100.00%> (+<0.01%) ⬆️
Python C interface 91.23% <ø> (ø)
C library 91.24% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petrelharp
petrelharp requested a review from nspope August 7, 2026 17:32
@petrelharp
petrelharp marked this pull request as ready for review August 7, 2026 17:49
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