Skip to content

Commit b07acb0

Browse files
authored
deps(black): v21.12b0
1 parent a26f72e commit b07acb0

File tree

12 files changed

+75
-23
lines changed

12 files changed

+75
-23
lines changed

cellengine/resources/gate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def delete(self):
4141
ce.APIClient().delete_gate(self.experiment_id, self._id)
4242

4343
def update(self):
44-
"""Save changes to this Gate to CellEngine. """
44+
"""Save changes to this Gate to CellEngine."""
4545
props = ce.APIClient().update_entity(
4646
self.experiment_id, self._id, "gates", body=self._properties
4747
)

cellengine/resources/plot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
@dataclass
1111
class Plot(DataClassMixin):
12-
"""A class representing a CellEngine plot.
13-
"""
12+
"""A class representing a CellEngine plot."""
1413

1514
experiment_id: str
1615
fcs_file_id: str

cellengine/utils/api_client/APIClient.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ def download_attachment(self, experiment_id, _id=None, name=None) -> bytes:
133133
"""Download an attachment"""
134134
_id = _id or self._get_id_by_name(name, "attachments", experiment_id)
135135
attachment = self._get(
136-
f"{self.base_url}/experiments/{experiment_id}/attachments/{_id}", raw=True,
136+
f"{self.base_url}/experiments/{experiment_id}/attachments/{_id}",
137+
raw=True,
137138
)
138139
return attachment
139140

