From b458377c80774785faed647e73a6f7ce3c45b217 Mon Sep 17 00:00:00 2001 From: Jesse Pisel Date: Tue, 23 Mar 2021 12:03:49 -0500 Subject: [PATCH 1/2] update parse_directory updated parse_directory so that capitalization in the file extension does not matter. --- alaska/keyword_tree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alaska/keyword_tree.py b/alaska/keyword_tree.py index 8b60397..5e72c24 100644 --- a/alaska/keyword_tree.py +++ b/alaska/keyword_tree.py @@ -266,7 +266,7 @@ def parse_directory(self, directory): comprehensive_dict = {} comprehensive_not_found = [] for filename in os.listdir(directory): - if filename.endswith(".las"): + if filename.endswith((".LAS",".las")): path = os.path.join(directory, filename) las = lasio.read(path) mnem, desc = [], [] From ff77412929b9bdad1d9155e5c97366c3fcc58d5e Mon Sep 17 00:00:00 2001 From: Jesse Pisel Date: Tue, 23 Mar 2021 12:18:07 -0500 Subject: [PATCH 2/2] Update test_parser.py added test to ensure that the alias dictionary has keys when parsing a directory --- alaska/tests/test_parser.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/alaska/tests/test_parser.py b/alaska/tests/test_parser.py index 4d2221d..5148f61 100644 --- a/alaska/tests/test_parser.py +++ b/alaska/tests/test_parser.py @@ -199,6 +199,15 @@ def test_parse_directory_2(): assert "empty" in not_aliased +def test_parse_directory_3(): + """ + Test that Aliaser can parse .LAS and .las + """ + aliaser = Alias() + aliased, _ = aliaser.parse_directory(test_dir_1) + assert len(aliased.keys()) > 0 + + def test_dictionary_parse_1(): """ Test that dictionary parser in Aliaser parses and returns correct labels