Skip to content

Commit 38b9dad

Browse files
committed
more utils
1 parent fa06420 commit 38b9dad

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/python/pipelines_utils/utils.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ def create_simple_writer(outputDef, defaultOutput, outputFormat, fieldNames,
7070
else:
7171
raise ValueError("Unsupported format: " + outputFormat)
7272

73+
def determine_output_format(outformat):
74+
if outformat:
75+
return outformat
76+
else:
77+
log("No output format specified - assuming sdf")
78+
return 'sdf'
7379

7480
def open_output(basename, ext, compress):
7581
if basename:
@@ -87,7 +93,7 @@ def open_output(basename, ext, compress):
8793
return sys.stdout
8894

8995

90-
def write_squonk_datasetmetadata(outputBase, thinOutput, valueClassMappings, datasetMetaProps, fieldMetaProps):
96+
def write_squonk_datasetmetadata(outputBase, thinOutput, valueClassMappings, datasetMetaProps, fieldMetaProps, size=None):
9197
"""This is a temp hack to write the minimal metadata that Squonk needs.
9298
Will needs to be replaced with something that allows something more complete to be written.
9399
@@ -118,6 +124,8 @@ def write_squonk_datasetmetadata(outputBase, thinOutput, valueClassMappings, dat
118124
meta['type'] = 'org.squonk.types.BasicObject'
119125
else:
120126
meta['type'] = 'org.squonk.types.MoleculeObject'
127+
if size != None:
128+
meta['size'] = size
121129
s = json.dumps(meta)
122130
meta = open(outputBase + '.metadata', 'w')
123131
meta.write(s)

src/python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_long_description():
2222
setup(
2323

2424
name='im-pipelines-utils',
25-
version='2.4.5',
25+
version='2.4.6',
2626
author='Alan Christie',
2727
author_email='[email protected]',
2828
url='https://github.com/InformaticsMatters/pipelines-utils',

0 commit comments

Comments
 (0)