@@ -403,7 +404,8 @@ def post_gate(
403404

404405
def update_gate_family(self, experiment_id, gid, body: dict = None) -> dict:
405406
return self._patch(
406-
f"{self.base_url}/experiments/{experiment_id}/gates?gid={gid}", json=body,
407+
f"{self.base_url}/experiments/{experiment_id}/gates?gid={gid}",
408+
json=body,
407409
)
408410

409411
def tailor_to(self, experiment_id, gate_id, fcs_file_id):
@@ -479,7 +481,8 @@ def get_population(
479481

480482
def post_population(self, experiment_id, population: Dict) -> Population:
481483
res = self._post(
482-
f"{self.base_url}/experiments/{experiment_id}/populations", json=population,
484+
f"{self.base_url}/experiments/{experiment_id}/populations",
485+
json=population,
483486
)
484487
return Population.from_dict(res)
485488

cellengine/utils/api_client/BaseAPIClient.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ def _patch(
113113

114114
def _delete(self, url, params: dict = None, headers: dict = None):
115115
response = self.requests_session.delete(
116-
url, headers=self._make_headers(headers), params=params if params else {},
116+
url,
117+
headers=self._make_headers(headers),
118+
params=params if params else {},
117119
)
118120
try:
119121
if response.ok:

cellengine/utils/limited_dict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class LimitedDict(dict):
2-
""" Extend this class and define `_keys` to limit the keys
2+
"""Extend this class and define `_keys` to limit the keys
33
available in a dict.
44
"""
55

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pytest-recording~=0.12
33
pyright~=0.0.9
44
responses~=0.10
55
flake8~=3.7
6-
black==19.10b0
6+
black==21.12b0
77
Pillow~=8.0
88
mkdocs~=1.1
99
mkdocs-material~=7.3

tests/integration/test_integration.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ def test_experiment_gates(setup_experiment, client):
184184
)
185185
split_gate.post()
186186
range_gate = RangeGate.create(
187-
experiment._id, fcs_file.channels[0], "range_gate", 2100000, 2500000,
187+
experiment._id,
188+
fcs_file.channels[0],
189+
"range_gate",
190+
2100000,
191+
2500000,
188192
)
189193
range_gate.post()
190194

tests/unit/resources/test_experiment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ def test_should_create_experiment(ENDPOINT_BASE, experiment):
168168
response = experiment.to_dict().copy()
169169
response["name"] = "new_experiment"
170170
responses.add(
171-
responses.POST, ENDPOINT_BASE + "/experiments", json=response,
171+
responses.POST,
172+
ENDPOINT_BASE + "/experiments",
173+
json=response,
172174
)
173175
Experiment.create("new_experiment")
174176
assert json.loads(responses.calls[0].request.body) == {

tests/unit/resources/test_gates.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ def test_should_delete_gates(
240240
self, ENDPOINT_BASE, client, experiment, rectangle_gate, args, url
241241
):
242242
responses.add(
243-
responses.DELETE, f"{ENDPOINT_BASE}" + url,
243+
responses.DELETE,
244+
f"{ENDPOINT_BASE}" + url,
244245
)
245246
Gate.delete_gates(experiment._id, **args)
246247

tests/unit/resources/test_plots.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ def test_should_get_plot(ENDPOINT_BASE, client, experiment, fcs_files):
2323
fcs_file = FcsFile.from_dict(fcs_files[0])
2424
responses.add(responses.GET, f"{ENDPOINT_BASE}/experiments/{EXP_ID}/plot")
2525
plot = Plot.get(
26-
experiment._id, fcs_file._id, "dot", fcs_file.channels[0], fcs_file.channels[1],
26+
experiment._id,
27+
fcs_file._id,
28+
"dot",
29+
fcs_file.channels[0],
30+
fcs_file.channels[1],
2731
)
2832
plot_tester(plot)
2933

@@ -32,7 +36,11 @@ def test_should_get_plot(ENDPOINT_BASE, client, experiment, fcs_files):
3236
def test_should_get_plot_from_fcs_file(ENDPOINT_BASE, client, fcs_files):
3337
fcs_file = FcsFile.from_dict(fcs_files[0])
3438
responses.add(responses.GET, f"{ENDPOINT_BASE}/experiments/{EXP_ID}/plot")
35-
plot = fcs_file.plot("dot", fcs_file.channels[0], fcs_file.channels[1],)
39+
plot = fcs_file.plot(
40+
"dot",
41+
fcs_file.channels[0],
42+
fcs_file.channels[1],
43+
)
3644
plot_tester(plot)
3745

3846

tests/unit/resources/test_scalesets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ def test_should_apply_scale_to_file(
265265
# Given:
266266
file = FcsFile.from_dict(fcs_files[0])
267267
responses.add(
268-
responses.GET, f"{ENDPOINT_BASE}/experiments/{EXP_ID}/fcsfiles/{file._id}.fcs",
268+
responses.GET,
269+
f"{ENDPOINT_BASE}/experiments/{EXP_ID}/fcsfiles/{file._id}.fcs",
269270
)
270271

271272
keys = ["FSC-A", "FSC-W", "Time"] # limit to a few keys

tests/unit/utils/test_api_client.py

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,24 @@
2525
test_params = [
2626
# (json to return, endpoint, function to test, expected entity, function args)
2727
(Experiment, None, "get_experiments", None),
28-
(Experiment, EXP_ID, "get_experiment", {"_id": EXP_ID},),
29-
(Experiment, EXP_ID, "get_experiment", {"name": "test_experiment"},),
30-
(Attachment, EXP_ID, "get_attachments", {"experiment_id": EXP_ID},),
28+
(
29+
Experiment,
30+
EXP_ID,
31+
"get_experiment",
32+
{"_id": EXP_ID},
33+
),
34+
(
35+
Experiment,
36+
EXP_ID,
37+
"get_experiment",
38+
{"name": "test_experiment"},
39+
),
40+
(
41+
Attachment,
42+
EXP_ID,
43+
"get_attachments",
44+
{"experiment_id": EXP_ID},
45+
),
3146
(
3247
bytes,
3348
EXP_ID,
@@ -41,7 +56,12 @@
4156
{"experiment_id": EXP_ID, "name": "config.h"},
4257
),
4358
(FcsFile, EXP_ID, "get_fcs_files", {"experiment_id": EXP_ID}),
44-
(FcsFile, EXP_ID, "get_fcs_file", {"experiment_id": EXP_ID, "_id": FCSFILE_ID},),
59+
(
60+
FcsFile,
61+
EXP_ID,
62+
"get_fcs_file",
63+
{"experiment_id": EXP_ID, "_id": FCSFILE_ID},
64+
),
4565
(
4666
FcsFile,
4767
EXP_ID,
@@ -62,7 +82,12 @@
6282
{"experiment_id": EXP_ID, "name": "some compensation"},
6383
),
6484
(Gate, EXP_ID, "get_gates", {"experiment_id": EXP_ID}),
65-
(Gate, EXP_ID, "get_gate", {"experiment_id": EXP_ID, "_id": GATE_ID},),
85+
(
86+
Gate,
87+
EXP_ID,
88+
"get_gate",
89+
{"experiment_id": EXP_ID, "_id": GATE_ID},
90+
),
6691
(Population, EXP_ID, "get_populations", {"experiment_id": EXP_ID}),
6792
(
6893
Population,
@@ -173,7 +198,9 @@ def _make_endpoint(entity, exp_id, kwargs):
173198

174199
def _mock_request(url, json_response):
175200
responses.add(
176-
responses.GET, url, json=json_response,
201+
responses.GET,
202+
url,
203+
json=json_response,
177204
)
178205

179206

@@ -188,7 +215,10 @@ def _mock_request_by_name(base_url, endpoint, exp_id, entity, name, json_respons
188215
url = base_url + f"{endpoint}?query=eq({query},%22{name}%22)&limit=2"
189216

190217
responses.add(
191-
responses.GET, url, json=json_response, match_querystring=True,
218+
responses.GET,
219+
url,
220+
json=json_response,
221+
match_querystring=True,
192222
)
193223

194224
if entity == "experiments":
@@ -199,7 +229,9 @@ def _mock_request_by_name(base_url, endpoint, exp_id, entity, name, json_respons
199229
)
200230

201231
responses.add(
202-
responses.GET, id_url, json=json_response,
232+
responses.GET,
233+
id_url,
234+
json=json_response,
203235
)
204236

205237

0 commit comments

Comments
 (0)