Commit 61ca22dd authored by Markus Scheidgen's avatar Markus Scheidgen

Added sample data metadata. Fixed test generator.

parent 9056d2ac
......@@ -72,6 +72,13 @@ class SkeletonParser(AbstractBaseParser):
# The backend will check the type of the given value agains the metadata definition.
backend.addValue('experiment_time', int(datetime.strptime(data.get('date'), '%d.%M.%Y').timestamp()))
# Subsections work like before. The parent section must still be open.
data_gid = backend.openSection('section_data')
backend.addValue('data_repository_name', 'zenedo.org')
backend.addValue('data_repository_url', 'https://zenedo.org/path/to/mydata')
backend.addValue('data_preview_url', 'https://www.physicsforums.com/insights/wp-content/uploads/2015/09/fem.jpg')
backend.closeSection('section_data', data_gid)
# Subsections work like before. The parent section must still be open.
sample_gid = backend.openSection('section_sample')
backend.addValue('sample_chemical_name', data.get('sample_chemical'))
......
......@@ -33,8 +33,8 @@ if __name__ == '__main__':
now = int(time.time())
for i in range(0, count + 1):
with zipfile.ZipFile(zipfile_name, 'w') as zf:
with zipfile.ZipFile(zipfile_name, 'w') as zf:
for i in range(0, count + 1):
formula = []
for _ in range(0, random.choice(low_numbers_for_atoms)):
formula.append('%s%d' % (random.choice(atoms), random.choice(low_numbers_for_atoms)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment