diff options
-rw-r--r-- | .pre-commit-config.yaml | 61 | ||||
-rw-r--r-- | src/act4e_solutions/maps.py | 8 | ||||
-rw-r--r-- | src/act4e_solutions/posets_bounds.py | 8 | ||||
-rw-r--r-- | src/act4e_solutions/posets_construction.py | 6 | ||||
-rw-r--r-- | src/act4e_solutions/posets_interval.py | 12 | ||||
-rw-r--r-- | src/act4e_solutions/posets_sum.py | 6 | ||||
-rw-r--r-- | src/act4e_solutions/sets_power.py | 6 | ||||
-rw-r--r-- | src/act4e_solutions/sets_product.py | 6 | ||||
-rw-r--r-- | src/act4e_solutions/sets_sum.py | 6 | ||||
-rw-r--r-- | src/act4e_solutions/sets_union_inter.py | 6 |
10 files changed, 54 insertions, 71 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d373e7a..a5c6e90 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,42 +1,23 @@ ---- -repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 - hooks: - - id: check-added-large-files - - id: check-case-conflict - - id: check-executables-have-shebangs - - id: check-merge-conflict - - id: check-symlinks -# - id: trailing-whitespace -# - id: end-of-file-fixer -# - id: check-yaml -# - id: check-json -# - id: check-docstring-first -# - id: flake8 -# args: [--max-line-length=100] -- repo: https://github.com/psf/black - rev: 20.8b1 - hooks: - - id: black - language_version: python3.8 - args: [-l, '110'] -#- repo: https://github.com/adrienverge/yamllint.git -# rev: v1.26.1 # or higher tag -# hooks: -# - id: yamllint -# args: [--format, parsable] -- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt - rev: 0.1.0 # or specific tag - hooks: - - id: yamlfmt - args: [--mapping, '2', --sequence, '2', --offset, '0', --width, '150', --preserve-quotes] - -# args: [--mapping, '2', --sequence, '0', --offset, '0', --width, '150'] - - -#exclude: .bumpversion.cfg - +exclude: .pre-commit-config.yaml files: (^src/.*py)|(.*yaml) +repos: +- hooks: + - {id: check-added-large-files} + - {id: check-case-conflict} + - {id: check-executables-have-shebangs} + - {id: check-merge-conflict} + - {id: check-symlinks} + repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.1.0 +- hooks: + - args: [-l, '110', -t, py38] + id: black + repo: https://github.com/psf/black + rev: 21.12b0 +- hooks: + - args: [--mapping, '2', --sequence, '2', --offset, '0', --width, '150', --preserve-quotes] + id: yamlfmt + repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt + rev: 0.1.0 -# sigil 3d9109598d23dfbb339c65e4dae064bd +# sigil 1b050e28e72b639bc7781ce39208defb diff --git a/src/act4e_solutions/maps.py b/src/act4e_solutions/maps.py index 4984eef..acba84e 100644 --- a/src/act4e_solutions/maps.py +++ b/src/act4e_solutions/maps.py @@ -10,14 +10,16 @@ C = TypeVar("C") class SolFiniteMapOperations(I.FiniteMapOperations): @overload def identity(self, s: I.FiniteSet[A]) -> I.FiniteMap[A, A]: - ... + ... # this is just a type declaration - do not implement @overload def identity(self, s: I.Setoid[A]) -> I.Mapping[A, A]: - ... + ... # this is just a type declaration - do not implement def identity(self, s: I.Setoid[A]) -> I.Mapping[A, A]: - raise NotImplementedError() + raise NotImplementedError() # implement here + + # def compose(self, f: I.FiniteMap[A, B], g: I.FiniteMap[B, C]) -> I.FiniteMap[A, C]: raise NotImplementedError() diff --git a/src/act4e_solutions/posets_bounds.py b/src/act4e_solutions/posets_bounds.py index 73adc98..eef9c96 100644 --- a/src/act4e_solutions/posets_bounds.py +++ b/src/act4e_solutions/posets_bounds.py @@ -3,7 +3,7 @@ from typing import Any, List, Optional, overload, TypeVar import act4e_interfaces as I E = TypeVar("E") -X = TypeVar("X") +X = TypeVar("X") class SolFinitePosetMeasurement(I.FinitePosetMeasurement): def height(self, fp: I.FinitePoset[Any]) -> int: @@ -16,14 +16,14 @@ class SolFinitePosetMeasurement(I.FinitePosetMeasurement): class SolFinitePosetConstructionOpposite(I.FinitePosetConstructionOpposite): @overload def opposite(self, p: I.FinitePoset[X]) -> I.FinitePoset[X]: - ... + ... # this is just a type declaration - do not implement @overload def opposite(self, p: I.Poset[X]) -> I.Poset[X]: - ... + ... # this is just a type declaration - do not implement def opposite(self, m: I.Poset[X]) -> I.Poset[X]: - raise NotImplementedError() + raise NotImplementedError() # implement here class SolFinitePosetSubsetProperties(I.FinitePosetSubsetProperties): diff --git a/src/act4e_solutions/posets_construction.py b/src/act4e_solutions/posets_construction.py index 065f931..ebcdec2 100644 --- a/src/act4e_solutions/posets_construction.py +++ b/src/act4e_solutions/posets_construction.py @@ -8,11 +8,11 @@ X = TypeVar("X") class SolPosetConstructionPower(I.PosetConstructionPower): @overload def powerposet(self, s: I.FiniteSet[X]) -> I.FinitePosetOfFiniteSubsets[X, Any]: - ... + ... # this is just a type declaration - do not implement @overload def powerposet(self, s: I.Setoid[X]) -> I.PosetOfFiniteSubsets[X, Any]: - ... + ... # this is just a type declaration - do not implement def powerposet(self, s: I.Setoid[X]) -> I.PosetOfFiniteSubsets[X, Any]: - raise NotImplementedError() + raise NotImplementedError() # implement here diff --git a/src/act4e_solutions/posets_interval.py b/src/act4e_solutions/posets_interval.py index bd164eb..368de53 100644 --- a/src/act4e_solutions/posets_interval.py +++ b/src/act4e_solutions/posets_interval.py @@ -10,24 +10,24 @@ X = TypeVar("X") class SolFinitePosetConstructionTwisted(I.FinitePosetConstructionTwisted): @overload def twisted(self, s: I.FinitePoset[X]) -> I.FinitePosetOfIntervals[X, Any]: - ... + ... # this is just a type declaration - do not implement @overload def twisted(self, s: I.Poset[X]) -> I.PosetOfIntervals[X, Any]: - ... + ... # this is just a type declaration - do not implement def twisted(self, s: I.Poset[X]) -> I.PosetOfIntervals[X, Any]: - raise NotImplementedError() + raise NotImplementedError() # implement here class SolFinitePosetConstructionArrow(I.FinitePosetConstructionArrow): @overload def arrow(self, s: I.FinitePoset[X]) -> I.FinitePosetOfIntervals[X, Any]: - ... + ... # this is just a type declaration - do not implement @overload def arrow(self, s: I.Poset[X]) -> I.PosetOfIntervals[X, Any]: - ... + ... # this is just a type declaration - do not implement def arrow(self, s: I.Poset[X]) -> I.PosetOfIntervals[X, Any]: - raise NotImplementedError() + raise NotImplementedError() # implement here diff --git a/src/act4e_solutions/posets_sum.py b/src/act4e_solutions/posets_sum.py index 3081c7f..6d657e0 100644 --- a/src/act4e_solutions/posets_sum.py +++ b/src/act4e_solutions/posets_sum.py @@ -8,11 +8,11 @@ X = TypeVar("X") class SolFinitePosetConstructionSum(I.FinitePosetConstructionSum): @overload def disjoint_union(self, ps: Sequence[I.FinitePoset[X]]) -> I.FinitePosetDisjointUnion[X, Any]: - ... + ... # this is just a type declaration - do not implement @overload def disjoint_union(self, ps: Sequence[I.Poset[X]]) -> I.PosetDisjointUnion[X, Any]: - ... + ... # this is just a type declaration - do not implement def disjoint_union(self, ps: Sequence[I.Poset[X]]) -> I.PosetDisjointUnion[X, Any]: - raise NotImplementedError() + raise NotImplementedError() # implement here diff --git a/src/act4e_solutions/sets_power.py b/src/act4e_solutions/sets_power.py index 2e9c970..1969d86 100644 --- a/src/act4e_solutions/sets_power.py +++ b/src/act4e_solutions/sets_power.py @@ -8,11 +8,11 @@ X = TypeVar("X") class SolMakePowerSet(I.MakePowerSet): @overload def powerset(self, s: I.FiniteSet[X]) -> I.FiniteSetOfFiniteSubsets[X, Any]: - ... + ... # this is just a type declaration - do not implement @overload def powerset(self, s: I.Setoid[X]) -> I.SetOfFiniteSubsets[X, Any]: - ... + ... # this is just a type declaration - do not implement def powerset(self, s: I.Setoid[X]) -> I.SetOfFiniteSubsets[X, Any]: - raise NotImplementedError() + raise NotImplementedError() # implement here diff --git a/src/act4e_solutions/sets_product.py b/src/act4e_solutions/sets_product.py index d3e5558..f81f3fe 100644 --- a/src/act4e_solutions/sets_product.py +++ b/src/act4e_solutions/sets_product.py @@ -8,11 +8,11 @@ X = TypeVar("X") class SolMakeSetProduct(I.MakeSetProduct): @overload def product(self, components: Sequence[I.FiniteSet[X]]) -> I.FiniteSetProduct[X, Any]: - ... + ... # this is just a type declaration - do not implement @overload def product(self, components: Sequence[I.Setoid[X]]) -> I.SetProduct[X, Any]: - ... + ... # this is just a type declaration - do not implement def product(self, components: Sequence[I.Setoid[X]]) -> I.SetProduct[X, Any]: - raise NotImplementedError() + raise NotImplementedError() # implement here diff --git a/src/act4e_solutions/sets_sum.py b/src/act4e_solutions/sets_sum.py index ee82985..193a6a7 100644 --- a/src/act4e_solutions/sets_sum.py +++ b/src/act4e_solutions/sets_sum.py @@ -9,11 +9,11 @@ X = TypeVar("X") class SolMakeSetDisjointUnion(I.MakeSetDisjointUnion): @overload def disjoint_union(self, components: Sequence[I.FiniteSet[X]]) -> I.FiniteSetDisjointUnion[X, Any]: - ... + ... # this is just a type declaration - do not implement @overload def disjoint_union(self, components: Sequence[I.Setoid[X]]) -> I.SetDisjointUnion[X, Any]: - ... + ... # this is just a type declaration - do not implement def disjoint_union(self, components: Sequence[I.Setoid[X]]) -> I.SetDisjointUnion[X, Any]: - raise NotImplementedError() + raise NotImplementedError() # implement here diff --git a/src/act4e_solutions/sets_union_inter.py b/src/act4e_solutions/sets_union_inter.py index 3a4c419..edf9bd0 100644 --- a/src/act4e_solutions/sets_union_inter.py +++ b/src/act4e_solutions/sets_union_inter.py @@ -8,14 +8,14 @@ X = TypeVar("X") class SolMakeSetUnion(I.MakeSetUnion): @overload def union(self, components: Sequence[I.FiniteSet[X]]) -> I.FiniteSetUnion[X, Any]: - ... + ... # this is just a type declaration - do not implement @overload def union(self, components: Sequence[I.EnumerableSet[X]]) -> I.EnumerableSetUnion[X, Any]: - ... + ... # this is just a type declaration - do not implement def union(self, components: Sequence[I.EnumerableSet[X]]) -> I.EnumerableSetUnion[X, Any]: - raise NotImplementedError() + raise NotImplementedError() # implement here class SolSetoidOperations(I.SetoidOperations): |