Skip to content

Commit 09efcb8

Browse files
author
oerc0042
committed
addressing review comment on PR
1 parent 593855f commit 09efcb8

4 files changed

Lines changed: 3 additions & 17 deletions

File tree

isatools/isatab/defaults.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ def pbar(x):
3232
_RX_I_FILE_NAME = compile(r"i_(.*?)\.txt")
3333
_RX_DATA = compile(r"data\[(.*?)\]")
3434
_RX_COMMENT = compile(r"Comment\[(.*?)\]")
35-
_RX_DOI = compile(r"^(https://doi.org/)?(10\.\d{4,9}/[-._;()/:a-z0-9A-Z]+)$") #
36-
# _RX_DOI = compile(r"10\.\d{4,9}/[-._;()/:a-z0-9A-Z]+") #
35+
_RX_DOI = compile(r"^(https://doi.org/)?(10\.\d{4,9}/[-._;()/:a-z0-9A-Z]+)$")
3736
_RX_PMID = compile(r"(^https://pubmed.ncbi.nlm.nih.gov/)?[0-9]{8}$")
3837
_RX_PMCID = compile(r"(^https://pmc.ncbi.nlm.nih.gov/articles/)?PMC[0-9]{8}$")
3938
_RX_CHARACTERISTICS = compile(r"Characteristics\[(.*?)\]")

isatools/isatab/validate/rules/rules_30xx.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def check_doi(doi_str):
7272
:return: None
7373
"""
7474
if doi_str != "":
75-
print("DOI string:", doi_str)
7675
if not _RX_DOI.match(doi_str):
7776
spl = "Found {} in DOI field".format(doi_str)
7877

@@ -100,7 +99,7 @@ def check_pubmed_id(pubmed_id_str):
10099
:return: None
101100
"""
102101
if pubmed_id_str != "":
103-
if _RX_PMID.match(pubmed_id_str) is None: # and (_RX_PMCID.match(pubmed_id_str) is None)
102+
if (_RX_PMID.match(pubmed_id_str) is None) and (_RX_PMCID.match(pubmed_id_str) is None):
104103
spl = "Found PubMedID {}".format(pubmed_id_str)
105104
validator.add_warning(message="PubMed ID is not valid format", supplemental=spl, code=3003)
106105
log.warning("(W) PubMed ID {} is not valid format".format(pubmed_id_str))

tests/isatab/test_isatab.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,6 @@ def test_isatab_load_issue587(self):
11251125
with open(os.path.join(self._tab_data_dir, "issue587", "i_Investigation.txt")) as fp:
11261126
ISA = isatab.load(fp)
11271127
self.assertEqual(ISA.ontology_source_references[0].name, "1")
1128-
# self.assertEqual(ISA.ontology_source_references[0].comments[0].value, "onto_stuff")
11291128

11301129
def test_isatab_load_sdata201414_isa1(self):
11311130
with open(os.path.join(self._tab_data_dir, "sdata201414-isa1", "i_Investigation.txt"), encoding="utf-8") as fp:

tests/model/test_assay.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,11 @@ def test_equalities(self):
126126
def test_to_dict(self, mock_uuid4):
127127
study = Study(id_="#study/" + mock_uuid4.return_value)
128128
assay = Assay(
129-
# id_="#assay-/" + mock_uuid4.return_value,
130129
filename="file",
131130
measurement_type=OntologyAnnotation(term="MT", id_="MT_ID"),
132131
technology_type=OntologyAnnotation(term="TT", id_="TT_ID"),
133132
)
134133

135-
# print("ID:", assay.id)
136134
self.assertEqual(assay.id, "#assay/" + mock_uuid4.return_value)
137135

138136
expected_dict = {
@@ -162,27 +160,18 @@ def test_to_dict(self, mock_uuid4):
162160
}
163161
self.assertEqual(expected_dict, assay.to_dict())
164162

165-
# assay = Assay()
166-
# assay.from_dict(expected_dict, study)
167-
# self.assertEqual(assay.to_dict(), expected_dict)
168-
169-
# expected_dict["unitCategories"] = [
170-
# {"@id": "unit_ID", "annotationValue": "my_unit", "termSource": "", "termAccession": "", "comments": []}
171-
# ]
172163
assay.from_dict(expected_dict, study)
173164
self.assertEqual(assay.to_dict(), expected_dict)
174165

175-
# expected_dict["materials"]["samples"] = [{"@id": "my_sample"}]
176166
indexes.samples = {"my_sample": Sample(id_="my_sample")}
177-
# assay = Assay()
167+
178168
assay.from_dict(expected_dict, study)
179169
self.assertEqual(assay.to_dict(), expected_dict)
180170

181171
# Data Files
182172
expected_dict["dataFiles"] = [
183173
{"@id": "my_data_file", "name": "filename", "type": "RawDataFile", "comments": []}
184174
]
185-
# assay = Assay()
186175
assay.from_dict(expected_dict, study)
187176
self.assertEqual(assay.to_dict(), expected_dict)
188177
indexes.term_sources = {"term_source1": OntologySource(name="term_source1")}

0 commit comments

Comments
 (0)