Skip to content

Commit

Permalink
Merge branch 'release_21.05' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Sep 7, 2021
2 parents 00c6c28 + fa3828a commit 23e801c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/galaxy/datatypes/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,12 @@ def set_meta(self, dataset, overwrite=True, **kwd):
dataset.metadata.description = loom_file.attrs.get('description')
dataset.metadata.url = loom_file.attrs.get('url')
dataset.metadata.doi = loom_file.attrs.get('doi')
dataset.metadata.loom_spec_version = loom_file.attrs.get('LOOM_SPEC_VERSION')
loom_spec_version = loom_file.attrs.get('LOOM_SPEC_VERSION')
if isinstance(loom_spec_version, np.ndarray):
loom_spec_version = loom_spec_version[0]
if isinstance(loom_spec_version, bytes):
loom_spec_version = loom_spec_version.decode()
dataset.metadata.loom_spec_version = loom_spec_version
dataset.creation_date = loom_file.attrs.get('creation_date')
dataset.metadata.shape = tuple(loom_file['matrix'].shape)

Expand Down
Binary file not shown.
5 changes: 4 additions & 1 deletion lib/galaxy/model/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ def to_JSON_dict(self, filename=None):
meta_dict['__validated_state__'] = dataset_meta_dict['__validated_state__']
if '__validated_state_message__' in dataset_meta_dict:
meta_dict['__validated_state_message__'] = dataset_meta_dict['__validated_state_message__']
encoded_meta_dict = galaxy.model.custom_types.json_encoder.encode(meta_dict)
try:
encoded_meta_dict = galaxy.model.custom_types.json_encoder.encode(meta_dict)
except Exception as e:
raise Exception(f"Failed encoding metadata dictionary: {meta_dict}") from e
if filename is None:
return encoded_meta_dict
with open(filename, 'wt+') as fh:
Expand Down

0 comments on commit 23e801c

Please sign in to comment.