Groups¶
- class Groups(dll: SofDll)¶
Bases:
objectThis class provides methods and a data structure to:
access keys
11/0of the CDB file;store the retrieved data in a convenient format;
provide access to the data after the CDB is closed.
The underlying data structure is a
pandas.DataFramewith the following columns:GROUP"group numberGROUP_NAME"group nmaeBEAM_MIN_ID"beam minimum idBEAM_MAX_ID"beam maximum idNUMBER_OF_BEAMS"number of beamsTRUSS_MIN_ID"truss minimum idTRUSS_MAX_ID"truss maximum idNUMBER_OF_TRUSSES"number of trussesCABLE_MIN_ID"cable minimum idCABLE_MAX_ID"cable maximum idNUMBER_OF_CABLES"number of cablesSPRING_MIN_ID"spring minimum idSPRING_MAX_ID"spring maximum idNUMBER_OF_SPRINGS"number of springsQUAD_MIN_ID"quad minimum idQUAD_MAX_ID"quad maximum idNUMBER_OF_QUADSnumber of quads
The
DataFrameuses a MultiIndex with levelGROUPto enable fast lookups via theget_id_range,get_nameandget_numbermethods. The index columns are not dropped from theDataFrame.Note
Not all available quantities are retrieved and stored. In particular:
INF: bit-code of the groupMNR: material number of the groupMBW: material reinforcement number of the groupIBBandIBD: construction stage numbers
are currently not included.
This is a deliberate design choice and may be changed in the future without breaking the existing API.
- get_data(deep: bool = True) DataFrame¶
Return the
pandas.DataFramecontaining the loaded key11/0.- Parameters:
deep (bool, default True) – When
deep=True, a new object will be created with a copy of the calling object’s data and indices. Modifications to the data or indices of the copy will not be reflected in the original object (refer topandas.DataFrame.copy()documentation for details).
- get_id_range(quantity: str, group_number: int) range¶
Return a
rangestarting from the minimum element ID to the maximum ID + 1, so that a check likemax_id in get_id_range("BEAM", group_number)returnsTrue.If no elements of the requested type are present in the given
group_numberreturnsrange(0).
- get_name(group_number: int) str¶
Return a string containing the group name, given its number.
- Parameters:
group_number (int) – The group number
- Raises:
LookupError – If the given
group_numberis not found.
- get_number(group_name: str) int¶
Return the group number, given its name.
- Parameters:
group_name (str) – The group name
- Raises:
LookupError – If the given
group_nameis not found.
- iterator(quantity: str) Generator[tuple[int, range], None, None]¶
Yield a
tuplecontaining the group number and thequantityID range for each group defined in the CDB.- Parameters:
quantity (str) –
The type of finite element for which the range is requested. Must be one of:
"BEAM""CABLE""TRUSS""SPRING""QUAD"
See also