We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d19cc94 commit dcd3858Copy full SHA for dcd3858
src/optimade_maker/convert.py
@@ -321,6 +321,9 @@ def _set_unique_entry_ids(entry_ids: list[str]) -> list[str]:
321
322
"""
323
324
+ if len(entry_ids) == 1:
325
+ return [os.path.splitext(os.path.basename(entry_ids[0]))[0]]
326
+
327
new_ids: list[str] = list(entry_ids)
328
329
def _strip_common_path(ids, from_back=False):
tests/test_convert.py
@@ -158,3 +158,8 @@ def test_unique_id_generator():
158
"set2/3.xyz",
159
"set2/4.xyz",
160
]
161
162
+ entry_ids = [
163
+ "data/structures/1.cif",
164
+ ]
165
+ assert _set_unique_entry_ids(entry_ids) == ["1"]
0 commit comments