Skip to main content

Log as append-only source package

Build Status

Logs as append-only source: write your ML training results in Python without having to worry about crashes. Loading is a breeze: the logs are native Python code. The package supports unstructured data. The data can easily be imported into Jupyter Notebooks or elsewhere.

Installation

To install using pip, use:

pip install blackhc.laaos

To run the tests, use:

python setup.py test

Append-only source logs

Storing training results as Python dictionaries or JSON files is problematic because the formats are not append-only, which means that you have to rewrite the file every time something changes. (Or you only write results at the end, which does not play well with interruptions or intermediate failures.)

Alternatively, we can simply write the operations that create a structure to a file in an append-only fashion. If the data structure itself is growing and not mutated, this only increases file-size by a constant factor.

The advantage of this library is that the file format is very simple: it's valid Python code.

The only requirement is that you only store primitive types, lists, sets, dicts and immutable types.

Custom wrappers can be added by registering TypeHandlers when creating a Store. See WeakEnumHandler and StrEnumHandler.

Example

from blackhc.laaos import create_file_store, safe_load_store
store = create_file_store('test', suffix='')

store['losses'] = []
losses = store['losses']

for i in range(1, 10):
    losses.append(1/i)

store.close()

The resulting file laaos/test.py contains valid Python code:

store = {}
store['losses']=[]
store['losses'].append(1.0)
store['losses'].append(0.5)
store['losses'].append(0.3333333333333333)
store['losses'].append(0.25)
store['losses'].append(0.2)
store['losses'].append(0.16666666666666666)
store['losses'].append(0.14285714285714285)
store['losses'].append(0.125)
store['losses'].append(0.1111111111111111)

It can be loaded either with:

form laaos.test import store

or with the more secure:

safe_load('laaos/test.py')

Metadata

Release files for blackhc.laaos 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for blackhc.laaos 1.1.0
File Size Uploaded
blackhc.laaos-1.1.0.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for blackhc.laaos 1.1.0
File Interpreter ABI Platform
blackhc.laaos-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / blackhc.laaos-1.1.0.tar.gz

Download URL blackhc.laaos-1.1.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
162c79505cef71d61b142858d3807b2e4a0ee997b0f1161e60995eab0079648c
BLAKE2b-256 checksum
How to use checksums
4942b18cd4e6c47d37815bced3b2c6e3a9a611668e56010f24aa8a7b04addcd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.7

Release files / blackhc.laaos-1.1.0-py3-none-any.whl

Download URL blackhc.laaos-1.1.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39f622897a3f719932abdcd8a0b5b6f109c5479c19e1c8e50a9bc66bdbd8d98e
BLAKE2b-256 checksum
How to use checksums
42df6954e33da8c7f0666eac9549fef235048ca82e6d246a0726475b3bbaad6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page