hertzforge.service.ops_files¶
ops_files
¶
The file-level tools: saving one object in a foreign format, importing part of a long Rattlesnake run on a preview of it, cutting a run and writing it back, and reading delimited text with the layout its reader found corrected where it is wrong.
A file reaches the service by its path on the service's machine, as
project.import and project.save take it. Each tool calls the core's
own reader or writer (Project.export, io.save,
io.rattlesnake.stream_summary, stream_preview, save_window,
io.delimited.text_layout, read_delimited, Project.import_file);
the previews add nothing to the project, and the imports add what
Project.import_file adds.
Functions:
| Name | Description |
|---|---|
export_formats |
The formats |
save_as |
|
rattlesnake_preview |
|
import_rattlesnake_part |
|
truncate_rattlesnake_file |
|
text_preview |
|
import_text |
|
Classes¶
Functions:¶
export_formats
¶
The formats obj can be written in, .hforge first since only it reads
back complete: what the shell's save window lists as file types.
save_as
¶
project.save_as: one object written to a file in the format
chosen: a .hforge object
(io.save), or a foreign format by Project.export, in the display
unit system (the units param, 'display' or 'si'). The format's suffix is added when
the path lacks it. A format that cannot write the object is refused,
naming those that can. Shapes and data written to Exodus ride on a
geometry, and an ESCDF file records creator as its creator.
rattlesnake_preview
¶
project.rattlesnake_preview: a long run before anything is read whole: the size of
each stream (io.rattlesnake.stream_summary), one channel's envelope
over a stream (stream_preview, in SI), the window chosen shaded off
the rest, and what importing that window and those channels would
cost against the machine's memory. Adds nothing to the project.
import_rattlesnake_part
¶
project.import_rattlesnake_part: a window of a run and a pick of
its channels imported, with the Project.import_file(path, start=...,
stop=..., channels=...) call the import window makes,
holding only what differs from importing the whole run. Adds what
that import adds: the windowed histories, the channel table and the
environments' results, linked as one group.
truncate_rattlesnake_file
¶
project.truncate_rattlesnake_file: a run cut to a window and
written as a .nc4 of its own (io.rattlesnake.save_window), every
channel and every setting as the file has them and its clock
starting at zero. Named for the window beside the run
(rattlesnake.window_name) unless a copy is named. A window that is
the whole run is refused.
Adds nothing to the project; the project's journal records the
call.
text_preview
¶
project.text_preview: a delimited text file before it is imported: the layout
io.delimited.text_layout
found (delimiter, decimal point, header lines, time column, a stated
sample rate), its columns, and the head of the file read by the same
read_delimited call the import makes with the corrections given,
as rows and as traces in SI, with the notes the read gives. A
refusal is the one the import would give. Adds nothing to the
project.
import_text
¶
project.import_text: a delimited text file imported as one time
history with the layout's corrections, by the
Project.import_file(path, **options) call the text
import dialog makes, holding only what differs from what the reader
found; the notes the read gives are listed.