Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mrdata common public
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
hpc-kyb
mrdata common public
Commits
2cd63f06
Commit
2cd63f06
authored
10 months ago
by
Blake Fitch
Browse files
Options
Downloads
Patches
Plain Diff
enable experiment_id_validate() to return true with lowercase letters.
parent
071ddb31
No related branches found
Branches containing commit
Tags
STAG-2024-06-17-15-13-08
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pymods/experiment_id/experiment_id.py
+8
-6
8 additions, 6 deletions
pymods/experiment_id/experiment_id.py
with
8 additions
and
6 deletions
pymods/experiment_id/experiment_id.py
+
8
−
6
View file @
2cd63f06
...
...
@@ -50,16 +50,18 @@ def experiment_number_to_id( experiment_number ):
# Validate
def
experiment_id_validate
(
experiment_id
):
def
experiment_id_validate
(
a_
experiment_id
):
try
:
if
len
(
experiment_id
)
!=
9
:
if
trc
:
print
(
"
experiment_id not 9 chars. experiment_id:
"
,
experiment_id
)
if
len
(
a_
experiment_id
)
!=
9
:
if
trc
:
print
(
"
experiment_id not 9 chars.
a_
experiment_id:
"
,
a_
experiment_id
)
return
False
if
experiment_id
[
4
:
5
]
!=
'
-
'
:
if
trc
:
print
(
"
experiment_id 5th char not - (hyphen). experiment_id:
"
,
experiment_id
)
if
a_
experiment_id
[
4
:
5
]
!=
'
-
'
:
if
trc
:
print
(
"
experiment_id 5th char not - (hyphen).
a_
experiment_id:
"
,
a_
experiment_id
)
return
False
experiment_id
=
a_experiment_id
.
upper
()
exp_hash_id
=
experiment_id
[:
4
]
+
experiment_id
[
5
:]
if
trc
:
print
(
"
exp_hash_id:
"
,
exp_hash_id
)
...
...
@@ -81,7 +83,7 @@ def experiment_id_validate( experiment_id ):
rc
=
exp_hash_id_rev
==
experiment_id
return
rc
except
Exception
as
ex
:
if
trc
:
print
(
"
Failed to validate id:
"
+
str
(
experiment_id
)
+
"
exr:
"
+
str
(
ex
)
)
if
trc
:
print
(
"
Failed to validate id:
"
+
str
(
a_
experiment_id
)
+
"
exr:
"
+
str
(
ex
)
)
return
False
if
__name__
==
"
__main__
"
:
...
...
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