Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #1084

Merged
merged 6 commits into from
Jun 5, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ repos:
additional_dependencies: [flake8-docstrings, darglint==1.8.0]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.950
rev: v0.960
hooks:
- id: mypy
files: "^glotaran/(plugin_system|utils|deprecation|testing|parameter|project|simulation|model/property.py|builtin/io/pandas)"
Expand All @@ -117,7 +117,7 @@ repos:
rev: 1.5.0
hooks:
- id: interrogate
args: [-vv, --config=pyproject.toml, glotaran]
args: [--config=pyproject.toml, glotaran]
pass_filenames: false
additional_dependencies: [click<8]

Expand Down
4 changes: 2 additions & 2 deletions glotaran/model/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,11 @@ def setter(self, value: model_property.glotaran_property_type): # type: ignore[
if model_property.glotaran_is_scalar_property and not isinstance(value, Parameter):
value = Parameter(full_label=str(value))
elif model_property.glotaran_is_sequence_property and all(
map(lambda v: not isinstance(v, Parameter), value)
not isinstance(v, Parameter) for v in value
):
value = [Parameter(full_label=str(v)) for v in value]
elif model_property.glotaran_is_mapping_property and all(
map(lambda v: not isinstance(v, Parameter), value.values())
not isinstance(v, Parameter) for v in value.values()
):
value = {k: Parameter(full_label=str(v)) for k, v in value.items()}
setattr(self, f"_{model_property._name}", value)
Expand Down
4 changes: 2 additions & 2 deletions glotaran/model/test/test_model_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ class MockClass:
p_sequence.fset(MockClass, names)
value = p_sequence.fget(MockClass)
assert isinstance(value, list)
assert all(map(lambda v: isinstance(v, Parameter), value))
assert all(isinstance(v, Parameter) for v in value)
assert [p.full_label for p in value] == names

p_mapping = ModelProperty(MockClass, "mapping", Dict[str, Parameter], "", None, True)
p_mapping.fset(MockClass, {f"{i}": n for i, n in enumerate(names)})
value = p_mapping.fget(MockClass)
assert isinstance(value, dict)
assert all(map(lambda v: isinstance(v, Parameter), value.values()))
assert all(isinstance(v, Parameter) for v in value.values())
assert [p.full_label for p in value.values()] == names


Expand Down
2 changes: 1 addition & 1 deletion glotaran/plugin_system/data_io_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def data_io_plugin_table(*, plugin_names: bool = False, full_names: bool = False
header_values = ["Format name", *DATA_IO_METHODS]
if plugin_names:
header_values.append("Plugin name")
headers = tuple(map(lambda x: f"__{x}__", header_values))
headers = tuple(f"__{x}__" for x in header_values)
return MarkdownStr(
tabulate(
bool_table_repr(table_data), tablefmt="github", headers=headers, stralign="center"
Expand Down
2 changes: 1 addition & 1 deletion glotaran/plugin_system/io_plugin_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,4 @@ def bool_table_repr(
--- - -
"""
bool_repr = partial(bool_str_repr, true_repr=true_repr, false_repr=false_repr)
return map(lambda value: map(bool_repr, value), table_data)
return ((bool_repr(value) for value in values) for values in table_data)
2 changes: 1 addition & 1 deletion glotaran/plugin_system/megacomplex_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,5 @@ def megacomplex_plugin_table(

else:
table_data = [[f"`{megacomplex_name}`"] for megacomplex_name in megacomplex_names]
headers = tuple(map(lambda x: f"__{x}__", header_values))
headers = tuple(f"__{x}__" for x in header_values)
return MarkdownStr(tabulate(table_data, tablefmt="github", headers=headers, stralign="center"))
2 changes: 1 addition & 1 deletion glotaran/plugin_system/project_io_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def project_io_plugin_table(
header_values = ["Format name", *PROJECT_IO_METHODS]
if plugin_names:
header_values.append("Plugin name")
headers = tuple(map(lambda x: f"__{x}__", header_values))
headers = tuple(f"__{x}__" for x in header_values)
return MarkdownStr(
tabulate(
bool_table_repr(table_data), tablefmt="github", headers=headers, stralign="center"
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ per-file-ignores =
*.pyi: E301, E302, F401
# Allow printing in test file
test_*.py: T201
# Temporarily deactivated since the code will be remoded in PR 1060
jsnel marked this conversation as resolved.
Show resolved Hide resolved
glotaran/optimization/optimization_group_calculator_linked.py: C417

[pydocstyle]
convention = numpy
Expand Down