Skip to content

Commit 2ddf68d

Browse files
committed
fix escaping for deleting jobs. hullplot bug. scope joining with input. version 0.2.1
1 parent 34c10c9 commit 2ddf68d

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

latentscope/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.2.0'
1+
__version__ = '0.2.1'

latentscope/scripts/scope.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ def get_next_scopes_number(dataset):
130130
json.dump([], f)
131131

132132
input_df = pd.read_parquet(os.path.join(DATA_DIR, dataset_id, "input.parquet"))
133-
combined_df = input_df[input_df.index.isin(scope_parquet['ls_index'])]
133+
input_df.reset_index(inplace=True)
134+
input_df = input_df[input_df['index'].isin(scope_parquet['ls_index'])]
135+
combined_df = input_df.join(scope_parquet.set_index('ls_index'), on='index', rsuffix='_ls')
134136
combined_df.to_parquet(os.path.join(directory, id + "-input.parquet"))
135137

136138
print("wrote scope", id)

latentscope/server/bulk.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def delete_rows():
164164

165165
def update_combined(df, dataset_id, scope_id):
166166
input_df = pd.read_parquet(os.path.join(DATA_DIR, dataset_id, "input.parquet"))
167-
combined_df = input_df[input_df.index.isin(df['ls_index'])]
167+
input_df.reset_index(inplace=True)
168+
input_df = input_df[input_df['index'].isin(df['ls_index'])]
169+
combined_df = input_df.join(df.set_index('ls_index'), on='index', rsuffix='_ls')
168170
combined_df.to_parquet(os.path.join(DATA_DIR, dataset_id, "scopes", scope_id + "-input.parquet"))
169-

latentscope/server/jobs.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ def delete_embedding():
239239

240240

241241
job_id = str(uuid.uuid4())
242-
command = f'rm -rf "{os.path.join(DATA_DIR, dataset, "embeddings", f"{embedding_id}*")}"'
242+
path = os.path.join(DATA_DIR, dataset, "embeddings", f"{embedding_id}*").replace(" ", "\\ ")
243+
command = f'rm -rf {path}'
243244
for umap in umaps_to_delete:
244245
delete_umap(dataset, umap)
245246
threading.Thread(target=run_job, args=(dataset, job_id, command)).start()
@@ -284,10 +285,12 @@ def delete_umap(dataset, umap_id):
284285

285286

286287
job_id = str(uuid.uuid4())
287-
command = f'rm -rf "{os.path.join(DATA_DIR, dataset, "umaps", f"{umap_id}*")}"'
288+
path = os.path.join(DATA_DIR, dataset, "umaps", f"{umap_id}*").replace(" ", "\\ ")
289+
command = f'rm -rf {path}'
288290
# Create the rm -rf commands from the clusters_to_delete list
289291
for cluster in clusters_to_delete:
290-
command += f'; rm "{os.path.join(DATA_DIR, dataset, "clusters", f"{cluster}*")}"'
292+
cpath = os.path.join(DATA_DIR, dataset, "clusters", f"{cluster}*").replace(" ", "\\ ")
293+
command += f'; rm -rf {cpath}'
291294
threading.Thread(target=run_job, args=(dataset, job_id, command)).start()
292295
return jsonify({"job_id": job_id})
293296

@@ -310,7 +313,8 @@ def delete_cluster():
310313
dataset = request.args.get('dataset')
311314
cluster_id = request.args.get('cluster_id')
312315
job_id = str(uuid.uuid4())
313-
command = f'rm -rf "{os.path.join(DATA_DIR, dataset, "clusters", f"{cluster_id}*")}"'
316+
path = os.path.join(DATA_DIR, dataset, "clusters", f"{cluster_id}*").replace(" ", "\\ ")
317+
command = f'rm -rf {path}'
314318
threading.Thread(target=run_job, args=(dataset, job_id, command)).start()
315319
return jsonify({"job_id": job_id})
316320

@@ -354,7 +358,8 @@ def delete_scope():
354358
scope_id = request.args.get('scope_id')
355359

356360
job_id = str(uuid.uuid4())
357-
command = f'rm -rf "{os.path.join(DATA_DIR, dataset, "scopes", f"{scope_id}*")}"'
361+
path = os.path.join(DATA_DIR, dataset, "scopes", f"{scope_id}*").replace(" ", "\\ ")
362+
command = f'rm -rf {path}'
358363
threading.Thread(target=run_job, args=(dataset, job_id, command)).start()
359364
return jsonify({"job_id": job_id})
360365

web/src/components/HullPlot.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useEffect, useRef } from 'react';
22
// import { scaleLinear } from 'd3-scale';
33
import { line, curveLinearClosed, curveCatmullRomClosed } from 'd3-shape';
44
import { select } from 'd3-selection';
5-
// import { transition } from 'd3-transition';
5+
import { transition } from 'd3-transition';
66
import { easeExpOut, easeExpIn, easeCubicInOut} from 'd3-ease';
77
// import { interpolate } from 'flubber';
88

0 commit comments

Comments
 (0)