initial commit

This commit is contained in:
Benoît Sierro
2021-01-28 22:43:54 +01:00
commit bf8e2ec0b1
80 changed files with 61379 additions and 0 deletions

17
tests/test_save_config.py Normal file
View File

@@ -0,0 +1,17 @@
from json import encoder
import toml
import numpy as np
from datetime import datetime
from scgenerator.io import save_parameters
x = np.arange(5)
y = np.arange(5, dtype="complex")
z = np.arange(5, dtype="float")
dico = dict(a=x, c=list(x), b=print, aa=y, bb=z, ddd=datetime.now())
with open("tests/numpy.toml", "w") as file:
toml.dump(dico, file, encoder=toml.TomlNumpyEncoder())
save_parameters(dico, "tests/param")
save_parameters(toml.load("tests/test_config.toml"), "tests/test_save_config")