gridfile.buildSources

Build dataSources for gridfile operations


Syntax



Description

[dataSources, failed, causes] = obj.buildSources(s)

Builds the dataSource objects for the specified sources. If a data source fails to build, or does not match the values recorded in the gridfile, exits immediately and reports the failed data source as well as the cause of the failure.

= obj.buildSources(s, fatal)

Specify whether the method should stop immediately when a data source fails. Default is true. If false, the method will continue through the full set of data sources, reporting all failed data sources and the causes of their failures.

= obj.buildSources(s, fatal, filepaths)

Builds data sources using the values recorded in the gridfile, but with custom filepaths.


Input Arguments

s

vector, linear indices [nSources]
The indices of the data sources in the gridfile for which to build dataSource objects.

fatal

scalar logical
Set to true (default) if the method should exit immediately when a data source fails. Set to false to continue and attempt to build all sources

filepaths

string vector [nSources]
The absolute filepaths to use when building the dataSources

Output Arguments

dataSources

cell vector [nSources] {scalar dataSource object | []} | []
dataSource objects for the specified sources. If fatal is true, and a dataSource fails, dataSources is an empty array. If not fatal, the elements for failed sources are empty arrays.

failed

false | scalar integer | logical vector [nSources]
Indicates whether any data sources failed. If fatal, failed is false or the index of the failed source. If not fatal, failed is a logical vector with one element per data source. If not fatal and there are no requested data sources, then failed will be false.

causes

[] | scalar MException | cell vector [nSources] {scalar MException}
If fatal and all sources succeeded, returns an empty array. If fatal and failed, a scalar MException. If not fatal, has one element per source. Elements of failed sources hold the MException reporting the cause of the failure. Elements of successful sources are empty arrays.