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):
3838def get_xchem_subdirectory (visit ):
3939
4040 # 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]+)([_].*)?$"
4242
4343 match = re .search (pattern , visit )
4444
@@ -47,8 +47,8 @@ def get_xchem_subdirectory(visit):
4747 f'the visit name "{ visit } " does not conform to the visit naming convention'
4848 )
4949
50- part1 = match .group (1 )
51- part2 = match .group (2 )
50+ part1 = match .group (1 ). lower ()
51+ part2 = match .group (2 ). lower ()
5252
5353 subdirectory = f"{ part1 } /{ part1 } -{ part2 } "
5454
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ async def _main_coroutine(
3232
3333 # Check valid visits.
3434 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"
3538 assert get_xchem_subdirectory ("aa12345-1234" ) == "aa12345/aa12345-1234"
3639 assert get_xchem_subdirectory ("aa12345-1234_" ) == "aa12345/aa12345-1234"
3740 assert (
You can’t perform that action at this time.
0 commit comments