Skip to content

Latest commit

 

History

History
153 lines (112 loc) · 3.9 KB

lbd.md

File metadata and controls

153 lines (112 loc) · 3.9 KB
search
boost
0.3

lbd — reading and writing files

import lbd

Every public name of the lbd package, generated from the code. How to use them, task by task: Save and read a file and the pages after it.

Datasets

::: lbd.Dataset options: heading_level: 3

::: lbd.Axis options: heading_level: 3

::: lbd.Value options: heading_level: 3

::: lbd.Group options: heading_level: 3

::: lbd.Meta options: heading_level: 3

::: lbd.SaveReport options: heading_level: 3

Constants

Name What it is
lbd.__version__ The package's version ("2.0.0"; between releases "X.Y.Z.dev0"), shared by the viewer and every language module.
lbd.FORMAT_VERSION The newest file format this package reads and writes ("3.0"); a file is written with the lowest version its content needs (Versions).
lbd.PLOT_SPEC_KEYS The keys a saved view ("lbd_view": 2) may hold (kind, values, x, complex, …): the Plot settings.

lbd.version() gives both as a dict: {"package": "2.0.0", "lbd_version": "3.0"}, the package written as people read it ("X.Y.Z-dev" between releases, as MATLAB and Julia say it; __version__ keeps Python's own spelling). Files name the module python lbd <version>; LBD Viewer adds itself: python lbd 2.0.0 (LBD Viewer 2.0.0).

Reading

::: lbd.load options: heading_level: 3

::: lbd.info options: heading_level: 3

::: lbd.open options: heading_level: 3

::: lbd.OnDisk options: heading_level: 3

Writing while measuring

::: lbd.Writer options: heading_level: 3

::: lbd.writing_status options: heading_level: 3

::: lbd.recover options: heading_level: 3

::: lbd.writing_progress options: heading_level: 3

Changing a file's saved view

::: lbd.set_plot options: heading_level: 3

Labels

::: lbd.Labels options: heading_level: 3

::: lbd.labels options: heading_level: 3

::: lbd.set_labels options: heading_level: 3

::: lbd.remove_labels options: heading_level: 3

Versions

::: lbd.version options: heading_level: 3

Errors and warnings

lbd never changes or drops data silently. Input it can't store raises an error; input it stores but not exactly as given (or a file with parts it can't read) gives a warning.

When
LBDError Invalid names, shapes or types; lossy conversions to a forced dtype; a file that isn't LBD or breaks the format rules; metadata that can't be stored.
LBDVersionError The file's major format version is newer than this module.
LBDFileError The file can't be read as HDF5: damaged or incomplete, or marked as open for writing (a program stopped while it finished or changed the file: lbd.recover repairs it). Or it can't be written: its folder doesn't exist, the disk is full, it or its folder is read-only, or another program holds it (the message says which, and nothing was replaced). Both an LBDError and an OSError.
TypeError An argument of the wrong type, e.g. a number as unit.
LBDWarning Long double stored as float64; an axis that isn't sorted; a file from a newer minor version; a saved view or metadata that is partly unreadable.

To silence LBD's warnings on purpose (not recommended while developing):

import warnings
import lbd

warnings.filterwarnings("ignore", category=lbd.LBDWarning)

::: lbd.LBDError options: heading_level: 3

::: lbd.LBDFileError options: heading_level: 3

::: lbd.LBDVersionError options: heading_level: 3

::: lbd.LBDWarning options: heading_level: 3