modelit 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.
- modelit/__init__.py +19 -0
- modelit/__main__.py +9 -0
- modelit/cli.py +24 -0
- modelit/registry.py +94 -0
- modelit/templates/perceptron/metadata.json +6 -0
- modelit/templates/perceptron/template.py +319 -0
- modelit-0.1.0.dist-info/METADATA +94 -0
- modelit-0.1.0.dist-info/RECORD +12 -0
- modelit-0.1.0.dist-info/WHEEL +5 -0
- modelit-0.1.0.dist-info/entry_points.txt +2 -0
- modelit-0.1.0.dist-info/licenses/LICENSE +21 -0
- modelit-0.1.0.dist-info/top_level.txt +1 -0
modelit/__init__.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""ModelIt exports local ML boilerplate templates."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .registry import available_models, build_template_callable
|
|
6
|
+
|
|
7
|
+
__all__ = list(available_models())
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def __getattr__(name: str):
|
|
11
|
+
if name in available_models():
|
|
12
|
+
fn = build_template_callable(name)
|
|
13
|
+
globals()[name] = fn
|
|
14
|
+
return fn
|
|
15
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def __dir__():
|
|
19
|
+
return sorted(set(globals()) | set(available_models()))
|
modelit/__main__.py
ADDED
modelit/cli.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Command-line entry point for ModelIt."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
|
|
7
|
+
from .registry import available_models, build_template_callable
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _create(args: argparse.Namespace) -> None:
|
|
11
|
+
build_template_callable(args.name)(output=args.output)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def main(argv: list[str] | None = None) -> None:
|
|
15
|
+
parser = argparse.ArgumentParser(prog="modelit", description="Print or save ML template code.")
|
|
16
|
+
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
17
|
+
|
|
18
|
+
create_parser = subparsers.add_parser("create", help="Print or save a template")
|
|
19
|
+
create_parser.add_argument("name", choices=available_models(), help="Template name")
|
|
20
|
+
create_parser.add_argument("-o", "--output", help="Write the template to a file instead of printing")
|
|
21
|
+
create_parser.set_defaults(func=_create)
|
|
22
|
+
|
|
23
|
+
args = parser.parse_args(argv)
|
|
24
|
+
args.func(args)
|
modelit/registry.py
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"""Template discovery and loading."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
from importlib.resources import files
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
import json
|
|
9
|
+
import sys
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
PACKAGE_NAME = "modelit"
|
|
13
|
+
TEMPLATES_DIR = "templates"
|
|
14
|
+
TEMPLATE_FILENAME = "template.py"
|
|
15
|
+
METADATA_FILENAME = "metadata.json"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass(frozen=True)
|
|
19
|
+
class TemplateInfo:
|
|
20
|
+
name: str
|
|
21
|
+
title: str
|
|
22
|
+
output_file: str
|
|
23
|
+
description: str
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _templates_root():
|
|
27
|
+
return files(PACKAGE_NAME).joinpath(TEMPLATES_DIR)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _template_dir(name: str):
|
|
31
|
+
return _templates_root().joinpath(name)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def available_models() -> tuple[str, ...]:
|
|
35
|
+
root = _templates_root()
|
|
36
|
+
if not root.is_dir():
|
|
37
|
+
return ()
|
|
38
|
+
|
|
39
|
+
names: list[str] = []
|
|
40
|
+
for child in root.iterdir():
|
|
41
|
+
if child.is_dir() and child.joinpath(TEMPLATE_FILENAME).is_file():
|
|
42
|
+
names.append(child.name)
|
|
43
|
+
return tuple(sorted(names))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def load_metadata(name: str) -> TemplateInfo:
|
|
47
|
+
metadata_path = _template_dir(name).joinpath(METADATA_FILENAME)
|
|
48
|
+
data: dict[str, str] = {}
|
|
49
|
+
if metadata_path.is_file():
|
|
50
|
+
data = json.loads(metadata_path.read_text(encoding="utf-8"))
|
|
51
|
+
|
|
52
|
+
title = data.get("title") or name.replace("_", " ").title()
|
|
53
|
+
output_file = data.get("output_file") or f"{name}.py"
|
|
54
|
+
description = data.get("description") or f"Print the {title} template."
|
|
55
|
+
|
|
56
|
+
return TemplateInfo(
|
|
57
|
+
name=name,
|
|
58
|
+
title=title,
|
|
59
|
+
output_file=output_file,
|
|
60
|
+
description=description,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def load_source(name: str) -> str:
|
|
65
|
+
source_path = _template_dir(name).joinpath(TEMPLATE_FILENAME)
|
|
66
|
+
if not source_path.is_file():
|
|
67
|
+
raise FileNotFoundError(f"Missing template source for {name!r}")
|
|
68
|
+
return source_path.read_text(encoding="utf-8")
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def build_template_callable(name: str):
|
|
72
|
+
info = load_metadata(name)
|
|
73
|
+
source = load_source(name)
|
|
74
|
+
|
|
75
|
+
def runner(output: str | None = None) -> None:
|
|
76
|
+
if output:
|
|
77
|
+
path = Path(output)
|
|
78
|
+
if path.exists():
|
|
79
|
+
raise FileExistsError(f"{path} already exists")
|
|
80
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
81
|
+
path.write_text(source, encoding="utf-8")
|
|
82
|
+
print(f"Generated {path}")
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
for chunk in source.splitlines(keepends=True):
|
|
86
|
+
sys.stdout.write(chunk)
|
|
87
|
+
|
|
88
|
+
runner.__name__ = name
|
|
89
|
+
runner.__qualname__ = name
|
|
90
|
+
runner.__module__ = "modelit"
|
|
91
|
+
runner.__doc__ = info.description
|
|
92
|
+
runner.output_file = info.output_file # type: ignore[attr-defined]
|
|
93
|
+
runner.template_info = info # type: ignore[attr-defined]
|
|
94
|
+
return runner
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# =========================================================
|
|
2
|
+
# PERCEPTRON LEARNING ALGORITHM
|
|
3
|
+
# AND, OR, NAND, NOR using
|
|
4
|
+
# 1. Bipolar Representation
|
|
5
|
+
# 2. Unipolar Representation
|
|
6
|
+
# =========================================================
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# =========================================================
|
|
10
|
+
# COMMON FUNCTIONS
|
|
11
|
+
# =========================================================
|
|
12
|
+
|
|
13
|
+
def net_input(w, x, b):
|
|
14
|
+
net = 0
|
|
15
|
+
|
|
16
|
+
for i in range(len(w)):
|
|
17
|
+
net = net + w[i] * x[i]
|
|
18
|
+
|
|
19
|
+
net = net + b
|
|
20
|
+
|
|
21
|
+
return net
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# =========================================================
|
|
25
|
+
# BIPOLAR ACTIVATION FUNCTION
|
|
26
|
+
# output:
|
|
27
|
+
# 1 if net > 0
|
|
28
|
+
# 0 if net = 0
|
|
29
|
+
# -1 if net < 0
|
|
30
|
+
# =========================================================
|
|
31
|
+
|
|
32
|
+
def bipolar_activation(net):
|
|
33
|
+
|
|
34
|
+
if net > 0:
|
|
35
|
+
return 1
|
|
36
|
+
|
|
37
|
+
elif net == 0:
|
|
38
|
+
return 0
|
|
39
|
+
|
|
40
|
+
elif net < 0:
|
|
41
|
+
return -1
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# =========================================================
|
|
45
|
+
# UNIPOLAR ACTIVATION FUNCTION
|
|
46
|
+
# output:
|
|
47
|
+
# 1 if net >= 0
|
|
48
|
+
# 0 if net < 0
|
|
49
|
+
# =========================================================
|
|
50
|
+
|
|
51
|
+
def unipolar_activation(net):
|
|
52
|
+
|
|
53
|
+
if net >= 0:
|
|
54
|
+
return 1
|
|
55
|
+
|
|
56
|
+
elif net < 0:
|
|
57
|
+
return 0
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# =========================================================
|
|
61
|
+
# ERROR CALCULATION
|
|
62
|
+
# error = desired_output - actual_output
|
|
63
|
+
# =========================================================
|
|
64
|
+
|
|
65
|
+
def calc_error(output, det_output):
|
|
66
|
+
|
|
67
|
+
return (det_output - output)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
# =========================================================
|
|
71
|
+
# CHANGE IN WEIGHT
|
|
72
|
+
# Δw = c * e * x
|
|
73
|
+
# =========================================================
|
|
74
|
+
|
|
75
|
+
def delta_w(c, e, x):
|
|
76
|
+
|
|
77
|
+
return c * e * x
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
# =========================================================
|
|
81
|
+
# CHANGE IN BIAS
|
|
82
|
+
# Δb = c * e
|
|
83
|
+
# =========================================================
|
|
84
|
+
|
|
85
|
+
def delta_b(c, e):
|
|
86
|
+
|
|
87
|
+
return c * e
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# =========================================================
|
|
91
|
+
# UPDATE FUNCTION
|
|
92
|
+
# new_value = old_value + delta
|
|
93
|
+
# =========================================================
|
|
94
|
+
|
|
95
|
+
def update(old, delta):
|
|
96
|
+
|
|
97
|
+
return old + delta
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
# =========================================================
|
|
101
|
+
# TRAINING FUNCTION
|
|
102
|
+
# =========================================================
|
|
103
|
+
|
|
104
|
+
def train_perceptron(data, activation_type, gate_name):
|
|
105
|
+
|
|
106
|
+
print("\n=================================================")
|
|
107
|
+
print(f"{gate_name}")
|
|
108
|
+
print("=================================================")
|
|
109
|
+
|
|
110
|
+
w1 = 0
|
|
111
|
+
w2 = 0
|
|
112
|
+
b = 0
|
|
113
|
+
|
|
114
|
+
c = 1
|
|
115
|
+
max_epochs = 100
|
|
116
|
+
|
|
117
|
+
print(f"\nInitial weights:")
|
|
118
|
+
print(f"w1 = {w1}, w2 = {w2}")
|
|
119
|
+
print(f"Initial Bias:")
|
|
120
|
+
print(f"b = {b}")
|
|
121
|
+
|
|
122
|
+
for epoch in range(max_epochs):
|
|
123
|
+
|
|
124
|
+
all_errors = []
|
|
125
|
+
|
|
126
|
+
print(f"\nEpoch {epoch + 1}:")
|
|
127
|
+
print("x1\tx2\td\tnet\to\te\tdel_w1\tdel_w2\tdel_b\tw1\tw2\tb")
|
|
128
|
+
|
|
129
|
+
for i in range(len(data)):
|
|
130
|
+
|
|
131
|
+
x = data[i][:2]
|
|
132
|
+
d = data[i][2]
|
|
133
|
+
|
|
134
|
+
# Net Input
|
|
135
|
+
net = net_input([w1, w2], x, b)
|
|
136
|
+
|
|
137
|
+
# Activation
|
|
138
|
+
if activation_type == "bipolar":
|
|
139
|
+
output = bipolar_activation(net)
|
|
140
|
+
|
|
141
|
+
elif activation_type == "unipolar":
|
|
142
|
+
output = unipolar_activation(net)
|
|
143
|
+
|
|
144
|
+
# Error
|
|
145
|
+
error = calc_error(output, d)
|
|
146
|
+
|
|
147
|
+
all_errors.append(error)
|
|
148
|
+
|
|
149
|
+
# Weight Updates
|
|
150
|
+
d_w1 = delta_w(c, error, x[0])
|
|
151
|
+
w1 = update(w1, d_w1)
|
|
152
|
+
|
|
153
|
+
d_w2 = delta_w(c, error, x[1])
|
|
154
|
+
w2 = update(w2, d_w2)
|
|
155
|
+
|
|
156
|
+
# Bias Update
|
|
157
|
+
d_b = delta_b(c, error)
|
|
158
|
+
b = update(b, d_b)
|
|
159
|
+
|
|
160
|
+
print(
|
|
161
|
+
f"{x[0]}\t{x[1]}\t{d}\t{net}\t{output}\t{error}\t"
|
|
162
|
+
f"{d_w1}\t{d_w2}\t{d_b}\t{w1}\t{w2}\t{b}"
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
# Stop if all errors are zero
|
|
166
|
+
if all(e == 0 for e in all_errors):
|
|
167
|
+
break
|
|
168
|
+
|
|
169
|
+
print(f"\nAll errors zero at epoch {epoch + 1}")
|
|
170
|
+
|
|
171
|
+
print("\nFinal weights:")
|
|
172
|
+
print(f"w1 = {w1}, w2 = {w2}")
|
|
173
|
+
|
|
174
|
+
print("Final bias:")
|
|
175
|
+
print(f"b = {b}")
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
# =========================================================
|
|
179
|
+
# AND GATE USING BIPOLAR
|
|
180
|
+
# =========================================================
|
|
181
|
+
|
|
182
|
+
X_and_bi = [
|
|
183
|
+
[-1, -1, -1],
|
|
184
|
+
[1, -1, -1],
|
|
185
|
+
[-1, 1, -1],
|
|
186
|
+
[1, 1, 1]
|
|
187
|
+
]
|
|
188
|
+
|
|
189
|
+
train_perceptron(
|
|
190
|
+
X_and_bi,
|
|
191
|
+
activation_type="bipolar",
|
|
192
|
+
gate_name="AND Gate using Bipolar"
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
# =========================================================
|
|
197
|
+
# AND GATE USING UNIPOLAR
|
|
198
|
+
# =========================================================
|
|
199
|
+
|
|
200
|
+
X_and_uni = [
|
|
201
|
+
[0, 0, 0],
|
|
202
|
+
[0, 1, 0],
|
|
203
|
+
[1, 0, 0],
|
|
204
|
+
[1, 1, 1]
|
|
205
|
+
]
|
|
206
|
+
|
|
207
|
+
train_perceptron(
|
|
208
|
+
X_and_uni,
|
|
209
|
+
activation_type="unipolar",
|
|
210
|
+
gate_name="AND Gate using Unipolar"
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
# =========================================================
|
|
215
|
+
# OR GATE USING BIPOLAR
|
|
216
|
+
# =========================================================
|
|
217
|
+
|
|
218
|
+
X_or_bi = [
|
|
219
|
+
[-1, -1, -1],
|
|
220
|
+
[1, -1, 1],
|
|
221
|
+
[-1, 1, 1],
|
|
222
|
+
[1, 1, 1]
|
|
223
|
+
]
|
|
224
|
+
|
|
225
|
+
train_perceptron(
|
|
226
|
+
X_or_bi,
|
|
227
|
+
activation_type="bipolar",
|
|
228
|
+
gate_name="OR Gate using Bipolar"
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
# =========================================================
|
|
233
|
+
# OR GATE USING UNIPOLAR
|
|
234
|
+
# =========================================================
|
|
235
|
+
|
|
236
|
+
X_or_uni = [
|
|
237
|
+
[0, 0, 0],
|
|
238
|
+
[1, 0, 1],
|
|
239
|
+
[0, 1, 1],
|
|
240
|
+
[1, 1, 1]
|
|
241
|
+
]
|
|
242
|
+
|
|
243
|
+
train_perceptron(
|
|
244
|
+
X_or_uni,
|
|
245
|
+
activation_type="unipolar",
|
|
246
|
+
gate_name="OR Gate using Unipolar"
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
# =========================================================
|
|
251
|
+
# NAND GATE USING UNIPOLAR
|
|
252
|
+
# =========================================================
|
|
253
|
+
|
|
254
|
+
X_nand_uni = [
|
|
255
|
+
[0, 0, 1],
|
|
256
|
+
[0, 1, 1],
|
|
257
|
+
[1, 0, 1],
|
|
258
|
+
[1, 1, 0]
|
|
259
|
+
]
|
|
260
|
+
|
|
261
|
+
train_perceptron(
|
|
262
|
+
X_nand_uni,
|
|
263
|
+
activation_type="unipolar",
|
|
264
|
+
gate_name="NAND Gate using Unipolar"
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
# =========================================================
|
|
269
|
+
# NOR GATE USING UNIPOLAR
|
|
270
|
+
# =========================================================
|
|
271
|
+
|
|
272
|
+
X_nor_uni = [
|
|
273
|
+
[0, 0, 1],
|
|
274
|
+
[0, 1, 0],
|
|
275
|
+
[1, 0, 0],
|
|
276
|
+
[1, 1, 0]
|
|
277
|
+
]
|
|
278
|
+
|
|
279
|
+
train_perceptron(
|
|
280
|
+
X_nor_uni,
|
|
281
|
+
activation_type="unipolar",
|
|
282
|
+
gate_name="NOR Gate using Unipolar"
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
# =========================================================
|
|
287
|
+
# NAND GATE USING BIPOLAR
|
|
288
|
+
# =========================================================
|
|
289
|
+
|
|
290
|
+
X_nand_bi = [
|
|
291
|
+
[-1, -1, 1],
|
|
292
|
+
[-1, 1, 1],
|
|
293
|
+
[1, -1, 1],
|
|
294
|
+
[1, 1, -1]
|
|
295
|
+
]
|
|
296
|
+
|
|
297
|
+
train_perceptron(
|
|
298
|
+
X_nand_bi,
|
|
299
|
+
activation_type="bipolar",
|
|
300
|
+
gate_name="NAND Gate using Bipolar"
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
# =========================================================
|
|
305
|
+
# NOR GATE USING BIPOLAR
|
|
306
|
+
# =========================================================
|
|
307
|
+
|
|
308
|
+
X_nor_bi = [
|
|
309
|
+
[-1, -1, 1],
|
|
310
|
+
[-1, 1, -1],
|
|
311
|
+
[1, -1, -1],
|
|
312
|
+
[1, 1, -1]
|
|
313
|
+
]
|
|
314
|
+
|
|
315
|
+
train_perceptron(
|
|
316
|
+
X_nor_bi,
|
|
317
|
+
activation_type="bipolar",
|
|
318
|
+
gate_name="NOR Gate using Bipolar"
|
|
319
|
+
)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: modelit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Local-first ML starter templates you can print or save
|
|
5
|
+
Author: Yashsmith
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Yashsmith/modelit
|
|
8
|
+
Project-URL: Source, https://github.com/Yashsmith/modelit
|
|
9
|
+
Project-URL: Issues, https://github.com/Yashsmith/modelit/issues
|
|
10
|
+
Keywords: ml,deep-learning,templates,boilerplate,pytorch,scikit-learn
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Intended Audience :: Education
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
|
|
21
|
+
# ModelIt
|
|
22
|
+
|
|
23
|
+
Tiny local-first ML template printer.
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install modelit
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For development from a clone, use:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install -e .
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Run
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from modelit import perceptron
|
|
41
|
+
|
|
42
|
+
perceptron()
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Or from CLI:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
modelit create perceptron
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Save to file
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from modelit import perceptron
|
|
55
|
+
|
|
56
|
+
perceptron(output="code1.py")
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Or:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
modelit create perceptron --output code1.py
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Then run:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
python3 code1.py
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Publish
|
|
72
|
+
|
|
73
|
+
This project is set up for PyPI publishing with GitHub Actions.
|
|
74
|
+
|
|
75
|
+
1. Push a tag like `v0.1.0`
|
|
76
|
+
2. GitHub Actions builds and publishes to PyPI
|
|
77
|
+
3. Users install with `pip install modelit`
|
|
78
|
+
|
|
79
|
+
To update later, change the version, add your new templates, and publish a new tag.
|
|
80
|
+
|
|
81
|
+
## Add a new code
|
|
82
|
+
|
|
83
|
+
Create:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
modelit/templates/<name>/template.py
|
|
87
|
+
modelit/templates/<name>/metadata.json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Then the new name is exposed automatically as:
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
from modelit import <name>
|
|
94
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
modelit/__init__.py,sha256=HWqcsz1ZnP26mu4h8HhzJcNuy5TB40Y-PgY_Nl3jaaY,498
|
|
2
|
+
modelit/__main__.py,sha256=S3dwPvsSp3kFstl1emKzBvsO-Tkd9Rx-SVRlD9tmoW4,130
|
|
3
|
+
modelit/cli.py,sha256=CXeDARDv8QsIJgfb8N3nw_sZewQar9umL2WSvV8MLe8,873
|
|
4
|
+
modelit/registry.py,sha256=HAdYMfiJZvJr93qep54RqWWeuXlOaBXOUFCzNQcVyeE,2612
|
|
5
|
+
modelit/templates/perceptron/metadata.json,sha256=whYa5Gsf3u-a2YBtZyj5MfbPRpZL0vjucZO56W0DAuI,179
|
|
6
|
+
modelit/templates/perceptron/template.py,sha256=PGC3C7coO031FGBVzPG07l3TH0z-_yxAU149-9GsPPs,6587
|
|
7
|
+
modelit-0.1.0.dist-info/licenses/LICENSE,sha256=lXD4AUG6BxKcVQQyo1ZZ1EmLeddhv5BiTijXn9dxniw,1073
|
|
8
|
+
modelit-0.1.0.dist-info/METADATA,sha256=eF89jySNBo479KgWbmx9mpkybcK-XmVAN8TTKozsx94,1724
|
|
9
|
+
modelit-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
10
|
+
modelit-0.1.0.dist-info/entry_points.txt,sha256=lo9IncMlsAGm4J-pBatrr6jRX5YZnpnIXXxQBc5bEyM,45
|
|
11
|
+
modelit-0.1.0.dist-info/top_level.txt,sha256=9Xbdh13DiWvN4gKgklCotpkFXxGoIQivD_JOihCKHHA,8
|
|
12
|
+
modelit-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sameer Yashsmith
|
|
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
|
+
modelit
|