From 323326a64fe0f9bcd756ab080fceeb05abf70279 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 May 2022 21:34:29 +0000 Subject: [PATCH 1/6] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.950 → v0.960](https://github.com/pre-commit/mirrors-mypy/compare/v0.950...v0.960) - [github.com/myint/rstcheck: v5.0.0 → v6.0.0rc3](https://github.com/myint/rstcheck/compare/v5.0.0...v6.0.0rc3) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 69c29bfc1..312d5ee82 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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)" @@ -122,7 +122,7 @@ repos: additional_dependencies: [click<8] - repo: https://github.com/myint/rstcheck - rev: "v5.0.0" + rev: "v6.0.0rc3" hooks: - id: rstcheck additional_dependencies: [sphinx] From a7ccd3a9e9b7f8e0fdaa71450b1489da270c0783 Mon Sep 17 00:00:00 2001 From: Sebastian Weigand Date: Thu, 2 Jun 2022 06:30:45 +0200 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=A7=B9=20Reset=20rstcheck=20to=20stab?= =?UTF-8?q?le=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 312d5ee82..4276026b8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -122,7 +122,7 @@ repos: additional_dependencies: [click<8] - repo: https://github.com/myint/rstcheck - rev: "v6.0.0rc3" + rev: "v5.0.0" hooks: - id: rstcheck additional_dependencies: [sphinx] From cc55ab3dc6f48a9077e0a27fe0b23c97fab94a7e Mon Sep 17 00:00:00 2001 From: Joern Weissenborn Date: Thu, 26 May 2022 17:20:25 +0200 Subject: [PATCH 3/6] Fix flake8 C417 errors. --- glotaran/model/property.py | 4 ++-- glotaran/model/test/test_model_property.py | 4 ++-- glotaran/plugin_system/data_io_registration.py | 2 +- glotaran/plugin_system/io_plugin_utils.py | 2 +- glotaran/plugin_system/megacomplex_registration.py | 2 +- glotaran/plugin_system/project_io_registration.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/glotaran/model/property.py b/glotaran/model/property.py index f3c968656..25a32e82f 100644 --- a/glotaran/model/property.py +++ b/glotaran/model/property.py @@ -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) diff --git a/glotaran/model/test/test_model_property.py b/glotaran/model/test/test_model_property.py index 98f7ff4a4..b6fe18b30 100644 --- a/glotaran/model/test/test_model_property.py +++ b/glotaran/model/test/test_model_property.py @@ -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 diff --git a/glotaran/plugin_system/data_io_registration.py b/glotaran/plugin_system/data_io_registration.py index 549ac20dc..6667554c9 100644 --- a/glotaran/plugin_system/data_io_registration.py +++ b/glotaran/plugin_system/data_io_registration.py @@ -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" diff --git a/glotaran/plugin_system/io_plugin_utils.py b/glotaran/plugin_system/io_plugin_utils.py index 3a0ae6f5d..1e421f280 100644 --- a/glotaran/plugin_system/io_plugin_utils.py +++ b/glotaran/plugin_system/io_plugin_utils.py @@ -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) diff --git a/glotaran/plugin_system/megacomplex_registration.py b/glotaran/plugin_system/megacomplex_registration.py index 103116a56..2719e7542 100644 --- a/glotaran/plugin_system/megacomplex_registration.py +++ b/glotaran/plugin_system/megacomplex_registration.py @@ -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")) diff --git a/glotaran/plugin_system/project_io_registration.py b/glotaran/plugin_system/project_io_registration.py index 2ac580188..c981702a0 100644 --- a/glotaran/plugin_system/project_io_registration.py +++ b/glotaran/plugin_system/project_io_registration.py @@ -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" From b3e227eb1e455d845225bac865cc5f7176fefbba Mon Sep 17 00:00:00 2001 From: s-weigand Date: Sun, 5 Jun 2022 18:13:38 +0200 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=94=A7=E2=9D=8C=20Temporarily=20deact?= =?UTF-8?q?ivated=20C417=20for=20code=20that=20will=20be=20removed=20in=20?= =?UTF-8?q?PR=201060?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index 35b8b268e..f990c3486 100644 --- a/tox.ini +++ b/tox.ini @@ -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 + glotaran/optimization/optimization_group_calculator_linked.py: C417 [pydocstyle] convention = numpy From a646ca41151581c4d6777fcf9d0567f41bfb145c Mon Sep 17 00:00:00 2001 From: s-weigand Date: Sun, 5 Jun 2022 18:14:59 +0200 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=91=8C=F0=9F=94=A7=20Removed=20very?= =?UTF-8?q?=20verbose=20option=20from=20interrogate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4276026b8..2ecb01a6b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] From 30a198bf7bf8990de5242ee7d4f106427515866d Mon Sep 17 00:00:00 2001 From: Joris Snellenburg Date: Sun, 5 Jun 2022 19:28:35 +0200 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=91=8CFix=20type=20in=20comment=20in?= =?UTF-8?q?=20tox.ini?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index f990c3486..a2852c556 100644 --- a/tox.ini +++ b/tox.ini @@ -31,7 +31,7 @@ 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 + # Temporarily deactivated since the code will be removed in PR 1060 glotaran/optimization/optimization_group_calculator_linked.py: C417 [pydocstyle]