From a2928f26a0bd29a5b05acd4e0b2b121812936112 Mon Sep 17 00:00:00 2001 From: Matthias Probst Date: Tue, 9 Apr 2024 16:21:22 +0200 Subject: [PATCH] bugfix --- h5rdmtoolbox/wrapper/core.py | 2 +- tests/conventions/test_ontology.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/h5rdmtoolbox/wrapper/core.py b/h5rdmtoolbox/wrapper/core.py index 254efac2..5d947cbb 100644 --- a/h5rdmtoolbox/wrapper/core.py +++ b/h5rdmtoolbox/wrapper/core.py @@ -542,7 +542,7 @@ def create_time_dataset(self, if attrs is None: attrs = {} attrs.update({'ISTIMEDS': 1, - 'TIMEFORMAT': 'ISO'}) + 'TIMEFORMAT': 'ISO'}) # YYYY-MM-DDTHH:MM:SS.ffffff if isinstance(data, np.ndarray): return self.create_string_dataset(name, data=[t.astype(datetime).isoformat() for t in data], overwrite=overwrite, attrs=attrs, **kwargs) diff --git a/tests/conventions/test_ontology.py b/tests/conventions/test_ontology.py index 7e036be7..c1c41087 100644 --- a/tests/conventions/test_ontology.py +++ b/tests/conventions/test_ontology.py @@ -5,6 +5,7 @@ import unittest import h5rdmtoolbox as h5tbx +from h5rdmtoolbox import __version__ from h5rdmtoolbox.convention.ontology import Attribute, Dataset, Group, File __this_dir__ = pathlib.Path(__file__).parent @@ -200,7 +201,7 @@ def test_jsonld_to_hdf(self): self.assertEqual(g["m4i:orcidId"], '0000-0000-0123-4567') elif isinstance(g['@type'], list) and 'schema:SoftwareSourceCode' in g['@type']: i += 1 - self.assertEqual(g['schema:softwareVersion'], "1.2.3a2") + self.assertEqual(g['schema:softwareVersion'], __version__) self.assertEqual(i, 2) jsonld_str = h5tbx.dump_jsonld( @@ -221,7 +222,7 @@ def test_jsonld_to_hdf(self): self.assertEqual(json_dict['@context']['has ORCID ID'], "http://w3id.org/nfdi4ing/metadata4ing#orcidId") elif isinstance(g['@type'], list) and 'schema:SoftwareSourceCode' in g['@type']: i += 1 - self.assertEqual(g['__h5rdmtoolbox_version__'], "1.2.3a2") + self.assertEqual(g['__h5rdmtoolbox_version__'], __version__) self.assertEqual(json_dict['@context']['__h5rdmtoolbox_version__'], "https://schema.org/softwareVersion") self.assertEqual(i, 2)