setta 0.0.14.dev0__py3-none-any.whl → 0.0.14.dev1__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.
Potentially problematic release.
This version of setta might be problematic. Click here for more details.
- setta/__init__.py +1 -1
- setta/routers/interactive.py +24 -6
- setta/static/constants/Settings.json +1 -0
- setta/static/constants/constants.json +1 -0
- setta/static/frontend/assets/index-DQjclEVk.css +32 -0
- setta/static/frontend/assets/{index-eTf7hTS7.js → index-Dc8I4Z7x.js} +165 -165
- setta/static/frontend/index.html +2 -2
- setta/tasks/tasks.py +60 -4
- setta/tasks/utils.py +28 -7
- {setta-0.0.14.dev0.dist-info → setta-0.0.14.dev1.dist-info}/METADATA +1 -1
- {setta-0.0.14.dev0.dist-info → setta-0.0.14.dev1.dist-info}/RECORD +15 -15
- setta/static/frontend/assets/index-xJaZMJy2.css +0 -32
- {setta-0.0.14.dev0.dist-info → setta-0.0.14.dev1.dist-info}/LICENSE +0 -0
- {setta-0.0.14.dev0.dist-info → setta-0.0.14.dev1.dist-info}/WHEEL +0 -0
- {setta-0.0.14.dev0.dist-info → setta-0.0.14.dev1.dist-info}/entry_points.txt +0 -0
- {setta-0.0.14.dev0.dist-info → setta-0.0.14.dev1.dist-info}/top_level.txt +0 -0
setta/static/frontend/index.html
CHANGED
@@ -14,8 +14,8 @@
|
|
14
14
|
<meta name="description" content="setta" />
|
15
15
|
|
16
16
|
<title>setta.dev</title>
|
17
|
-
<script type="module" crossorigin src="/static/assets/index-
|
18
|
-
<link rel="stylesheet" crossorigin href="/static/assets/index-
|
17
|
+
<script type="module" crossorigin src="/static/assets/index-Dc8I4Z7x.js"></script>
|
18
|
+
<link rel="stylesheet" crossorigin href="/static/assets/index-DQjclEVk.css">
|
19
19
|
</head>
|
20
20
|
<body>
|
21
21
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
setta/tasks/tasks.py
CHANGED
@@ -64,15 +64,23 @@ class Tasks:
|
|
64
64
|
websocket_manager=None,
|
65
65
|
call_all=False,
|
66
66
|
subprocess_key=None,
|
67
|
+
project_config_id=None,
|
68
|
+
section_id=None,
|
69
|
+
idx=None,
|
70
|
+
call_type="call",
|
71
|
+
other_data=None,
|
67
72
|
):
|
68
73
|
# Create a list of tasks to run concurrently
|
69
74
|
tasks = []
|
70
75
|
results = []
|
71
76
|
|
72
77
|
for sp_key, sp_info in self.in_memory_subprocesses.items():
|
73
|
-
if subprocess_key and sp_key != subprocess_key
|
78
|
+
if (subprocess_key and sp_key != subprocess_key) or (
|
79
|
+
not match_subprocess_key(sp_key, project_config_id, section_id, idx)
|
80
|
+
):
|
74
81
|
continue
|
75
82
|
for fn_name, fnInfo in sp_info["fnInfo"].items():
|
83
|
+
# TODO: there's a bug where fnInfo["dependencies"] contains tuples and message.content.keys() are strings
|
76
84
|
if (
|
77
85
|
call_all
|
78
86
|
or None in fnInfo["dependencies"]
|
@@ -80,7 +88,12 @@ class Tasks:
|
|
80
88
|
):
|
81
89
|
# Send message to subprocess
|
82
90
|
sp_info["subprocess"].parent_conn.send(
|
83
|
-
{
|
91
|
+
{
|
92
|
+
"type": call_type,
|
93
|
+
"fn_name": fn_name,
|
94
|
+
"message": message,
|
95
|
+
"other_data": other_data,
|
96
|
+
}
|
84
97
|
)
|
85
98
|
|
86
99
|
# Create task for receiving response
|
@@ -131,7 +144,7 @@ class Tasks:
|
|
131
144
|
else:
|
132
145
|
results.append(result)
|
133
146
|
|
134
|
-
async def add_custom_fns(self, code_graph,
|
147
|
+
async def add_custom_fns(self, code_graph, exporter_obj):
|
135
148
|
for c in code_graph:
|
136
149
|
subprocess_key = c["subprocess_key"]
|
137
150
|
sp = self.in_memory_subprocesses.get(subprocess_key, {}).get("subprocess")
|
@@ -149,7 +162,7 @@ class Tasks:
|
|
149
162
|
{
|
150
163
|
"type": "import",
|
151
164
|
"imports": c["imports"],
|
152
|
-
"
|
165
|
+
"exporter_obj": exporter_obj,
|
153
166
|
}
|
154
167
|
)
|
155
168
|
result = await self.task_runner.run(sp.parent_conn.recv, [], RunType.THREAD)
|
@@ -181,6 +194,20 @@ class Tasks:
|
|
181
194
|
|
182
195
|
return initial_result["content"]
|
183
196
|
|
197
|
+
async def call_in_memory_subprocess_fn_with_new_exporter_obj(
|
198
|
+
self, project_config_id, idx, exporter_obj
|
199
|
+
):
|
200
|
+
initial_result = await self.call_in_memory_subprocess_fn(
|
201
|
+
TaskMessage(id=create_new_id(), content={}),
|
202
|
+
call_all=True,
|
203
|
+
project_config_id=project_config_id,
|
204
|
+
idx=idx,
|
205
|
+
call_type="call_with_new_exporter_obj",
|
206
|
+
other_data={"exporter_obj": exporter_obj},
|
207
|
+
)
|
208
|
+
|
209
|
+
return initial_result["content"]
|
210
|
+
|
184
211
|
def close(self):
|
185
212
|
self.stop_event.set()
|
186
213
|
for v in self.in_memory_subprocesses.values():
|
@@ -217,3 +244,32 @@ class Tasks:
|
|
217
244
|
for fnInfo in output[sp_key]["fnInfo"].values():
|
218
245
|
fnInfo["dependencies"] = list(fnInfo["dependencies"])
|
219
246
|
return output
|
247
|
+
|
248
|
+
|
249
|
+
def construct_subprocess_key(project_config_id, section_id, idx):
|
250
|
+
return f"{project_config_id}_{section_id}_{idx}"
|
251
|
+
|
252
|
+
|
253
|
+
def match_subprocess_key(
|
254
|
+
subprocess_key, project_config_id=None, section_id=None, idx=None
|
255
|
+
):
|
256
|
+
# If no filters are provided, return True
|
257
|
+
if project_config_id is None and section_id is None and idx is None:
|
258
|
+
return True
|
259
|
+
|
260
|
+
# Split the key into its components
|
261
|
+
parts = subprocess_key.split("_")
|
262
|
+
if len(parts) != 3:
|
263
|
+
return False
|
264
|
+
|
265
|
+
key_project_config_id, key_section_id, key_idx_str = parts
|
266
|
+
|
267
|
+
# Check if the extracted values match the provided filters
|
268
|
+
if project_config_id is not None and key_project_config_id != project_config_id:
|
269
|
+
return False
|
270
|
+
if section_id is not None and key_section_id != section_id:
|
271
|
+
return False
|
272
|
+
if idx is not None and key_idx_str != str(idx):
|
273
|
+
return False
|
274
|
+
|
275
|
+
return True
|
setta/tasks/utils.py
CHANGED
@@ -109,7 +109,7 @@ class SettaInMemoryFnSubprocess:
|
|
109
109
|
fns_dict, module, module_name
|
110
110
|
)
|
111
111
|
for k in added_fn_names:
|
112
|
-
cache[k] = msg["
|
112
|
+
cache[k] = msg["exporter_obj"]
|
113
113
|
dependencies[k] = get_task_metadata(fns_dict[k], cache[k])
|
114
114
|
|
115
115
|
self.child_conn.send(
|
@@ -120,12 +120,23 @@ class SettaInMemoryFnSubprocess:
|
|
120
120
|
)
|
121
121
|
|
122
122
|
elif msg_type == "call":
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
123
|
+
result, return_message_type = self.call_imported_fn(
|
124
|
+
msg, fns_dict, cache
|
125
|
+
)
|
126
|
+
self.child_conn.send(
|
127
|
+
{
|
128
|
+
"status": "success",
|
129
|
+
"content": result,
|
130
|
+
"messageType": return_message_type,
|
131
|
+
}
|
132
|
+
)
|
128
133
|
|
134
|
+
elif msg_type == "call_with_new_exporter_obj":
|
135
|
+
# replace old exporter_obj
|
136
|
+
cache[msg["fn_name"]] = msg["other_data"]["exporter_obj"]
|
137
|
+
result, return_message_type = self.call_imported_fn(
|
138
|
+
msg, fns_dict, cache
|
139
|
+
)
|
129
140
|
self.child_conn.send(
|
130
141
|
{
|
131
142
|
"status": "success",
|
@@ -144,6 +155,14 @@ class SettaInMemoryFnSubprocess:
|
|
144
155
|
}
|
145
156
|
)
|
146
157
|
|
158
|
+
def call_imported_fn(self, msg, fns_dict, cache):
|
159
|
+
fn_name = msg["fn_name"]
|
160
|
+
message = self.process_message(fn_name, msg["message"], cache)
|
161
|
+
fn = fns_dict[fn_name]
|
162
|
+
result = fn.fn(message)
|
163
|
+
return_message_type = fn.return_message_type
|
164
|
+
return result, return_message_type
|
165
|
+
|
147
166
|
def close(self):
|
148
167
|
try:
|
149
168
|
logger.debug("Initiating shutdown sequence")
|
@@ -181,7 +200,9 @@ class SettaInMemoryFnSubprocess:
|
|
181
200
|
if fn_name in cache:
|
182
201
|
exporter_obj = cache[fn_name]
|
183
202
|
for k, v in message.content.items():
|
184
|
-
nice_str = exporter_obj.var_name_mapping
|
203
|
+
nice_str = exporter_obj.var_name_mapping.get(tuple(json.loads(k)))
|
204
|
+
if not nice_str:
|
205
|
+
continue
|
185
206
|
p_dict, key = nested_access(exporter_obj.output, nice_str)
|
186
207
|
p_dict[key] = v
|
187
208
|
message.content = exporter_obj.output
|
@@ -1,4 +1,4 @@
|
|
1
|
-
setta/__init__.py,sha256=
|
1
|
+
setta/__init__.py,sha256=eUGL_FNS_R5v7FeGryUkH75EO-FlY7eYJmhs7R6rG8k,28
|
2
2
|
setta/server.py,sha256=q4w9WG7SuLxwYtgXUCQyLt7t_HLmQV4y5abqvm7-uEA,4861
|
3
3
|
setta/start.py,sha256=5sMZ7WH3KV9Q0v186PsaYqsWOz7hebyrpXbBOp9wQww,3589
|
4
4
|
setta/cli/__init__.py,sha256=UxZG_VOMuF6lEBT3teUgTS9ulsK3wt3Gu3BbAQiAmt8,47
|
@@ -88,7 +88,7 @@ setta/routers/artifact.py,sha256=9wHdreg5DsLshhET-6gEDw2Apw_-r8bRF1x3-_dD9mU,266
|
|
88
88
|
setta/routers/code_info.py,sha256=rDBLkr5VQOlktap3hWA73ls0VrBi5y4mc_SfWzw9ad0,857
|
89
89
|
setta/routers/dependencies.py,sha256=0pz1HuvhlJDIVopvkfRTgmLJhDPGw0g33uj2qXgpxQs,1228
|
90
90
|
setta/routers/in_memory_fn_stdout_websocket.py,sha256=T2BpLzh6PwYQP0qIkFS4r_VfEKBlwl4gkwIaq6r6Phs,604
|
91
|
-
setta/routers/interactive.py,sha256=
|
91
|
+
setta/routers/interactive.py,sha256=TNXAupBXIuCn711olZPJemFB6WrBKWyy4inHbjNh9aw,5646
|
92
92
|
setta/routers/lsp.py,sha256=DAZqdiRKDWJ9ikjwQetV4_8s9U-EDC91ToJA3u57qnU,385
|
93
93
|
setta/routers/projects.py,sha256=p3zPD3jobYOxBGJSSIYS1Aqu1w-PrJCcEN6dPJ0DT6E,5255
|
94
94
|
setta/routers/reference_renaming.py,sha256=Ec1hz2Nz_hYqk8GyGmUcWKvXo-lVEDbIIK2YbX-wi00,3598
|
@@ -97,8 +97,8 @@ setta/routers/settings.py,sha256=1S7Epj4O7jElixjNaNlRplBGiYdkj9mFeNQeeOrtQw4,103
|
|
97
97
|
setta/routers/terminals.py,sha256=91I3tVUPJtLyCD_-E_qBQ_k8uuNUrcXl5P7sCTQuDQE,2435
|
98
98
|
setta/routers/websocket.py,sha256=6fSROv9C5PobPXppUWwNLDDO0p8VADYaf2KcgIuTQp4,1121
|
99
99
|
setta/static/constants/BaseUITypes.json,sha256=WQUgvN4eq9uU6ifhDBhtyEIoQFsAC022DSEut-E-4bA,4057
|
100
|
-
setta/static/constants/Settings.json,sha256=
|
101
|
-
setta/static/constants/constants.json,sha256=
|
100
|
+
setta/static/constants/Settings.json,sha256=uE9PWakebkxUaLx-UyiplyTFTwVj2ogomgoalNnQSkw,3532
|
101
|
+
setta/static/constants/constants.json,sha256=vzBINDWfx-4kbbz-2B8OASzykm9aCqr3yyD2yKoKzWU,5403
|
102
102
|
setta/static/constants/db_init.sql,sha256=rdc0C5Hx_6d-QWEEbSqscArTyc77w9cMj8vbIVS8ZBw,8436
|
103
103
|
setta/static/constants/defaultValues.json,sha256=Vh8WQZJYSc0QBu5WnNQO2dQtuYHZuy3WKfQEr9sBSqE,3063
|
104
104
|
setta/static/constants/settingsProject.json,sha256=3s2PQSBXqV9BYnibKY1xbLZfEYjL6JeLnPVEusfmz9c,14678
|
@@ -109,7 +109,7 @@ setta/static/frontend/browserconfig.xml,sha256=w0iw1t89kA7-965LTfyLYrFzewTQnUWE_
|
|
109
109
|
setta/static/frontend/favicon-16x16.png,sha256=q67Crpy8s3wryu7Y3kffPeysN99Lt4XeFygXhPKize8,740
|
110
110
|
setta/static/frontend/favicon-32x32.png,sha256=4NKXYticYdMrRHmVveHjxqnBU1HWgBT5JyJG8lx3BNE,1027
|
111
111
|
setta/static/frontend/favicon.ico,sha256=02qhEBLsvsgBTZX6dcZElMyivlvrR7Yr6wB8ItEZFsc,15086
|
112
|
-
setta/static/frontend/index.html,sha256=
|
112
|
+
setta/static/frontend/index.html,sha256=utkTEIoq6CO72UfSZjOrjRzBl81o6rEb3D8hyk6S8wU,1298
|
113
113
|
setta/static/frontend/manifest.json,sha256=ULPYw5A68_eNhxuUVXqxT045yhkurKPSz6hjyGcnmhQ,492
|
114
114
|
setta/static/frontend/mstile-144x144.png,sha256=wQqckmRWre2NCCevevI3rv4j0tcduVMkpYr2tPj73cs,2692
|
115
115
|
setta/static/frontend/mstile-150x150.png,sha256=FUwy6PipTofnhmJB5CdXWYgwy-2inq_sIOdOwdDklcY,2674
|
@@ -184,8 +184,8 @@ setta/static/frontend/assets/cormorant-garamond-cyrillic-ext-700-italic-gsr366qd
|
|
184
184
|
setta/static/frontend/assets/cormorant-garamond-latin-700-italic-BQbwEFjx.woff2,sha256=C8U-EgDBT8MpU4FpUNBJdybVpKvRhg_3WDpUDCw9XZg,20348
|
185
185
|
setta/static/frontend/assets/cormorant-garamond-latin-ext-700-italic-DnnS5iSC.woff2,sha256=Ulc44CPXdUiI5dY86W76HLk7801Fm9_QywCV-8GRtFU,17240
|
186
186
|
setta/static/frontend/assets/cormorant-garamond-vietnamese-700-italic-2_nTgjbG.woff2,sha256=mVYwN54qI0RLXqyrDGPUNpBHWSJDKjgUyBRWa2FJ_ao,5248
|
187
|
-
setta/static/frontend/assets/index-
|
188
|
-
setta/static/frontend/assets/index-
|
187
|
+
setta/static/frontend/assets/index-DQjclEVk.css,sha256=uIx7VJi9TIDdzOMllLQNKxOMTytUkdRv9LVJyiB190g,238315
|
188
|
+
setta/static/frontend/assets/index-Dc8I4Z7x.js,sha256=Jm4TDPmcXViJsYacbh4zZZdf9ICR0__pV71NSrkMDhA,3082204
|
189
189
|
setta/static/frontend/assets/inter-all-400-normal-ByZ5TkcW.woff,sha256=BU8S0GmcIMyYte4ESEdQJO-WvL2Rb-38m1n0ujdbYxI,128624
|
190
190
|
setta/static/frontend/assets/inter-all-600-normal-BQl_S1BW.woff,sha256=wDdp5VNyQL_IbxcPThD2qI-ETg_QKj7AmCwMCjqDfLE,139072
|
191
191
|
setta/static/frontend/assets/inter-all-800-normal-BdAoPad8.woff,sha256=FdxuS9xuVumB5nbVcCXyt3IWqzS4Z75qiRz_0FV5al0,139120
|
@@ -230,8 +230,8 @@ setta/static/seed/.DS_Store,sha256=ENxJvDQd7Te_U8gExcXtHE-mAeBUYOHELRfDWgN1NmA,6
|
|
230
230
|
setta/static/seed/examples/.DS_Store,sha256=1lFlJ5EFymdzGAUAaI30vcaaLHt3F1LwpG7xILf9jsM,6148
|
231
231
|
setta/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
232
232
|
setta/tasks/task_runner.py,sha256=gMXpfZWFMQbix2MfrHVCKB7BxQCjO8JH2P8cxUmt1ms,849
|
233
|
-
setta/tasks/tasks.py,sha256=
|
234
|
-
setta/tasks/utils.py,sha256=
|
233
|
+
setta/tasks/tasks.py,sha256=FT-JxJkbaxUIYvKjcLVc1PiEiKk89jNjM22oShpEDzw,10164
|
234
|
+
setta/tasks/utils.py,sha256=Pil2g0hM5YRcQCzMUrXsfFMs5-r3gi6wzvwOfV-2t90,10662
|
235
235
|
setta/tasks/fns/__init__.py,sha256=JhGzzQGaT9BWtF3pOmguh6pzIF9kdG3jdDNLyYZ2w7g,461
|
236
236
|
setta/tasks/fns/codeAreaAutocomplete.py,sha256=gJ5JbjkWDyTothr-UF-YlOxrbVzj2iyOVK7XD3lfhSQ,6416
|
237
237
|
setta/tasks/fns/codeAreaFindTemplateVars.py,sha256=vD9rY8VNPavv6VKa1bnxRPPRDNvFQy6mPIZRl-_3GnY,3708
|
@@ -252,9 +252,9 @@ setta/utils/generate_new_filename.py,sha256=KBLX6paDmTvXR-027TpqQkfijIXc7mCfhen-
|
|
252
252
|
setta/utils/section_contents.py,sha256=V2HQPik6DfSXw4j7IalbP5AZ3OEGCbtL5ub3xL-Q_Qo,4141
|
253
253
|
setta/utils/utils.py,sha256=KjzcvgM3Ab3IcE8vaWYtgBpwzPLKg0LmblnHLoYZJHM,9164
|
254
254
|
setta/utils/websocket_manager.py,sha256=MBIMI8xxOFQF4lT3on4pupi1ttEWXdWPV4fI2YP_UJU,3925
|
255
|
-
setta-0.0.14.
|
256
|
-
setta-0.0.14.
|
257
|
-
setta-0.0.14.
|
258
|
-
setta-0.0.14.
|
259
|
-
setta-0.0.14.
|
260
|
-
setta-0.0.14.
|
255
|
+
setta-0.0.14.dev1.dist-info/LICENSE,sha256=us9fuCq9wmiZVzayjKxNZ2iJYF6dROe0Qp57ToCO7XU,11361
|
256
|
+
setta-0.0.14.dev1.dist-info/METADATA,sha256=gpa8QlEaPtOczgpaFOsxXOcRjmN2KE3mROn5s7GhESA,7517
|
257
|
+
setta-0.0.14.dev1.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
258
|
+
setta-0.0.14.dev1.dist-info/entry_points.txt,sha256=P0qCESy9fWF2q1EQ9JufGldCSnPHplDPn8J6Bgk5hB0,42
|
259
|
+
setta-0.0.14.dev1.dist-info/top_level.txt,sha256=8G4lmRzVOnJ11_DescPVHE6MQZH-o06A0nGsDDV2ngY,6
|
260
|
+
setta-0.0.14.dev1.dist-info/RECORD,,
|