Define a function which rolls up an attribute
Create a function to calculate statistics for, and store the values on the meta-attributes of, a target attribute. Therollup_point_attribute() method below is a general example which will work whether meta-attributes are present
or not, or if the number of samples is too small to provide meaningful statistics. It checks if each named
meta-attribute exists, then sets existing meta-attributes and updates them by calling Record.set_attributes().
To simplify your own roll-up, you can:
- Make sure there are meta-attributes for roll-up statistics on all relevant attributes when setting up a Granta MI schema.
- Make sure all the target attributes in your script have the same meta-attributes.
- Set up a workflow where all statistical data records are created new.
Define a function which copies attribute values
Define acopy_attribute() function which copies an attribute value from the source records, for example a Specimen
ID stored in a short-text attribute, or a test temperature.
This example supports several attribute types, and could easily be extended to support others such as discrete or
hyperlink.
Get test data from Granta MI
Composite data in Granta MI is stored according to layup orientation and Specimen ID. The roll-up process retains the overall structure of the records, but creates a single new record for each specimen. Connect to Granta MI and fetch the folder corresponding to the composite 3M, S-Glass Unitape S2/SP381:table.bulk_fetch() method (see
Performance optimization).
seaborn plotting libraries, first ‘flattening’ the data into a
usable list of numpy arrays.
Alternatively, you could convert the data into a pandas DataFrame at this point (useful if you needed to process the
data further).

table.path_from() method to create a folder path for each orientation, and
table.create_record() for each new roll-up record.
Finally, use Session.update() to write the new record to the server, then set and update links between the new
statistical data record and the test records it summarises.