Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leet_suite-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

leet_suite-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

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

Hashes for leet_suite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ee81adf737df63b1358c31404a43c8c14bd0a026978909f7400d2652af15923e
MD5 c8bccdf36f9ff5eedac19f686bc939ea
BLAKE2b-256 99fadc1d34801f217e98b3f544260964cb1d47d0435e2eee5fa7831a2ba4f933

See more details on using hashes here.

Provenance

The following attestation bundles were made for leet_suite-0.1.0.tar.gz:

Publisher: publish.yml on riccardo92/leet-suite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for leet_suite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e76c0ea08922fe457a4167b7b5e226c808885119a468f7d281854b182ab9dd4
MD5 2aecb96fb98affe26e2ab5c3e6028a0b
BLAKE2b-256 0bc1c77c794186b9172ffaa150ca7051d282929133bc0b2c6dc6ac6273f6492c

See more details on using hashes here.

Provenance

The following attestation bundles were made for leet_suite-0.1.0-py3-none-any.whl:

Publisher: publish.yml on riccardo92/leet-suite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page