Skip to main content

read_attribute

Method of HDF5File.

Overloads

NameDescription
read_attribute(const string path, const string name, as_string type) -> ObjectReads a string scalar attribute.
read_attribute(const string path, const string name, as_complex type) -> ObjectReads a complex scalar attribute.
read_attribute(const string path, const string name, as_real type) -> ObjectReads a real scalar attribute.
read_attribute(const string path, const string name, as_integer type) -> ObjectReads a integer scalar attribute.
read_attribute(const string path, const string name, as_string | as_list type) -> ListReads a string list attribute.
read_attribute(const string path, const string name, as_complex | as_list type) -> ListReads a complex list attribute.
read_attribute(const string path, const string name, as_bool type) -> ObjectReads a bool scalar attribute.
read_attribute(const string path, const string name, as_real | as_list type) -> ListReads a real list attribute.
read_attribute(const string path, const string name, as_integer | as_list type) -> ListReads a integer list attribute.
read_attribute(const string path, const string name, as_bool | as_list type) -> ListReads a bool list attribute.

read_attribute(const string path, const string name, as_string type) -> Object

Reads a string scalar attribute.

Parameters

  • path: Object path ("/" for file-level attributes).
  • name: Attribute name.
  • type: Type tag (as_string).

Example

var f = HDF5File("data.h5")
var value = f.read_attribute("/", "creator", as_string)

read_attribute(const string path, const string name, as_complex type) -> Object

Reads a complex scalar attribute.

Parameters

  • path: Object path ("/" for file-level attributes).
  • name: Attribute name.
  • type: Type tag (as_complex).

Example

var f = HDF5File("data.h5")
var value = f.read_attribute("/", "creator", as_complex)

read_attribute(const string path, const string name, as_real type) -> Object

Reads a real scalar attribute.

Parameters

  • path: Object path ("/" for file-level attributes).
  • name: Attribute name.
  • type: Type tag (as_real).

Example

var f = HDF5File("data.h5")
var value = f.read_attribute("/", "creator", as_real)

read_attribute(const string path, const string name, as_integer type) -> Object

Reads a integer scalar attribute.

Parameters

  • path: Object path ("/" for file-level attributes).
  • name: Attribute name.
  • type: Type tag (as_integer).

Example

var f = HDF5File("data.h5")
var value = f.read_attribute("/", "creator", as_integer)

read_attribute(const string path, const string name, as_string | as_list type) -> List

Reads a string list attribute.

Parameters

  • path: Object path ("/" for file-level attributes).
  • name: Attribute name.
  • type: Type tag (as_string | as_list).

Example

var f = HDF5File("data.h5")
var values = f.read_attribute("/list", "weights", as_string | as_list)

read_attribute(const string path, const string name, as_complex | as_list type) -> List

Reads a complex list attribute.

Parameters

  • path: Object path ("/" for file-level attributes).
  • name: Attribute name.
  • type: Type tag (as_complex | as_list).

Example

var f = HDF5File("data.h5")
var values = f.read_attribute("/list", "weights", as_complex | as_list)

read_attribute(const string path, const string name, as_bool type) -> Object

Reads a bool scalar attribute.

Parameters

  • path: Object path ("/" for file-level attributes).
  • name: Attribute name.
  • type: Type tag (as_bool).

Example

var f = HDF5File("data.h5")
var value = f.read_attribute("/", "creator", as_bool)

read_attribute(const string path, const string name, as_real | as_list type) -> List

Reads a real list attribute.

Parameters

  • path: Object path ("/" for file-level attributes).
  • name: Attribute name.
  • type: Type tag (as_real | as_list).

Example

var f = HDF5File("data.h5")
var values = f.read_attribute("/list", "weights", as_real | as_list)

read_attribute(const string path, const string name, as_integer | as_list type) -> List

Reads a integer list attribute.

Parameters

  • path: Object path ("/" for file-level attributes).
  • name: Attribute name.
  • type: Type tag (as_integer | as_list).

Example

var f = HDF5File("data.h5")
var values = f.read_attribute("/list", "weights", as_integer | as_list)

read_attribute(const string path, const string name, as_bool | as_list type) -> List

Reads a bool list attribute.

Parameters

  • path: Object path ("/" for file-level attributes).
  • name: Attribute name.
  • type: Type tag (as_bool | as_list).

Example

var f = HDF5File("data.h5")
var values = f.read_attribute("/list", "weights", as_bool | as_list)