Skip to content

Python module for storing variables in disk. Allows reuse pre-calculated data and keep intermediate processing steps, with no ram footpring

License

Notifications You must be signed in to change notification settings

saisua/Python_disk_scope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python_disk_scope

Python module for storing variables in disk. Allows reuse pre-calculated data and keep intermediate processing steps, with no ram footpring

Usage:
import var_storage as pydisco
import cython, numba, numpy as np

variable_name = 'vv'
folder_storage = "my_project"
pydisco.Var_storage(variable_name, locals(), folder_name=folder_storage)


- Store variable on disk
vv.a = 3

- Recover variable from disk
print(vv.a)

- Store function / class as source
@vv.store_var
def test(num:int):
return vv.a + num

- Run function or instance class
vv.test(2) # 5

- Run all functions whose name matches a Regex pattern
vv.run_all(r"test.*")

- Launch a function as a separate process, compiled with Cython (Useful for Jupyter)
@vv.launch
def long_function():
print("Long computation")

- Automatically solve disk variable dependencies (Careful, this relaunches the function every time it finds a missing variable!)
@vv.solve_vars
def lazy_func():
return test(a)

lazy_func() # 6

About

Python module for storing variables in disk. Allows reuse pre-calculated data and keep intermediate processing steps, with no ram footpring

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages