Skip to content

Commit

Permalink
change black CI and format spec.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MKoesters committed Mar 3, 2023
1 parent 590df5c commit fc68386
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tox_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
with:
python-version: 3.8
- name: install black
run: pip install black
run: pip install "black<23"
- name: run black
run: black --check pymzml

Expand Down
14 changes: 10 additions & 4 deletions pymzml/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ def _get_encoding_parameters(self, array_type):
d_type = b_data_array.find(
float_type_string.format(
ns=self.ns,
Acc=self.calling_instance.OT["32-bit integer"]["id"],
Acc=self.calling_instance.OT["32-bit integer"][
"id"
],
)
).get("name")
except:
Expand All @@ -231,15 +233,19 @@ def _get_encoding_parameters(self, array_type):
d_type = b_data_array.find(
float_type_string.format(
ns=self.ns,
Acc=self.calling_instance.OT["64-bit integer"]["id"],
Acc=self.calling_instance.OT["64-bit integer"][
"id"
],
)
).get("name")
except:
# null-terminated ASCII string
d_type = b_data_array.find(
float_type_string.format(
ns=self.ns,
Acc=self.calling_instance.OT["null-terminated ASCII string"]["id"],
Acc=self.calling_instance.OT[
"null-terminated ASCII string"
]["id"],
)
).get("name")
else:
Expand Down Expand Up @@ -316,7 +322,7 @@ def _decode_to_numpy(self, data, d_array_length, data_type, comp):
out_data = np.frombuffer(out_data, i_type)
# TODO elif data_type == "null-terminated ASCII string":
else:
raise ValueError(f'Unsupported data type: {data_type}')
raise ValueError(f"Unsupported data type: {data_type}")
else:
out_data = np.array([])
return out_data
Expand Down

0 comments on commit fc68386

Please sign in to comment.