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.CardA 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_schemas
Tuple[FieldSchema, …] Tuple of FieldSchema objects defining the card structure.
- length_func
callable() Function returning the number of rows, or None for unbounded.
- active_func
callable(),optional Function returning bool to determine if card is active.
- name
str,optional Name for table initialization from kwargs.
- format
format_type,optional The format type (default, standard, or long).
- field_schemas
- Returns:
TableCardA 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.