feat: Adds ability to parse bayesruns without timestamps
All checks were successful
gitea-physics/deepdog/pipeline/head This commit looks good
All checks were successful
gitea-physics/deepdog/pipeline/head This commit looks good
This commit is contained in:
19
tests/results/test_parse_filename.py
Normal file
19
tests/results/test_parse_filename.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import deepdog.results
|
||||
import pytest
|
||||
|
||||
|
||||
def test_parse_bayesrun_filename():
|
||||
valid1 = "20250226-204120-dot1-dot1-2-0.realdata.fast_filter.bayesrun.csv"
|
||||
|
||||
timestamp, slug = deepdog.results._parse_string_output_filename(valid1)
|
||||
assert timestamp == "20250226-204120"
|
||||
assert slug == "dot1-dot1-2-0"
|
||||
|
||||
valid2 = "dot1-dot1-2-0.realdata.fast_filter.bayesrun.csv"
|
||||
|
||||
timestamp, slug = deepdog.results._parse_string_output_filename(valid2)
|
||||
assert timestamp is None
|
||||
assert slug == "dot1-dot1-2-0"
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
deepdog.results._parse_string_output_filename("not_a_valid_filename")
|
Reference in New Issue
Block a user