File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ def get_visit_year(beamline, visit):
38
38
def get_xchem_subdirectory (visit ):
39
39
40
40
# This is the pattern all visits must have.
41
- pattern = r"^([a- z][a -z][0-9][0-9][0-9][0-9][0-9])[-]([0-9]+)([_].*)?$"
41
+ pattern = r"^([A-Za- z][A-Za -z][0-9][0-9][0-9][0-9][0-9])[-]([0-9]+)([_].*)?$"
42
42
43
43
match = re .search (pattern , visit )
44
44
@@ -47,8 +47,8 @@ def get_xchem_subdirectory(visit):
47
47
f'the visit name "{ visit } " does not conform to the visit naming convention'
48
48
)
49
49
50
- part1 = match .group (1 )
51
- part2 = match .group (2 )
50
+ part1 = match .group (1 ). lower ()
51
+ part2 = match .group (2 ). lower ()
52
52
53
53
subdirectory = f"{ part1 } /{ part1 } -{ part2 } "
54
54
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ async def _main_coroutine(
32
32
33
33
# Check valid visits.
34
34
assert get_xchem_subdirectory ("aa12345-1" ) == "aa12345/aa12345-1"
35
+ assert get_xchem_subdirectory ("AB12345-1" ) == "ab12345/ab12345-1"
36
+ assert get_xchem_subdirectory ("Ab12345-1" ) == "ab12345/ab12345-1"
37
+ assert get_xchem_subdirectory ("aB12345-1" ) == "ab12345/ab12345-1"
35
38
assert get_xchem_subdirectory ("aa12345-1234" ) == "aa12345/aa12345-1234"
36
39
assert get_xchem_subdirectory ("aa12345-1234_" ) == "aa12345/aa12345-1234"
37
40
assert (
You can’t perform that action at this time.
0 commit comments