Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update validity management code to new format #67

Merged
merged 6 commits into from
Nov 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test fixing
ggmarshall authored and gipert committed Nov 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit e7ad60e556f8850c994159775f9d6d99ddb244ff
7 changes: 5 additions & 2 deletions src/legendmeta/textdb.py
Original file line number Diff line number Diff line change
@@ -401,9 +401,12 @@ def on(
system: 'all', 'phy', 'cal', 'lar', ...
query only a data taking "system".
"""
yml = self.__path__ / "validity.yaml"
for ext in utils.___file_extensions__["yaml"]:
yml = self.__path__ / f"validity{ext}"
if yml.is_file():
break
if not yml.is_file():
msg = f"no validity.yaml file found in {self.__path__!s}"
msg = f"no validity.yaml / validity.yml file found in {self.__path__!s}"
raise RuntimeError(msg)

file_list = Catalog.get_files(str(yml), timestamp, system)
4 changes: 2 additions & 2 deletions tests/test_jsondb.py
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ def test_props():
Path(__file__).parent / "testdb/dir1/file3.yaml"
)

test_dict2 = Props.read_from(str(Path(__file__).parent / "testdb/file3.yaml"))
test_dict2 = Props.read_from(str(Path(__file__).parent / "testdb/file3.json"))

# test add_to
Props.add_to(test_dict, test_dict2)
@@ -36,7 +36,7 @@ def test_props():
test_dict = Props.read_from(
[
str(Path(__file__).parent / "testdb/file2.yaml"),
str(Path(__file__).parent / "testdb/file3.yaml"),
str(Path(__file__).parent / "testdb/file3.json"),
],
subst_pathvar=True,
trim_null=True,
1 change: 0 additions & 1 deletion tests/testdb/dir1/file6.yml

This file was deleted.

22 changes: 0 additions & 22 deletions tests/testdb/dir1/validity.yml

This file was deleted.