talosdb 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: talosdb
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Lightweight experiment storage library for scientific simulations.
|
|
5
|
+
Author-email: GrindelfP <grindelf.perlomutrovij@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/GrindelfP/talosdb
|
|
8
|
+
Project-URL: Repository, https://github.com/GrindelfP/talosdb
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/GrindelfP/talosdb/issues
|
|
10
|
+
Keywords: experiment,simulation,storage,science,numpy
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: numpy>=1.24
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# talosdb
|
|
30
|
+
|
|
31
|
+
Lightweight experiment storage library for scientific simulations.
|
|
32
|
+
Named after Talos I station.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install src
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quickstart
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
from src import TalosDB
|
|
44
|
+
from itertools import product
|
|
45
|
+
|
|
46
|
+
db = TalosDB("~/science/results")
|
|
47
|
+
exp = db.experiment("vc_sweep_2025")
|
|
48
|
+
|
|
49
|
+
A_grid = [0.5, 1.0, 1.5]
|
|
50
|
+
beta_grid = [1.0, 2.0]
|
|
51
|
+
|
|
52
|
+
for A, beta in product(A_grid, beta_grid):
|
|
53
|
+
result = simulate(A, beta) # numpy array
|
|
54
|
+
with exp.run({"A": A, "beta": beta}) as run:
|
|
55
|
+
run.save(result)
|
|
56
|
+
run.save_params({"gamma": 0.1, "T": 300}) # extra constants
|
|
57
|
+
run.save_plot(my_plot_fn, result)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## File layout
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
db_root/
|
|
64
|
+
└── vc_sweep_2025/
|
|
65
|
+
├── experiment.json # metadata: name, creation date
|
|
66
|
+
├── A=0.5_beta=1.0/
|
|
67
|
+
│ ├── data.dat # human-readable TSV (numpy array)
|
|
68
|
+
│ ├── params.json # all parameters (name + extra)
|
|
69
|
+
│ └── plot.png # if save_plot() was called
|
|
70
|
+
└── A=1.0_beta=2.0/
|
|
71
|
+
├── data.dat
|
|
72
|
+
└── params.json
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## API reference
|
|
76
|
+
|
|
77
|
+
### TalosDB
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
db = TalosDB("path/to/db") # creates root folder if absent
|
|
81
|
+
db.experiment("name") # create / open experiment
|
|
82
|
+
db.experiment() # name = datetime stamp
|
|
83
|
+
db.list_experiments() # → list[str]
|
|
84
|
+
db.delete_experiment("name", confirm=True)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Experiment
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
exp = db.experiment("my_exp")
|
|
91
|
+
|
|
92
|
+
# Create / open a run
|
|
93
|
+
run = exp.run({"A": 0.5, "beta": 1.0})
|
|
94
|
+
# or as context manager (marks failed.json on exception):
|
|
95
|
+
with exp.run({"A": 0.5, "beta": 1.0}) as run:
|
|
96
|
+
...
|
|
97
|
+
|
|
98
|
+
# Load
|
|
99
|
+
run = exp.load({"A": 0.5, "beta": 1.0}) # exact match
|
|
100
|
+
runs = exp.query({"beta": 1.0}) # subset match → list[Run]
|
|
101
|
+
runs = exp.all_runs() # every run
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Run
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
run.save(result) # numpy array → data.dat
|
|
108
|
+
run.save_params({"gamma": 0.1, "T": 300}) # extra params → params.json
|
|
109
|
+
run.save_plot(plot_fn, result) # calls plot_fn(result, path)
|
|
110
|
+
|
|
111
|
+
result = run.load_data() # → np.ndarray
|
|
112
|
+
params = run.load_params() # → dict
|
|
113
|
+
run.is_failed() # → bool
|
|
114
|
+
run.load_failure() # → dict with error info
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### plot_fn contract
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
def my_plot_fn(result, save_path):
|
|
121
|
+
fig, ax = plt.subplots()
|
|
122
|
+
ax.plot(result[:, 0], result[:, 1])
|
|
123
|
+
fig.savefig(save_path)
|
|
124
|
+
plt.close(fig)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
talosdb does not import matplotlib — rendering is entirely the caller's responsibility.
|
|
128
|
+
|
|
129
|
+
## .dat format
|
|
130
|
+
|
|
131
|
+
Arrays are stored as human-readable TSV with a small header:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
# shape: 100 2
|
|
135
|
+
# dtype: float64
|
|
136
|
+
0.0 0.001
|
|
137
|
+
0.1 0.043
|
|
138
|
+
...
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
3D+ arrays are split into labelled 2D slices:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
# shape: 2 3 4
|
|
145
|
+
# dtype: float64
|
|
146
|
+
# slice [0]
|
|
147
|
+
1.0 2.0 3.0 4.0
|
|
148
|
+
5.0 6.0 7.0 8.0
|
|
149
|
+
9.0 10.0 11.0 12.0
|
|
150
|
+
|
|
151
|
+
# slice [1]
|
|
152
|
+
...
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The shape header ensures exact reconstruction on load regardless of dimensionality.
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
MIT
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
talosdb-0.1.0.dist-info/licenses/LICENSE,sha256=-SN7FF-VT9R0IsQoNzHt0F4CLtUWRqm9gzk6Af7ZUzE,1066
|
|
2
|
+
talosdb-0.1.0.dist-info/METADATA,sha256=1ZZj7Id-9H9lxD4G9OOm_5zdAM3ffZeADdu7K9-FJCc,4182
|
|
3
|
+
talosdb-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
4
|
+
talosdb-0.1.0.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
5
|
+
talosdb-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GrindelfP
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|