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

ACAS-760: Added experiment loader warning test for numerics in Numbers that will be saved as Text #162

Merged
merged 1 commit into from
Apr 30, 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
16 changes: 15 additions & 1 deletion tests/test_acasclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -4807,7 +4807,7 @@ def test_018_image_file(self):
self.experiment_load_test(data_file_to_upload, False, images_file_to_upload=image_file_path)

@requires_basic_cmpd_reg_load
def test_19_project_restrictions(self):
def test_019_project_restrictions(self):
"""Check experiment loader project restrictions are working."""

# Setup for tests
Expand Down Expand Up @@ -4852,3 +4852,17 @@ def test_19_project_restrictions(self):
file_to_upload = get_basic_experiment_load_file(self.tempdir, project_code=None, corp_name=restricted_lot_corp_name_2, file_name='uniform-commas-with-quoted-text.csv')
# Upload the file and expect it to succeed
response = self.experiment_load_test(file_to_upload, False, expect_failure=False)

@requires_basic_cmpd_reg_load
def test_020_datatype_number_parsing(self):
"""Test experiment loader number parsing."""
data_file_to_upload = Path(__file__).resolve()\
.parent.joinpath('test_acasclient', 'datatype-number-parsing.csv')
response = self.experiment_load_test(data_file_to_upload, False, expect_failure=False)
expected_messages = [
{
"errorLevel": "warning",
"message": "The following Number values contain numerics but could not be parsed as Number so will be saved as Text: 'Test1.0Test', '1.0Test', 'Test1.0'. To avoid this warning set only non-numerics like 'Bad Solutibility', or use a correctly formatted Number. For example, 1, 1.2, 1.23e-10, >1, <1"
}
]
self.check_expected_messages(expected_messages, response['errorMessages'])
15 changes: 15 additions & 0 deletions tests/test_acasclient/datatype-number-parsing.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Experiment Meta Data,,,
Format,Generic,,
Protocol Name,BLAH,,
Experiment Name,BLAH,,
Scientist,bob,,
Notebook,BLAH,,
Page,,,
Assay Date,2022-03-30,,
Project,Global,,
,,,
,,,
Calculated Results,,,
Datatype,Number,Number,Number,Number,Number,Number,Number,Text,Number,Number,Number
Corporate Batch ID,Integer,Decimal,Scientific Notation,StartsWithString,EndsWithString,ContainsString,IsString,NumberSavedAsStringOnPurpose,EmptyValue,GreaterThanOperator,LessThanOperator
"CMPD-0000001-001",1,1.2,1.23e-10,Test1.0,1.0Test,Test1.0Test,Test,1.3,,>1.0,<1.0
Loading