Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SVLT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ALMF
SVLT
Commits
3d9bd7fa
Commit
3d9bd7fa
authored
1 month ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Batch runner allows pattern matching of subdirectories
parent
2e1e0a2e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!4
Migrate project from rhodes/model_server to grp-almf/svlt
,
!3
Migrate from rhodes/model_server to grp-almf/svlt repo
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
model_server/clients/batch_runner.py
+13
-7
13 additions, 7 deletions
model_server/clients/batch_runner.py
with
13 additions
and
7 deletions
model_server/clients/batch_runner.py
+
13
−
7
View file @
3d9bd7fa
...
...
@@ -144,7 +144,6 @@ class FileBatchRunnerClient(HttpClient):
matching_files
.
append
(
f
.
name
)
return
matching_files
files
+=
_append_files_by_pattern
(
where_local
,
inp
.
get
(
'
pattern
'
))
is_multiposition
=
inp
.
get
(
'
multiposition
'
,
False
)
where_remote
=
Path
(
self
.
remote_paths
[
'
input
'
])
/
inp
[
'
directory
'
]
...
...
@@ -153,20 +152,27 @@ class FileBatchRunnerClient(HttpClient):
for
subdir
in
where_local
.
iterdir
():
if
not
subdir
.
is_dir
():
continue
if
(
sdp
:
=
inp
.
get
(
'
subdirectory_pattern
'
))
is
not
None
:
if
sdp
.
upper
()
not
in
subdir
.
name
.
upper
():
continue
matches
=
_append_files_by_pattern
(
subdir
,
inp
.
get
(
'
pattern
'
))
files
+=
[
f
'
{
subdir
}
/
{
f
}
'
for
f
in
matches
]
else
:
files
+=
_append_files_by_pattern
(
where_local
,
inp
.
get
(
'
pattern
'
))
def
_get_file_info
(
f
ilename
):
def
_get_file_info
(
f
path_str
):
info
=
{
'
remote_path
'
:
(
where_remote
/
f
ilename
).
as_posix
(),
'
local_path
'
:
where_local
/
f
ilename
,
'
remote_path
'
:
(
where_remote
/
f
path_str
).
as_posix
(),
'
local_path
'
:
where_local
/
f
path_str
,
'
is_multiposition
'
:
is_multiposition
,
}
filename
=
Path
(
fpath_str
).
name
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
)
if
coord_k
.
lower
()
in
[
'
well
'
,
'
position
'
,
'
time
'
,
'
date
'
]:
info
[
f
'
coord_
{
coord_k
.
lower
()
}
'
]
=
int
(
coord_v
)
else
:
info
[
f
'
coord_
{
coord_k
.
lower
()
}
'
]
=
coord_v
return
info
paths
=
paths
+
[
_get_file_info
(
f
)
for
f
in
files
]
if
max_count
is
not
None
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment