fairmd.lipids.auxiliary

Python files

Module contents

class fairmd.lipids.auxiliary.CompactJSONEncoder(*args, **kwargs)[source]

Bases: JSONEncoder

A JSON Encoder that puts small containers on single lines.

Originally taken from the GiST of @jannismain.

CONTAINER_TYPES = (<class 'list'>, <class 'tuple'>, <class 'dict'>)

Container datatypes include primitives or other containers.

MAX_WIDTH = 150

Maximum width of a container that might be put on a single line.

MAX_ITEMS = 10

Maximum number of items in container that might be put on single line.

encode(o)[source]

Encode JSON object o with respect to single line lists.

iterencode(o, **kwargs)[source]

Required to also work with json.dump.

property indent_str: str
fairmd.lipids.auxiliary.block_average_time_series(arr: ndarray, blocksize: float) ndarray[source]

Return block-average of (N,2) array.

Parameters:
  • arr – numpy array (N,2)

  • blocksize – timeframe for slice blocks

Returns:

block-averaged array