Books#

class mhi.enerplot.Book(*, _ctx: Context | None = None, _ident: Dict[str, Any] | None = None)#

An Enerplot Book holds one or more sheets, which in turn will hold graph frames for viewing curve data.

property name: str#

The name of the book (read-only)

property file: str#

The book’s filename (read-only)

property description: str#

The book’s description (read-only)

property header: Any#

Header Text

property title: Any#

Header Title

property footer_left: Any#

Left footer

property footer_center: Any#

Centre footer

property footer_right: Any#

Right footer

property page_numbers: str#

Return the location the page numbers will be drawn.

unload() None#

Unload this book

The book is unloaded from the Enerplot workspace.

Warning

Any changes made to the book, which have not explicitly been saved, will be lost. Call save() or save_as() before unloading to preserve changes.

reload() None#

Reload this book

The book is reloaded into the Enerplot workspace.

Warning

Any changes made to the book, which have not explicitly been saved, will be lost. Call save() or save_as() before reloading to preserve changes.

Added in version 2.3.

focus() None#

Focus on this book.

Added in version 2.5.

print() None#

Print this book to the default printer

Added in version 2.5.

property dirty: bool#

Has the book been modified since it was last saved (read-only)

Added in version 2.3.

is_dirty() bool#

Check if the project contains unsaved changes

Returns:

True, if unsaved changes exist, False otherwise.

Added in version 2.3.

save() None#

Save all changes in book

save_as(path: str | PurePath, folder: str | PurePath | None = None) None#

Save book to a new path location

Parameters:
  • path – location to store the book. The extension .epbx is appended if not present.

  • folder – If provided, the path to the book is resolved relative to this folder.

sheets() IndexableDict[str, Sheet]#

List all of the sheets in this book.

Returns:

an indexable dictionary of sheets.

sheet(name: str) Sheet | None#

Retrieve a sheet reference, by name

Parameters:

name – the name of the sheet

Returns:

the named sheet (if present)

new_sheet(name: str = '', description: str = '') Sheet#

Create a new sheet

Parameters:
  • name – The desired sheet name; if not provided, “Sheet#” will be used.

  • description – a description to be given to the sheet.

Returns:

the created sheet.

Delink all channel data from book

Relink the channel data to the given datafile

Parameters:

datafile – the datafile to link channel data to.

Relink channels to the referenced in one datafile to the other

Parameters:
  • from_datafile – the datafile to unlink channel data from.

  • to_datafile – the datafile to link channel data to.