Skip to content

Commit

Permalink
feat: handle GC layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Lan Le committed Jun 26, 2024
1 parent 8144d7f commit e8436d1
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion chem_spectra/lib/composer/ni.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion chem_spectra/lib/converter/fid/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -82,14 +83,17 @@ 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']

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']

Expand Down
4 changes: 4 additions & 0 deletions chem_spectra/lib/converter/jcamp/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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']

Expand Down
3 changes: 2 additions & 1 deletion chem_spectra/lib/converter/jcamp/data_type.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}
3 changes: 2 additions & 1 deletion chem_spectra/lib/converter/jcamp/data_type.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}
1 change: 1 addition & 0 deletions chem_spectra/lib/converter/jcamp/ni.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.2.2',
version='1.2.3',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
Expand Down

0 comments on commit e8436d1

Please sign in to comment.