Advanced Octave A14 — Batch publishing and atomicity

by Giux GX-TXT, octave-en, scripts-en 2 min read

Advanced GNU Octave with GX-TXT · Module 03

An analysis can produce more series that must be considered together. Batch publication allows you to request the coordinated creation of the Dataset, avoiding to present as complete a set published only in part.

Objectives and prerequisites

The introductory course introduces serial publication. Here we deepen the structure of the request, receipt and verification of an atomic publication through DATASET_PUBLICATION_API_v2. The test uses GX-TXT dev112-P011-bis and Octave 9.4.0.

We generate two synthetic series, not sizes, with 0 to 2 s times and k + 0,2 t V voltages for k = 1 and 2. The two IDs of the example are fixed and the batch is created-only: use a new teaching session or change both IDs so that they are free. Do not delete previous results to facilitate execution.

Prepare your request

Import pubblica_batch.m, register it and run it with the Runner.

The cycle builds a cell array of two structures, each with IDs, vectors, units and identifiers of variables. The call publishes a single request containing the collection:

receipt = gxtxt_api_call('DATASET_PUBLICATION_API_v2', 'publish_series_batch', ...
                          {struct('series',{series})});
fprintf('Atomic batch: %d; output count: %d\n', receipt.atomic, receipt.output_count);

The scratches around series in the construction of the struct preserve the collection as the value of the field. The receipt informs whether the batch is atomic and how many outputs have been published. After the publication, the script reads each Dataset via the canonical API.

The atomic test is 1 and the output number is 2. Both series reread five lines; the last values are 1,4 V and 2,4 V respectively. It is a test of actual results, not an experimental demonstration.

Atomicity and Identity

For this operation the contract provides for the coordinated management of the requests: if the batch cannot be completed, it is not necessary to consider valid partial output as if they constituted the whole set. This does not make scientific models valid and does not eliminate identity conflicts. IDs must be distinguished and free; the operation is not a shortcut to replace existing Datasets.

When a real analysis connects multiple results, it also retains sources, parameters, units and version of the script. The receipt and a subsequent rereading are complementary controls: the first describes the publication, the second allows to verify the recorded values.

Exercise

  1. How many Datasets are required by the batch?
  2. What is the output_count field of the receipt?
  3. Does the atomity show that the two series are scientifically correct?

Worked solution

  1. Two, with separate ID.
  2. The output number shown by the publication.
  3. No: it concerns the coordinated management of the publication; model, data and units must be checked separately.

Download the Module 03 scripts (ZIP)

#GNU Octave #GX-TXT #GX-TXT public APIs

Other steps of this project

Leave a Reply

Your email address will not be published. Required fields are marked *