power1d.io

IO functions.

This module contains convenience functions for high-level creation of geometry and DataSample models from data files.

file2geom

power1d.io.file2geom(fpath)

Create Continuum1D geometry object(s) from a CSV file.

Only CSV (and CSV.GZ) files are currently supported.

1D arrays can be saved as either a single row or a single column in a CSV file.

2D arrays must be saved with shape (nrow,ncol) where nrow is the number of 1D arrays and each row will be converted to a Continuum1D object

Arguments:

fpath —- full path to a CSV file

Outputs:

obj —- a Continuum1D object

file2datasamplemodel

power1d.io.file2datasamplemodel(fpath)

Create a DataSample model from a CSV file.

The following formats are currently supported:

  • .csv

  • .csv.gz

  • .mat

  • .npy

  • .npy.gz

In all cases, the data file must contain a 2D array with shape (J,Q); J=observations, Q=domain nodes

Arguments:

fpath —- full path to a data file

Outputs:

model —- a DataSample model