ansys.dyna.core.lib.table_card.TableCard#

class ansys.dyna.core.lib.table_card.TableCard(fields: List[ansys.dyna.core.lib.card.Field], length_func, active_func: Callable = None, name: str = None, format: ansys.dyna.core.lib.format_type.format_type = format_type.default, **kwargs)#

Bases: ansys.dyna.core.lib.card.Card

A Card represents a single line of data in a keyword.

This implementation separates schema (shared) from values (per-instance) for memory efficiency and faster loading of keywords with many cards.

classmethod from_field_schemas(field_schemas: Tuple[ansys.dyna.core.lib.field_schema.FieldSchema, Ellipsis], length_func: Callable, active_func: Callable = None, name: str = None, format: ansys.dyna.core.lib.format_type.format_type = format_type.default, **kwargs) TableCard#

Create a TableCard from FieldSchema tuples.

This is the preferred way to create TableCard instances as it avoids creating intermediate Field objects.

Parameters:
field_schemasTuple[FieldSchema, …]

Tuple of FieldSchema objects defining the card structure.

length_funccallable()

Function returning the number of rows, or None for unbounded.

active_funccallable(), optional

Function returning bool to determine if card is active.

namestr, optional

Name for table initialization from kwargs.

formatformat_type, optional

The format type (default, standard, or long).

Returns:
TableCard

A new TableCard instance.

property table: pandas.DataFrame#

Get the table as a pandas DataFrame.

property format: ansys.dyna.core.lib.format_type.format_type#

Format type of the table card.

read(buf: TextIO, parameter_set: ansys.dyna.core.lib.parameters.ParameterSet = None) None#

Read the table card content from a buffer.

write(format: ansys.dyna.core.lib.format_type.format_type | None = None, buf: TextIO | None = None, comment: bool | None = True, retain_parameters: bool = False, parameter_set: ansys.dyna.core.lib.parameters.ParameterSet = None, uri_prefix: str = None, **kwargs) str#

Write the table card to a string or buffer.

property bounded: bool#

Indicates whether the card is bounded.

__repr__() str#

Returns a console-friendly representation of the desired parameters for the card