Skip to content

Commit 9dc1bea

Browse files
committed
Rebuild schema, format and fix with ruff
1 parent 83c4dac commit 9dc1bea

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

catalog/py_package/catalog_build/build.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def post_ncbi_request(url, json_data, batch_size=1000, min_batch_size=50):
101101

102102
# Use rate_limit_handler to make the request with proper retry logic
103103
response = rate_limit_handler(
104-
lambda: requests.post(url, json=batch_data)
104+
lambda data=batch_data: requests.post(url, json=data)
105105
)
106106

107107
if response.status_code != 200:
@@ -990,7 +990,7 @@ def fetch_url_data(url, counter=0, counter_limit=2, wait_time=2, num_retry=3):
990990
# BAM files that are labeled as FASTQ.
991991
# For these, we can retrieve S3 links instead.
992992
file_list_data, counter = fetch_url_data(
993-
f"https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=sra&id=SRR25741043&retmode=xml",
993+
"https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=sra&id=SRR25741043&retmode=xml",
994994
counter,
995995
)
996996
srafile_soup = BeautifulSoup(file_list_data.text, "xml")
@@ -1154,9 +1154,11 @@ def make_qc_report(
11541154
gene_model_urls_text = (
11551155
"N/A"
11561156
if missing_gene_model_urls is None
1157-
else "None"
1158-
if len(missing_gene_model_urls) == 0
1159-
else "\n".join([f"- {accession}" for accession in missing_gene_model_urls])
1157+
else (
1158+
"None"
1159+
if len(missing_gene_model_urls) == 0
1160+
else "\n".join([f"- {accession}" for accession in missing_gene_model_urls])
1161+
)
11601162
)
11611163
taxonomy_ids_text = (
11621164
"None"
@@ -1168,13 +1170,15 @@ def make_qc_report(
11681170
ploidy_assemblies_text = (
11691171
"None"
11701172
if missing_ploidy_assemblies is None
1171-
else "None"
1172-
if len(missing_ploidy_assemblies) == 0
1173-
else "\n".join(
1174-
[
1175-
f"- {accession} (speciesTaxonomyId: {tax_id})"
1176-
for accession, tax_id in missing_ploidy_assemblies
1177-
]
1173+
else (
1174+
"None"
1175+
if len(missing_ploidy_assemblies) == 0
1176+
else "\n".join(
1177+
[
1178+
f"- {accession} (speciesTaxonomyId: {tax_id})"
1179+
for accession, tax_id in missing_ploidy_assemblies
1180+
]
1181+
)
11781182
)
11791183
)
11801184
if missing_outbreak_descendants is None or len(missing_outbreak_descendants) == 0:
@@ -1321,7 +1325,7 @@ def build_files(
13211325
ucsc_assemblies_url,
13221326
tree_output_path,
13231327
taxonomic_levels_for_tree,
1324-
taxonomic_group_sets={},
1328+
taxonomic_group_sets=None,
13251329
do_gene_model_urls=True,
13261330
extract_primary_data=False,
13271331
primary_output_path=None,
@@ -1348,6 +1352,8 @@ def build_files(
13481352
outbreaks_path: Path of input outbreaks YAML
13491353
outbreak_taxonomy_mapping_path: Path to save taxonomic information for outbreaks at
13501354
"""
1355+
if taxonomic_group_sets is None:
1356+
taxonomic_group_sets = {}
13511357
print("Building files")
13521358

13531359
qc_report_params = {}

catalog/py_package/catalog_build/generated_schema/schema.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
from __future__ import annotations
22

33
import re
4-
import sys
5-
from datetime import date, datetime, time
6-
from decimal import Decimal
74
from enum import Enum
8-
from typing import Any, ClassVar, Dict, List, Literal, Optional, Union
5+
from typing import Any, ClassVar, Dict, List, Optional
96

107
from pydantic import BaseModel, ConfigDict, Field, RootModel, field_validator
118

@@ -61,7 +58,7 @@ def __contains__(self, key: str) -> bool:
6158
"prefix_reference": "https://w3id.org/linkml/",
6259
}
6360
},
64-
"source_file": "/Users/dannon/work/brc-analytics/catalog/py_package/catalog_build/schema_utils/../schema/schema.yaml",
61+
"source_file": "/Users/mvandenb/src/brc-analytics/catalog/py_package/catalog_build/schema_utils/../schema/schema.yaml",
6562
}
6663
)
6764

@@ -126,6 +123,7 @@ class WorkflowParameterVariable(str, Enum):
126123
ASSEMBLY_FASTA_URL = "ASSEMBLY_FASTA_URL"
127124
GENE_MODEL_URL = "GENE_MODEL_URL"
128125
SANGER_READ_RUN_PAIRED = "SANGER_READ_RUN_PAIRED"
126+
SANGER_READ_RUN_SINGLE = "SANGER_READ_RUN_SINGLE"
129127

130128

131129
class WorkflowPloidy(str, Enum):

catalog/py_package/catalog_build/iwc_manifest_to_workflows_yaml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def generate_current_workflows():
9898
by_trs_id: Dict[str, Workflow] = {}
9999
for repo in manifest_data:
100100
for workflow in repo["workflows"]:
101-
if not "tests" in workflow:
101+
if "tests" not in workflow:
102102
# probably fixed on main branch of iwc ?
103103
# this branch is pretty out of date
104104
continue

0 commit comments

Comments
 (0)