Skip to content

Commit 1c28426

Browse files
committed
apply black formating
1 parent 582606a commit 1c28426

16 files changed

+47
-83
lines changed

cosmotech/coal/cosmotech_api/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
)
1818

1919
from cosmotech.coal.utils.semver import semver_of
20-
csm_version = semver_of('cosmotech_api')
20+
21+
csm_version = semver_of("cosmotech_api")
2122
if csm_version.major < 5:
2223
# Re-export functions from the twin_data_layer module
2324
from cosmotech.coal.cosmotech_api.twin_data_layer import (

cosmotech/coal/cosmotech_api/dataset/download/file.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ def process_xls(target_file) -> Dict[str, Any]:
5252
content[sheet_name].append(new_row)
5353
row_count += 1
5454

55-
LOGGER.debug(
56-
T("coal.services.dataset.sheet_processed").format(sheet_name=sheet_name, rows=row_count)
57-
)
55+
LOGGER.debug(T("coal.services.dataset.sheet_processed").format(sheet_name=sheet_name, rows=row_count))
5856
return content
5957

6058

@@ -87,9 +85,7 @@ def process_csv(target_file) -> Dict[str, Any]:
8785
content[current_filename].append(new_row)
8886
row_count += 1
8987

90-
LOGGER.debug(
91-
T("coal.services.dataset.csv_processed").format(file_name=current_filename, rows=row_count)
92-
)
88+
LOGGER.debug(T("coal.services.dataset.csv_processed").format(file_name=current_filename, rows=row_count))
9389
return content
9490

9591

@@ -107,9 +103,7 @@ def process_json(target_file) -> Dict[str, Any]:
107103
else:
108104
item_count = 1
109105

110-
LOGGER.debug(
111-
T("coal.services.dataset.json_processed").format(file_name=current_filename, items=item_count)
112-
)
106+
LOGGER.debug(T("coal.services.dataset.json_processed").format(file_name=current_filename, items=item_count))
113107
return content
114108

115109

@@ -121,9 +115,7 @@ def process_txt(target_file) -> Dict[str, Any]:
121115
content[current_filename] = "".join(line for line in _file)
122116

123117
line_count = content[current_filename].count("\n") + 1
124-
LOGGER.debug(
125-
T("coal.services.dataset.text_processed").format(file_name=current_filename, lines=line_count)
126-
)
118+
LOGGER.debug(T("coal.services.dataset.text_processed").format(file_name=current_filename, lines=line_count))
127119
return content
128120

129121

@@ -140,6 +132,7 @@ def timed_read_file(file_name, file):
140132
else:
141133
content.update(process_txt(file))
142134
return content
135+
143136
return timed_read_file(file_name, file)
144137

145138

cosmotech/coal/cosmotech_api/dataset/download/twingraph.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ def download_twingraph_dataset(
6262
# Query edges
6363
edges_start = time.time()
6464
LOGGER.debug(T("coal.services.dataset.twingraph_querying_edges").format(dataset_id=dataset_id))
65-
edges_query = cosmotech_api.DatasetTwinGraphQuery(query="MATCH(n)-[r]->(m) RETURN n as src, r as rel, m as dest")
65+
edges_query = cosmotech_api.DatasetTwinGraphQuery(
66+
query="MATCH(n)-[r]->(m) RETURN n as src, r as rel, m as dest"
67+
)
6668

6769
edges = dataset_api.twingraph_query(
6870
organization_id=organization_id,

cosmotech/coal/cosmotech_api/runner/datasets.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def download_dataset(
5757
read_files: bool = True,
5858
) -> Dict[str, Any]:
5959
"""
60-
retro-compatibility to cosmo-api v4
60+
retro-compatibility to cosmo-api v4
6161
"""
6262
from cosmotech.coal.utils.semver import semver_of
6363

@@ -90,9 +90,9 @@ def download_dataset_v5(
9090
# Get dataset information
9191
with get_api_client()[0] as api_client:
9292
dataset_api_instance = DatasetApi(api_client)
93-
dataset = dataset_api_instance.get_dataset(organization_id=organization_id,
94-
workspace_id=workspace_id,
95-
dataset_id=dataset_id)
93+
dataset = dataset_api_instance.get_dataset(
94+
organization_id=organization_id, workspace_id=workspace_id, dataset_id=dataset_id
95+
)
9696

9797
content = dict()
9898
tmp_dataset_dir = tempfile.mkdtemp()
@@ -223,9 +223,7 @@ def download_dataset_v4(
223223
}
224224

225225

226-
def download_dataset_process(
227-
_dataset_id, organization_id, workspace_id, read_files, _return_dict, _error_dict
228-
):
226+
def download_dataset_process(_dataset_id, organization_id, workspace_id, read_files, _return_dict, _error_dict):
229227
"""
230228
Process function for downloading a dataset in a separate process.
231229

cosmotech/coal/utils/decorator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ def wrapper(*args, **kwargs):
1919
else:
2020
LOGGER.info(msg)
2121
return r
22+
2223
return wrapper
24+
2325
return decorator

tests/unit/coal/test_cosmotech_api/test_cosmotech_api_run_template.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
from cosmotech.coal.utils.semver import semver_of
2020

2121

22-
@pytest.mark.skipif(
23-
semver_of('cosmotech_api').major >= 5, reason='not supported in version 5'
24-
)
22+
@pytest.mark.skipif(semver_of("cosmotech_api").major >= 5, reason="not supported in version 5")
2523
class TestRunTemplateFunctions:
2624
"""Tests for top-level functions in the run_template module."""
2725

tests/unit/coal/test_cosmotech_api/test_cosmotech_api_twin_data_layer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
from cosmotech.coal.utils.semver import semver_of
1919
from cosmotech_api import DatasetApi, RunnerApi
20-
if semver_of('cosmotech_api').major < 5:
20+
21+
if semver_of("cosmotech_api").major < 5:
2122
from cosmotech_api import DatasetTwinGraphQuery
2223

2324
from cosmotech.coal.cosmotech_api.twin_data_layer import (
@@ -35,9 +36,7 @@
3536
TARGET_COLUMN,
3637
)
3738

38-
pytestmark = pytest.mark.skipif(
39-
semver_of('cosmotech_api').major >= 5, reason='not supported under version 5'
40-
)
39+
pytestmark = pytest.mark.skipif(semver_of("cosmotech_api").major >= 5, reason="not supported under version 5")
4140

4241

4342
class TestCSVSourceFile:

tests/unit/coal/test_cosmotech_api/test_cosmotech_api_twin_data_layer_auth.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
from cosmotech.coal.utils.semver import semver_of
1919
from cosmotech_api import DatasetApi, RunnerApi
20-
if semver_of('cosmotech_api').major < 5:
20+
21+
if semver_of("cosmotech_api").major < 5:
2122
from cosmotech_api import DatasetTwinGraphQuery
2223
from cosmotech.coal.cosmotech_api.twin_data_layer import (
2324
send_files_to_tdl,
@@ -29,9 +30,7 @@
2930

3031
from cosmotech.orchestrator.utils.translate import T
3132

32-
skip_under_v5 = pytest.mark.skipif(
33-
semver_of('cosmotech_api').major >= 5, reason='not supported under version 5'
34-
)
33+
skip_under_v5 = pytest.mark.skipif(semver_of("cosmotech_api").major >= 5, reason="not supported under version 5")
3534

3635

3736
@skip_under_v5

tests/unit/coal/test_cosmotech_api/test_cosmotech_api_twin_data_layer_coverage.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from cosmotech.coal.utils.semver import semver_of
2222
from cosmotech_api import DatasetApi, RunnerApi
2323

24-
if semver_of('cosmotech_api').major < 5:
24+
if semver_of("cosmotech_api").major < 5:
2525
from cosmotech_api import DatasetTwinGraphQuery
2626

2727
from cosmotech.coal.cosmotech_api.twin_data_layer import (
@@ -33,9 +33,7 @@
3333
BATCH_SIZE_LIMIT,
3434
)
3535

36-
skip_under_v5 = pytest.mark.skipif(
37-
semver_of('cosmotech_api').major >= 5, reason='not supported under version 5'
38-
)
36+
skip_under_v5 = pytest.mark.skipif(semver_of("cosmotech_api").major >= 5, reason="not supported under version 5")
3937

4038

4139
@skip_under_v5

tests/unit/coal/test_cosmotech_api/test_cosmotech_api_twin_data_layer_edge_cases.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
from cosmotech.coal.utils.semver import semver_of
1919
from cosmotech_api import DatasetApi, RunnerApi
20-
if semver_of('cosmotech_api').major < 5:
20+
21+
if semver_of("cosmotech_api").major < 5:
2122
from cosmotech_api import DatasetTwinGraphQuery
2223
from cosmotech.coal.cosmotech_api.twin_data_layer import (
2324
send_files_to_tdl,
@@ -28,9 +29,7 @@
2829
)
2930
from cosmotech.orchestrator.utils.translate import T
3031

31-
skip_under_v5 = pytest.mark.skipif(
32-
semver_of('cosmotech_api').major >= 5, reason='not supported under version 5'
33-
)
32+
skip_under_v5 = pytest.mark.skipif(semver_of("cosmotech_api").major >= 5, reason="not supported under version 5")
3433

3534

3635
@skip_under_v5

0 commit comments

Comments
 (0)