mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
fix: erroneous replica separator in json format caught and corrected
This commit is contained in:
parent
dbcceeea3a
commit
c5c82dae21
1 changed files with 7 additions and 2 deletions
|
@ -307,10 +307,15 @@ def import_json_string(json_string, verbose=True, full_output=False):
|
|||
retd['is_merged'] = {}
|
||||
for ens in d:
|
||||
for rep in ens['replica']:
|
||||
retd['names'].append(rep['name'])
|
||||
rep_name = rep['name']
|
||||
if len(rep_name) > len(ens["id"]):
|
||||
tmp_list = list(rep_name)
|
||||
tmp_list[len(ens["id"])] = "|"
|
||||
rep_name = ''.join(tmp_list)
|
||||
retd['names'].append(rep_name)
|
||||
retd['idl'].append([di[0] for di in rep['deltas']])
|
||||
retd['deltas'].append(np.array([di[1:] for di in rep['deltas']]))
|
||||
retd['is_merged'][rep['name']] = rep.get('is_merged', False)
|
||||
retd['is_merged'][rep_name] = rep.get('is_merged', False)
|
||||
return retd
|
||||
|
||||
def _gen_covobsd_from_cdatad(d):
|
||||
|
|
Loading…
Add table
Reference in a new issue