diff --git a/README.md b/README.md index 29c50253..f874b77b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/chem_spectra/controller/inference_api.py b/chem_spectra/controller/inference_api.py index 9bf40816..82850da6 100644 --- a/chem_spectra/controller/inference_api.py +++ b/chem_spectra/controller/inference_api.py @@ -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) diff --git a/chem_spectra/lib/composer/base.py b/chem_spectra/lib/composer/base.py index a4e5283c..e72bd8fe 100644 --- a/chem_spectra/lib/composer/base.py +++ b/chem_spectra/lib/composer/base.py @@ -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 diff --git a/setup.py b/setup.py index 7d431a74..d4d01c1e 100644 --- a/setup.py +++ b/setup.py @@ -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,