Skip to content

Commit

Permalink
make lazy_nodes public
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Jan 12, 2024
1 parent 9ac27d8 commit bca9b95
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions asdf/_asdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

from . import _compression as mcompression
from . import _display as display
from . import _lazy_nodes, constants, generic_io, reference, schema, treeutil, util, versioning, yamlutil
from . import _node_info as node_info
from . import _version as version
from . import constants, generic_io, lazy_nodes, reference, schema, treeutil, util, versioning, yamlutil
from ._block.manager import Manager as BlockManager
from ._helpers import validate_version
from .config import config_context, get_config
Expand Down Expand Up @@ -879,7 +879,7 @@ def _open_asdf(
lazy_tree = cfg.lazy_tree
if lazy_tree and not _force_raw_types:
obj = AsdfObject()
obj.data = _lazy_nodes.AsdfDictNode(tree, weakref.ref(self))
obj.data = lazy_nodes.AsdfDictNode(tree, weakref.ref(self))
tree = obj
else:
tree = yamlutil.tagged_tree_to_custom_tree(tree, self, _force_raw_types)
Expand Down
2 changes: 1 addition & 1 deletion asdf/_tests/test_lazy_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest

import asdf
from asdf._lazy_nodes import AsdfDictNode, AsdfListNode, AsdfOrderedDictNode
from asdf.lazy_nodes import AsdfDictNode, AsdfListNode, AsdfOrderedDictNode


def test_slice_access():
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions asdf/treeutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import warnings
from contextlib import contextmanager

from . import _lazy_nodes, tagged
from . import lazy_nodes, tagged
from .exceptions import AsdfWarning

__all__ = ["walk", "iter_tree", "walk_and_modify", "get_children", "is_container", "PendingValue", "RemoveNode"]
Expand Down Expand Up @@ -287,7 +287,7 @@ def _handle_callback(node, json_id):
return _handle_generator(result)

def _handle_mapping(node, json_id):
if isinstance(node, _lazy_nodes.AsdfDictNode):
if isinstance(node, lazy_nodes.AsdfDictNode):
result = {}
else:
result = node.__class__()
Expand Down Expand Up @@ -321,7 +321,7 @@ def _handle_mapping(node, json_id):
del result[key]

def _handle_mutable_sequence(node, json_id):
if isinstance(node, _lazy_nodes.AsdfListNode):
if isinstance(node, lazy_nodes.AsdfListNode):
result = []
else:
result = node.__class__()
Expand Down

0 comments on commit bca9b95

Please sign in to comment.