Skip to content

Conversation

@cphyc
Copy link
Member

@cphyc cphyc commented Dec 1, 2025

PR Summary

Fixes #5337. It allows passing a callable in the data dictionary which will only be read when required for lazy-loading.

PR Checklist

  • New features are documented, with docstrings and narrative docs
  • Adds a test for any bugs fixed. Adds tests for new features.

This allows writing data = {'density': lambda: <some function returning data>}
as the parameter when loading an octree with 'yt.load_octree'
@cphyc cphyc changed the title Allow building octree with a function [ENH] Allow building octree with a function Dec 1, 2025
@cphyc cphyc added enhancement Making something better index: octree labels Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Making something better index: octree

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot use function callbacks when loading octrees

1 participant