MCPcopy Index your code
hub / github.com/PyTables/PyTables / set_node_attr

Method set_node_attr

tables/file.py:2007–2038  ·  view source on GitHub ↗

Set a PyTables attribute for the given node. Parameters ---------- where, name These arguments work as in :meth:`File.get_node`, referencing the node to be acted upon. attrname The name of the attribute to set. attrvalue

(
        self,
        where: Node | str,
        attrname: str,
        attrvalue: Any,
        name: str | None = None,
    )

Source from the content-addressed store, hash-verified

2005 return obj._f_getattr(attrname)
2006
2007 def set_node_attr(
2008 self,
2009 where: Node | str,
2010 attrname: str,
2011 attrvalue: Any,
2012 name: str | None = None,
2013 ) -> None:
2014 """Set a PyTables attribute for the given node.
2015
2016 Parameters
2017 ----------
2018 where, name
2019 These arguments work as in
2020 :meth:`File.get_node`, referencing the node to be acted upon.
2021 attrname
2022 The name of the attribute to set.
2023 attrvalue
2024 The value of the attribute to set. Any kind of Python
2025 object (like strings, ints, floats, lists, tuples, dicts,
2026 small NumPy objects ...) can be stored as an attribute.
2027 However, if necessary, pickle is automatically used so as
2028 to serialize objects that you might want to save.
2029 See the :class:`AttributeSet` class for details.
2030
2031 Notes
2032 -----
2033 If the node already has a large number of attributes, a
2034 PerformanceWarning is issued.
2035
2036 """
2037 obj = self.get_node(where, name=name)
2038 obj._f_setattr(attrname, attrvalue)
2039
2040 def del_node_attr(
2041 self, where: Node | str, attrname: str, name: str | None = None

Callers 14

test16_fileAttrROMethod · 0.80
test21b_attrsOfNodeMethod · 0.80
test01_setAttributesMethod · 0.80
check_nameMethod · 0.80
setUpMethod · 0.80
test_openFileAMethod · 0.80
test_openFileRWMethod · 0.80
test_newFileMethod · 0.80
test_readNewFileWMethod · 0.80
test_readNewFileAMethod · 0.80
_create_fileMethod · 0.80
test_openFileAMethod · 0.80

Calls 2

get_nodeMethod · 0.95
_f_setattrMethod · 0.80

Tested by 14

test16_fileAttrROMethod · 0.64
test21b_attrsOfNodeMethod · 0.64
test01_setAttributesMethod · 0.64
check_nameMethod · 0.64
setUpMethod · 0.64
test_openFileAMethod · 0.64
test_openFileRWMethod · 0.64
test_newFileMethod · 0.64
test_readNewFileWMethod · 0.64
test_readNewFileAMethod · 0.64
_create_fileMethod · 0.64
test_openFileAMethod · 0.64