Skip to content
Snippets Groups Projects
Commit 6cda6fdf authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Revert "Option to parse coordinates from filename"

This reverts commit 3332573d.
parent 3332573d
No related branches found
No related tags found
No related merge requests found
from collections import OrderedDict
import json
from pathlib import Path
import re
import shutil
import pandas as pd
......@@ -143,17 +142,11 @@ class FileBatchRunnerClient(HttpClient):
where_remote = Path(self.remote_paths['input']) / inp['directory']
def _get_file_info(filename):
info = {
return {
'remote_path': (where_remote / filename).as_posix(),
'local_path': where_local / filename,
'is_multiposition': is_multiposition,
}
if (coord_regex := inp.get('coord_regex')) is not None:
for coord_k, coord_v in re.search(coord_regex, filename).groupdict().items():
if coord_k.lower() not in ['well', 'position', 'time']:
raise InvalidStackCoordinateKeyError(f'Cannot interpret coordinate {coord_k}')
info[f'coord_{coord_k.lower()}'] = int(coord_v)
return info
paths = paths + [_get_file_info(f) for f in files]
if max_count is not None:
df = pd.DataFrame(paths).head(min(max_count, len(paths)))
......@@ -276,7 +269,4 @@ class WatchPathVerificationError(Error):
pass
class TasksRemainingError(Error):
pass
class InvalidStackCoordinateKeyError(Error):
pass
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment