diff --git a/deepdog/results/read_csv.py b/deepdog/results/read_csv.py index ed9d4b8..1d1af20 100644 --- a/deepdog/results/read_csv.py +++ b/deepdog/results/read_csv.py @@ -8,6 +8,8 @@ MODEL_REGEXES = [ r"geom_(?P-?\d+)_(?P-?\d+)_(?P-?\d+)_(?P-?\d+)_(?P-?\d+)_(?P-?\d+)-orientation_(?Pfree|fixedxy|fixedz)-dipole_count_(?P\d+)_(?P\w*)", r"geom_(?P-?\d+)_(?P-?\d+)_(?P-?\d+)_(?P-?\d+)_(?P-?\d+)_(?P-?\d+)-magnitude_(?P\d*\.?\d+)-orientation_(?Pfree|fixedxy|fixedz)-dipole_count_(?P\d+)_(?P\w*)", r"geom_(?P-?\d*\.?\d+)_(?P-?\d*\.?\d+)_(?P-?\d*\.?\d+)_(?P-?\d*\.?\d+)_(?P-?\d*\.?\d+)_(?P-?\d*\.?\d+)-magnitude_(?P\d*\.?\d+)-orientation_(?Pfree|fixedxy|fixedz)-dipole_count_(?P\d+)_(?P\w*)", + r"geom_(?P-?\d+)_(?P-?\d+)_(?P-?\d+)_(?P-?\d+)_(?P-?\d+)_(?P-?\d+)-magnitude_(?P-?\d*\.?\d+)-orientation_(?Pfree|fixedxy|fixedz)-dipole_count_(?P\d+)_(?P\w*)", + r"geom_(?P-?\d*\.?\d+)_(?P-?\d*\.?\d+)_(?P-?\d*\.?\d+)_(?P-?\d*\.?\d+)_(?P-?\d*\.?\d+)_(?P-?\d*\.?\d+)-magnitude_(?P-?\d*\.?\d+)-orientation_(?Pfree|fixedxy|fixedz)-dipole_count_(?P\d+)_(?P\w*)", ] ] diff --git a/tests/results/test_column_results.py b/tests/results/test_column_results.py index b277a2c..b76508e 100644 --- a/tests/results/test_column_results.py +++ b/tests/results/test_column_results.py @@ -48,6 +48,28 @@ def test_parse_groupdict_with_magnitude(): assert parsed == expected +def test_parse_groupdict_with_negative_magnitude(): + example_column_name = "geom_-20_20_-10_10_0_5-magnitude_-3.5-orientation_free-dipole_count_100_success" + + parsed = deepdog.results.read_csv._parse_bayesrun_column(example_column_name) + assert parsed is not None + expected = deepdog.results.read_csv.BayesrunColumnParsed( + { + "xmin": "-20", + "xmax": "20", + "ymin": "-10", + "ymax": "10", + "zmin": "0", + "zmax": "5", + "orientation": "free", + "avg_filled": "100", + "log_magnitude": "-3.5", + "field_name": "success", + } + ) + assert parsed == expected + + # def test_parse_no_match_column_name(): # parsed = deepdog.results.parse_bayesrun_column("There's nothing here") # assert parsed is None