-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lan Le
committed
Sep 5, 2023
1 parent
32ca1d5
commit b0d7c73
Showing
24 changed files
with
234 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"table_01.jdx": { | ||
"DATA CLASS": "XYPOINTS", | ||
"DATA TYPE": "SORPTION-DESORPTION MEASUREMENT", | ||
"XUNITS": "p/p0", | ||
"YUNITS": "ml/g", | ||
"OPERATOR": "Volodymyr", | ||
"DATE": "2020-04-30T00:00:00", | ||
"SERIAL": "BEL 00218", | ||
"ADSORPTIVE": "CH4", | ||
"TEMPERATURE": 384.15, | ||
"AMOUNT": "0.00980", | ||
"SAMPLE_CID": "aus der BOX", | ||
"SAMPLE_MAT_ID": "DUT-140(Cu)", | ||
"SOFTWARE": "raw2aif", | ||
"SOFTWARE_VERSION": "v004" | ||
}, | ||
"table_02.jdx": { | ||
"DATA CLASS": "XYPOINTS", | ||
"DATA TYPE": "SORPTION-DESORPTION MEASUREMENT", | ||
"XUNITS": "p/p0", | ||
"YUNITS": "ml/g", | ||
"OPERATOR": "Volodymyr", | ||
"DATE": "2020-04-30T00:00:00", | ||
"SERIAL": "BEL 00218", | ||
"ADSORPTIVE": "CH4", | ||
"AMOUNT": "0.00980", | ||
"SAMPLE_CID": "aus der BOX", | ||
"SAMPLE_MAT_ID": "DUT-140(Cu)", | ||
"SOFTWARE": "raw2aif", | ||
"SOFTWARE_VERSION": "v004" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import pytest | ||
from chem_spectra.lib.composer.base import BaseComposer | ||
from chem_spectra.lib.converter.jcamp.base import JcampBaseConverter | ||
|
||
source_nmr = './tests/fixtures/source/1H.dx' | ||
|
||
@pytest.fixture | ||
def jcamp_file_1h(): | ||
return source_nmr | ||
|
||
def test_init_ni_composer_success(jcamp_file_1h): | ||
base_converter = JcampBaseConverter(jcamp_file_1h) | ||
composer = BaseComposer(core=base_converter) | ||
|
||
assert composer is not None | ||
assert composer.core == base_converter | ||
|
||
def test_base_composer_generate_auto_metadata_headers(jcamp_file_1h): | ||
base_converter = JcampBaseConverter(jcamp_file_1h) | ||
composer = BaseComposer(core=base_converter) | ||
headers = composer._BaseComposer__header_auto_metadata() | ||
assert headers == [ | ||
'\n', | ||
'$$ === CHEMSPECTRA AUTO METADATA ===\n', | ||
'##$CSAUTOMETADATA=\n', | ||
] | ||
|
||
def test_base_composer_generate_auto_metadata(jcamp_file_1h): | ||
base_converter = JcampBaseConverter(jcamp_file_1h) | ||
metadata = {"just a string": "just a string value"} | ||
base_converter.auto_metadata = metadata | ||
composer = BaseComposer(core=base_converter) | ||
auto_metadata = composer.generate_auto_metadata() | ||
assert auto_metadata == [ | ||
'\n', | ||
'$$ === CHEMSPECTRA AUTO METADATA ===\n', | ||
'##$CSAUTOMETADATA=\n', | ||
'JUST A STRING=just a string value\n' | ||
] |
Oops, something went wrong.