asim 25.11.5__cp313-cp313-win_amd64.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.
asim/__init__.py ADDED
@@ -0,0 +1 @@
1
+ from .version import __version__
Binary file
asim/dataset.pyi ADDED
@@ -0,0 +1,8 @@
1
+ from typing import List
2
+
3
+ import pandas as pd
4
+
5
+ class PhysicalDataManage:
6
+ def __init__(self, data: pd.DataFrame, columns: List, batch_size: int = 64): ...
7
+ @property
8
+ def df(self) -> pd.DataFrame: ...
Binary file
Binary file
asim/model.pyi ADDED
@@ -0,0 +1,9 @@
1
+ from io import BytesIO
2
+ from typing import Union
3
+
4
+ from .dataset import PhysicalDataManage
5
+
6
+ class PhysicalFieldModel:
7
+ def __init__(self, dm: PhysicalDataManage, lr: float): ...
8
+ def fit(self, epochs: int): ...
9
+ def export(self, fh: Union[str, BytesIO]): ...
Binary file
Binary file
asim/simulator.pyi ADDED
@@ -0,0 +1,12 @@
1
+ from io import BytesIO
2
+ from typing import Dict, Union
3
+
4
+ import numpy as np
5
+ import pandas as pd
6
+
7
+ from .dataset import PhysicalDataManage
8
+
9
+ class PhysicalSimulator:
10
+ def __init__(self, fh: Union[str, BytesIO], dm: PhysicalDataManage): ...
11
+ def step(self, x1: Dict[str, np.ndarray], y0: Dict[str, np.ndarray]) -> Dict[str, list]: ...
12
+ def steps(self, df: pd.DataFrame, y0: Dict[str, list[float]]) -> Dict[str, tuple[np.ndarray, np.ndarray, np.ndarray]]: ...
asim/version.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = "25.11.5"
@@ -0,0 +1,67 @@
1
+ Metadata-Version: 2.4
2
+ Name: asim
3
+ Version: 25.11.5
4
+ Summary: Automatic simulation system powered by neural networks
5
+ Keywords: simulation
6
+ Requires-Python: >=3.12
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: torch>=2.8.0
10
+ Requires-Dist: lightning>=2.5.5
11
+ Provides-Extra: dev
12
+ Requires-Dist: matplotlib; extra == "dev"
13
+ Dynamic: license-file
14
+
15
+ # Automatic simulation system powered by neural networks
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ pip install asim
21
+ ```
22
+
23
+ ## What is asim
24
+
25
+ - Physical field modeling with automatic constraint enforcement
26
+ - Flexible data grouping and normalization
27
+ - Built-in support for recurrent architectures
28
+ - Export/import of trained models
29
+
30
+ ## Using asim
31
+
32
+ ```python
33
+ import matplotlib.pyplot as plt
34
+ from asim.dataset import PhysicalDataManage, Ts, Fi, Fo, DummyDatasets
35
+ from asim.model import PhysicalFieldModel
36
+ from asim.simulator import PhysicalSimulator
37
+ from asim.optimizer import ContinuousOptimizer
38
+
39
+ # 1. Define data and structure
40
+ df = DummyDatasets.basic_boiler(size=1000) # pd.read_csv("demo.csv")
41
+ cols = [
42
+ Ts(label="ts"),
43
+ Fi(group="boiler", label="power1", min=0.0, union="kw", control=True),
44
+ Fi(group="boiler", label="power2", min=0.0, union="kw", control=True),
45
+ Fo(group="boiler", label="load", min=0.0, union="t", loop=True),
46
+ ]
47
+ dm = PhysicalDataManage(df, columns=cols, batch_size=64)
48
+
49
+ # 2. Select the model, define the parameters, train and save
50
+ fm = PhysicalFieldModel(dm, lr=0.003)
51
+ fm.fit(epochs=100)
52
+ fm.export("demo.sim.onnx")
53
+
54
+ # 3. Use a simulator to simulate the operation
55
+ sim = PhysicalSimulator("demo.sim.onnx", dm=dm)
56
+ sim_res = sim.steps(dm.df[100:300], y0={"boiler": [200.0]})
57
+ for group, (x1, y1, y2) in sim_res.items():
58
+ plt.figure(figsize=(15, 3))
59
+ plt.plot(y1, lw=2, ls="-")
60
+ plt.plot(y2, c="red", lw=2, ls="--")
61
+ plt.show()
62
+
63
+ # 4. RL
64
+ opt = ContinuousOptimizer(sim=sim, dm=dm)
65
+ opt.fit(epochs=100)
66
+ opt.export("demo.opt.onnx")
67
+ ```
@@ -0,0 +1,15 @@
1
+ asim/__init__.py,sha256=aF1qTFTEaCr30mm2ii0Wqs4ybLcLlwuiMraorC40TkU,34
2
+ asim/dataset.cp313-win_amd64.pyd,sha256=Yn7jdkkNMg2hR3CepIfwqE92xWYOxrXoYeSaPErDBDA,136704
3
+ asim/dataset.pyi,sha256=pKE-d4h0ILZmqu7nDPkTkGkgU1s0fGXSefGdvQliZXA,217
4
+ asim/explainer.cp313-win_amd64.pyd,sha256=Of2WQZZpAQhBWVl9MpY5kvONxY_Vj1yy-wmb0XS5ras,34816
5
+ asim/model.cp313-win_amd64.pyd,sha256=Hsb4O2lj5wuvxFMM0i5KUtB4_EHRM--lvWjPy9_QiZk,139264
6
+ asim/model.pyi,sha256=N9FZl1OwO4xV9YL57Q_lQz0wgSzYNcE7OPbkMQeqYHE,275
7
+ asim/optimizer.cp313-win_amd64.pyd,sha256=lYeg33UqK_9-AooYq4gEXnaGu-grQFVk5PYYRwQKzoM,39424
8
+ asim/simulator.cp313-win_amd64.pyd,sha256=VgfmiIno-DO4YYKKjnrCGk83D9rDy4FNeONKSjYzlbk,59904
9
+ asim/simulator.pyi,sha256=STYAYrO17f6nLKvIHOmRy9rIa69V-a_QG6_hhZu3ifE,474
10
+ asim/version.py,sha256=thEPEAhDZjOa9NR6pkbFORHBuLxhdE8E_EItXki0tMw,25
11
+ asim-25.11.5.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ asim-25.11.5.dist-info/METADATA,sha256=OqMspxA5lieqlPl2X4v8rUVVdSRoDf34cb12uKPVOpI,1983
13
+ asim-25.11.5.dist-info/WHEEL,sha256=qV0EIPljj1XC_vuSatRWjn02nZIz3N1t8jsZz7HBr2U,101
14
+ asim-25.11.5.dist-info/top_level.txt,sha256=6tOoh20rJ_xz66lNdZVG11p8YArVbqac0k2MEp33X9M,5
15
+ asim-25.11.5.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp313-cp313-win_amd64
5
+
File without changes
@@ -0,0 +1 @@
1
+ asim