expand_card Module

defines:
  • expand_thru

  • expand_thru_by

pyNastran.bdf.cards.expand_card.expand_thru(fields: List[str], set_fields: bool = True, sort_fields: bool = False) → List[int][source]

Expands a list of values of the form [1,5,THRU,9,13] to be [1,5,6,7,8,9,13]

Parameters
fieldsList[int/str]

the fields to expand

set_fieldsbool; default=True

Should the fields be converted to a set and then back to a list? This is useful for [2, ‘THRU’ 5, 1]

sort_fieldsbool; default=False

Should the fields be sorted at the end?

pyNastran.bdf.cards.expand_card.expand_thru_by(fields: List[str], set_fields: bool = True, sort_fields: bool = True, require_int: bool = True, allow_blanks: bool = False) → List[int][source]

Expands a list of values of the form [1,5,THRU,9,BY,2,13] to be [1,5,7,9,13]

Parameters
fieldsList[int/str]

the fields to expand

set_fieldsbool; default=True

Should the fields be converted to a set and then back to a list to remove duplicates? This is useful for [2, ‘THRU’ 5, 1]

sort_fieldsbool; default=False

Should the fields be sorted at the end?

require_intbool; default=True

True : all data must be integers False : floats are allowed (e.g., DDVAL)

allow_blanksbool; default=Fals

True : blank/Nones are ignored (e.g., NSM1/NSML1) False : crash

.. todo:: not tested

Notes

used for QBDY3 and what else ???