LeetSuite
Project description
LeetSuite
Leet stuff
Example usage
In your leet solution file:
In-place solutions:
...
if __name__ == "__main__":
from leet.test_suite import Submission, Case
cases = [
Case(
matrix=[[5,1,9,11],[2,4,8,10],[13,3,6,7],[15,14,12,16]],
solution=[[15,13,2,5],[14,3,4,1],[12,6,8,9],[16,7,10,11]],
),
]
sub = Submission(
callable=Solution().rotate,
cases=cases,
inplace=True,
throw=False,
verbose=True
)
sub.run(inplace_arg="matrix")
Not in-place
...
if __name__ == "__main__":
from leet.test_suite import Submission, Case
# from leet.test_suite.comparators import nested_list_comparator
cases = [
Case(x=2.00000, n=10, solution=1024.00000).disable_from_here(), # disable this case and all following ones ...
Case(x=2.10000, n=3, solution=9.26100).enable() # enable this one,
Case(x=2.00000, n=-2, solution=0.25).enable_from_here(), # enabled from here (including this case)
Case(x=8.66731, n=4, solution=5643.35434, enabled=False), # and disabled using arg
]
sub = Submission(
callable=Solution().myPow,
cases=cases,
inplace=False,
throw=False,
verbose=True
)
sub.run(comparator=lambda x, y: round(x, 3) == round(y, 3))
Nested-list comparison
...
if __name__ == "__main__":
from leet.test_suite import Submission, Case
from leet.test_suite.comparators import nested_list_comparator
cases = [
Case(
strs=["eat", "tea", "tan", "ate", "nat", "bat"],
solution=[["bat"], ["nat","tan"], ["ate","eat","tea"]],
).disable(), # Disable a case
Case(
strs=["","b"],
solution=[["b"], [""]],
)
]
sub = Submission(
callable=Solution().groupAnagrams,
cases=cases,
inplace=False,
throw=False,
verbose=True
)
sub.run(comparator=nested_list_comparator)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file leet_suite-0.1.0.tar.gz.
File metadata
- Download URL: leet_suite-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee81adf737df63b1358c31404a43c8c14bd0a026978909f7400d2652af15923e
|
|
| MD5 |
c8bccdf36f9ff5eedac19f686bc939ea
|
|
| BLAKE2b-256 |
99fadc1d34801f217e98b3f544260964cb1d47d0435e2eee5fa7831a2ba4f933
|
Provenance
The following attestation bundles were made for leet_suite-0.1.0.tar.gz:
Publisher:
publish.yml on riccardo92/leet-suite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
leet_suite-0.1.0.tar.gz -
Subject digest:
ee81adf737df63b1358c31404a43c8c14bd0a026978909f7400d2652af15923e - Sigstore transparency entry: 605886588
- Sigstore integration time:
-
Permalink:
riccardo92/leet-suite@e62b0766edc91e645e9063d30845eaf4e3f3e976 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/riccardo92
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e62b0766edc91e645e9063d30845eaf4e3f3e976 -
Trigger Event:
push
-
Statement type:
File details
Details for the file leet_suite-0.1.0-py3-none-any.whl.
File metadata
- Download URL: leet_suite-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e76c0ea08922fe457a4167b7b5e226c808885119a468f7d281854b182ab9dd4
|
|
| MD5 |
2aecb96fb98affe26e2ab5c3e6028a0b
|
|
| BLAKE2b-256 |
0bc1c77c794186b9172ffaa150ca7051d282929133bc0b2c6dc6ac6273f6492c
|
Provenance
The following attestation bundles were made for leet_suite-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on riccardo92/leet-suite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
leet_suite-0.1.0-py3-none-any.whl -
Subject digest:
0e76c0ea08922fe457a4167b7b5e226c808885119a468f7d281854b182ab9dd4 - Sigstore transparency entry: 605886635
- Sigstore integration time:
-
Permalink:
riccardo92/leet-suite@e62b0766edc91e645e9063d30845eaf4e3f3e976 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/riccardo92
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e62b0766edc91e645e9063d30845eaf4e3f3e976 -
Trigger Event:
push
-
Statement type: