pyyeti.cla.DR_Def.copycat

DR_Def.copycat(categories, name_addon, **kwargs)[source]

Copy a category with optional modifications.

Parameters:
  • categories (string or list) – Name or names of category(s) to copy.

  • name_addon (string or list) – If string, it will be appended to all category names to make the new names. If list, contains the new names with no regard to old names.

  • **kwargs (misc) – Any options to modify. See add() for complete list. For uf_reds, set any of the four values to None to keep the original value.

Returns:

None – Adds a data recovery category.

Notes

The data recovery categories are copies of the originals with the name changed (according to name_addon) and new values set according to **kwargs.

One very common usage is to add a zero-rigid-body version of a category; for example:

drdefs.copycat(['SC_ifa', 'SC_atm'], '_0rb',
                 uf_reds=(0, None, None, None))

would add ‘SC_ifa_0rb’ and ‘SC_atm_0rb’ copy categories without the rigid-body component. (Note that, as a convenience, add_0rb() exists for this specific task.)

For another example, recover the ‘SC_cg’ (cg load factors) in “static” and “dynamic” pieces:

drdefs.copycat('SC_cg', '_static',
                 uf_reds=(None, None, 0, None))
drdefs.copycat('SC_cg', '_dynamic',
                 uf_reds=(None, None, None, 0))

As a final example to show the alternate use of name_addon, here is an equivalent call for the static example:

drdefs.copycat('SC_cg', ['SC_cg_static'],
                 uf_reds=(None, None, 0, None))
Raises:

ValueError – When the new category name already exists.