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

Small updates to multi reader #470

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Changes from all commits
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
10 changes: 8 additions & 2 deletions src/pynxtools/dataconverter/readers/multi/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ def get_vals_on_same_level(key):
dim_dict = {}
for dim in dims:
new_key = key.replace("*", dim)
new_val = value.replace("*", dim)
if isinstance(value, str):
new_val = value.replace("*", dim)
elif isinstance(value, list):
new_val = [val.replace("*", dim) for val in value]
else:
new_val = value

if new_key not in config_file_dict and new_val not in get_vals_on_same_level(
new_key
Expand Down Expand Up @@ -283,7 +288,8 @@ def dict_sort_key(keyval: Tuple[str, Any]) -> bool:
if "*" in key:
dims = callbacks.dims(key, value)
dim_data = fill_wildcard_data_indices(config_dict, key, value, dims)
for k, v in dim_data.items():

for k, v in dim_data.copy().items():
resolve_special_keys(
dim_data,
k,
Expand Down
Loading