Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update DFG logo link and fix prediction api for mass spectra #166

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ Funded by the [Deutsche Forschungsgemeinschaft (DFG, German Research Foundation)


[DFG]: https://www.dfg.de/en/
[DFG Logo]: https://www.dfg.de/zentralablage/bilder/service/logos_corporate_design/logo_negativ_267.png
[DFG Logo]: https://chemotion.net/img/logos/DFG_logo.png
[LICENSE]: LICENSE
[INSTALL]: INSTALL.md
2 changes: 1 addition & 1 deletion chem_spectra/controller/inference_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def chemspectra_predict_ms():
spectrum = FileContainer(request.files['spectrum'])
molfile = FileContainer(request.files['molfile'])
mm = MoleculeModel(molfile, layout)
tm = TraModel(spectrum, molfile=None, params={'ext': 'jdx'}).to_composer()
tm, _ = TraModel(spectrum, molfile=None, params={'ext': 'jdx'}).to_composer()
if ((type(tm) is dict) and "invalid_molfile" in tm):
return json.dumps(tm)

Expand Down
19 changes: 11 additions & 8 deletions chem_spectra/lib/composer/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,20 @@ def __create_sample_description(self):
]

detector = self.core.params.get('detector')
jcamp_idx = self.core.params.get('jcamp_idx')

if detector:
jcamp_idx = self.core.params.get('jcamp_idx')
curve = detector['curves'][jcamp_idx]
selected_detector = curve.get('selectedDetector', {})
curves = detector['curves']
curve_to_update = next((curve for curve in curves if curve.get('curveIdx') == jcamp_idx), None)

if curve_to_update:
selected_detector = curve_to_update.get('selectedDetector', {})

if isinstance(selected_detector, dict):
name = selected_detector.get('name')

if name:
spl_desc.append('##$DETECTOR={}\n'.format(name))
if isinstance(selected_detector, dict):
name = selected_detector.get('name')
if name:
spl_desc.append('##$DETECTOR={}\n'.format(name))

return spl_desc

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='chem-spectra-app',
version='1.1.0',
version='1.1.1',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
Expand Down
Loading