Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasprobst committed Apr 9, 2024
1 parent 2428284 commit a2928f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion h5rdmtoolbox/wrapper/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions tests/conventions/test_ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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)

0 comments on commit a2928f2

Please sign in to comment.