From e8436d11d6d17f1068dfb387fb420c80a991a149 Mon Sep 17 00:00:00 2001 From: Lan Le Date: Tue, 18 Jun 2024 12:53:26 +0200 Subject: [PATCH] feat: handle GC layout --- chem_spectra/lib/composer/ni.py | 2 +- chem_spectra/lib/converter/fid/base.py | 6 +++++- chem_spectra/lib/converter/jcamp/base.py | 4 ++++ chem_spectra/lib/converter/jcamp/data_type.json | 3 ++- chem_spectra/lib/converter/jcamp/data_type.json.example | 3 ++- chem_spectra/lib/converter/jcamp/ni.py | 1 + setup.py | 2 +- 7 files changed, 16 insertions(+), 5 deletions(-) diff --git a/chem_spectra/lib/composer/ni.py b/chem_spectra/lib/composer/ni.py index f1dc335e..adb592ce 100644 --- a/chem_spectra/lib/composer/ni.py +++ b/chem_spectra/lib/composer/ni.py @@ -291,7 +291,7 @@ def tf_img(self): plt.plot(self.core.xs, self.core.ys) x_max, x_min = self.core.boundary['x']['max'], self.core.boundary['x']['min'] # noqa: E501 - xlim_left, xlim_right = [x_min, x_max] if (self.core.is_tga or self.core.is_uv_vis or self.core.is_hplc_uv_vis or self.core.is_xrd or self.core.is_cyclic_volta or self.core.is_sec or self.core.is_cds or self.core.is_aif or self.core.is_emissions or self.core.is_dls_acf or self.core.is_dls_intensity) else [x_max, x_min] # noqa: E501 + xlim_left, xlim_right = [x_min, x_max] if (self.core.is_tga or self.core.is_gc or self.core.is_uv_vis or self.core.is_hplc_uv_vis or self.core.is_xrd or self.core.is_cyclic_volta or self.core.is_sec or self.core.is_cds or self.core.is_aif or self.core.is_emissions or self.core.is_dls_acf or self.core.is_dls_intensity) else [x_max, x_min] # noqa: E501 plt.xlim(xlim_left, xlim_right) y_max, y_min = np.max(self.core.ys), np.min(self.core.ys) h = y_max - y_min diff --git a/chem_spectra/lib/converter/fid/base.py b/chem_spectra/lib/converter/fid/base.py index a1d868a1..38494099 100644 --- a/chem_spectra/lib/converter/fid/base.py +++ b/chem_spectra/lib/converter/fid/base.py @@ -66,6 +66,7 @@ def __set_properties(self): self.is_em_wave = self.__is_em_wave() self.is_ir = self.__is_ir() self.is_tga = self.__is_tga() + self.is_gc = self.__is_gc() self.is_uv_vis = self.__is_uv_vis() self.is_hplc_uv_vis = self.__is_hplc_uv_vis() self.is_xrd = self.__is_xrd() @@ -82,7 +83,7 @@ def __is_em_wave(self): return self.typ in ['INFRARED', 'RAMAN', 'UVVIS'] def __non_nmr(self): - return self.typ in ['INFRARED', 'RAMAN', 'UVVIS', 'HPLC UVVIS', 'THERMOGRAVIMETRIC ANALYSIS', 'MS', 'X-RAY DIFFRACTION', 'CYCLIC VOLTAMMETRY', 'CIRCULAR DICHROISM SPECTROSCOPY'] # noqa: E501 + return self.typ in ['INFRARED', 'RAMAN', 'UVVIS', 'HPLC UVVIS', 'THERMOGRAVIMETRIC ANALYSIS', 'MS', 'X-RAY DIFFRACTION', 'CYCLIC VOLTAMMETRY', 'CIRCULAR DICHROISM SPECTROSCOPY', 'GAS CHROMATOGRAPHY'] # noqa: E501 def __is_ir(self): return self.typ in ['INFRARED'] @@ -90,6 +91,9 @@ def __is_ir(self): def __is_tga(self): return self.typ in ['THERMOGRAVIMETRIC ANALYSIS'] + def __is_gc(self): + return self.typ in ['GAS CHROMATOGRAPHY'] + def __is_uv_vis(self): return self.typ in ['UVVIS'] diff --git a/chem_spectra/lib/converter/jcamp/base.py b/chem_spectra/lib/converter/jcamp/base.py index 78621ecd..fc01634b 100644 --- a/chem_spectra/lib/converter/jcamp/base.py +++ b/chem_spectra/lib/converter/jcamp/base.py @@ -24,6 +24,7 @@ def __init__(self, path, params=False): self.is_em_wave = self.__is_em_wave() self.is_ir = self.__is_ir() self.is_tga = self.__is_tga() + self.is_gc = self.__is_gc() self.is_uv_vis = self.__is_uv_vis() self.is_hplc_uv_vis = self.__is_hplc_uv_vis() self.is_xrd = self.__is_xrd() @@ -128,6 +129,9 @@ def __is_ir(self): def __is_tga(self): return self.typ in ['THERMOGRAVIMETRIC ANALYSIS'] + def __is_gc(self): + return self.typ in ['GAS CHROMATOGRAPHY'] + def __is_uv_vis(self): return self.typ in ['UVVIS'] diff --git a/chem_spectra/lib/converter/jcamp/data_type.json b/chem_spectra/lib/converter/jcamp/data_type.json index 8cccc47f..17f4a457 100644 --- a/chem_spectra/lib/converter/jcamp/data_type.json +++ b/chem_spectra/lib/converter/jcamp/data_type.json @@ -15,6 +15,7 @@ "Emissions": ["Emissions", "EMISSIONS", "FLUORESCENCE SPECTRUM", "FL SPECTRUM"], "DLS ACF": ["DLS ACF"], "DLS intensity": ["DLS INTENSITY", "DLS intensity"], - "DIFFERENTIAL SCANNING CALORIMETRY": ["DIFFERENTIAL SCANNING CALORIMETRY"] + "DIFFERENTIAL SCANNING CALORIMETRY": ["DIFFERENTIAL SCANNING CALORIMETRY"], + "GAS CHROMATOGRAPHY": ["GAS CHROMATOGRAPHY"] } } diff --git a/chem_spectra/lib/converter/jcamp/data_type.json.example b/chem_spectra/lib/converter/jcamp/data_type.json.example index 26b5ff20..ad299575 100644 --- a/chem_spectra/lib/converter/jcamp/data_type.json.example +++ b/chem_spectra/lib/converter/jcamp/data_type.json.example @@ -15,6 +15,7 @@ "Emissions": ["Emissions", "EMISSIONS", "FLUORESCENCE SPECTRUM", "FL SPECTRUM"], "DLS ACF": ["DLS ACF"], "DLS intensity": ["DLS INTENSITY", "DLS intensity"], - "DIFFERENTIAL SCANNING CALORIMETRY": ["DIFFERENTIAL SCANNING CALORIMETRY"] + "DIFFERENTIAL SCANNING CALORIMETRY": ["DIFFERENTIAL SCANNING CALORIMETRY"], + "GAS CHROMATOGRAPHY": ["GAS CHROMATOGRAPHY"] } } diff --git a/chem_spectra/lib/converter/jcamp/ni.py b/chem_spectra/lib/converter/jcamp/ni.py index 7e016917..ec1965fc 100644 --- a/chem_spectra/lib/converter/jcamp/ni.py +++ b/chem_spectra/lib/converter/jcamp/ni.py @@ -33,6 +33,7 @@ def __init__(self, base): self.is_em_wave = base.is_em_wave self.is_ir = base.is_ir self.is_tga = base.is_tga + self.is_gc = base.is_gc self.is_xrd = base.is_xrd self.is_uv_vis = base.is_uv_vis self.is_hplc_uv_vis = base.is_hplc_uv_vis diff --git a/setup.py b/setup.py index 962b6c22..95a5a45e 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='chem-spectra-app', - version='1.2.2', + version='1.2.3', packages=find_packages(), include_package_data=True, zip_safe=False,