Skip to main content

Tool for developing tasks for programming competitions.

Project description

Pisek ⌛

Tool for developing tasks for programming competitions. Currently used by:

Install

Pisek requires Python ≥ 3.11. Install with pip:

pip install pisek

For upgrading add --upgrade:

pip install pisek --upgrade

Testing tasks

First create a config file as documented here. You can also reference the examples for Kasiopea mode and CMS mode.

pisek

This command tests the task in the current directory. It tests all task parts (generator, checker, solutions and judge).

Task testing overview

What pisek verifies (roughly in order):

  • Samples exist and are not empty
  • The generator generates inputs
    • In Kasiopea mode the generator respects the seed and is deterministic
  • The checker accepts all inputs
    • It rejects inputs for harder subtasks
  • The judge works
    • It accepts the samples
    • It doesn't crash on malicious output
  • The solutions finish as expected
    • They get the expected number of points
    • They succeed/fail on each subtask as expected
  • Data files (inputs and outputs) are valid
    • They are in the correct encoding
    • They don't contain unprintable characters
    • They have a newline at the end
    • In Kasiopea mode the files are reasonably small

Testing given programs

For fast testing of only the solution solve_cool.cpp use:

pisek test solution solve_cool

For testing on multiple inputs use (only in Kasiopea mode) use:

pisek test solution solve_cool -n 42

Similarly the generator can be tested using:

pisek test generator

Useful options

Test all solutions, don't stop on first failure:

pisek --full

Test each solution on all inputs, even when the result is clear:

pisek --all-inputs

Use a different time limit (in seconds) for testing solutions:

pisek --timeout 5

Interpret warnings as failures (for a final check):

pisek --strict

Cleaning

Pisek can create a lot of files used for testing. Remove them by running:

pisek clean

Visualization

For visualizing the running time for each solution and testcase:

pisek --testing-log  # test the task
pisek visualize      # visualize

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Copyright (c)   2019 - 2022 Václav Volhejn <vaclav.volhejn@gmail.com>
Copyright (c)   2019 - 2022 Jiří Beneš <mail@jiribenes.com>
Copyright (c)   2020 - 2022 Michal Töpfer <michal.topfer@gmail.com>
Copyright (c)   2022        Jiří Kalvoda <jirikalvoda@kam.mff.cuni.cz>
Copyright (c)   2023        Daniel Skýpala <skipy@kam.mff.cuni.cz>
Copyright (c)   2024        Benjamin Swart <benjaminswart@email.cz>

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

pisek-1.0.0.tar.gz (123.8 kB view details)

Uploaded Source

Built Distribution

pisek-1.0.0-py3-none-any.whl (148.9 kB view details)

Uploaded Python 3

File details

Details for the file pisek-1.0.0.tar.gz.

File metadata

  • Download URL: pisek-1.0.0.tar.gz
  • Upload date:
  • Size: 123.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for pisek-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a0b528ed4f0beee7fb304c119f69be96ff3582ba65ccb20a96ee2ea858aff22d
MD5 adecd624e560ffb0fc180e808af8ad5d
BLAKE2b-256 16c11856cadc855631476dcc7f0b602a70e78efe64f9a01f50371845809a09e9

See more details on using hashes here.

File details

Details for the file pisek-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pisek-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 148.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for pisek-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34bc84f13389a4cfa7546f07f49f17361c2c335ebb65a1c677d36d7dbb9a8660
MD5 d2c561182f1ac74b53c07e4bb3e61a79
BLAKE2b-256 4a44fa08ec9b44b79c7f8187cd30e99d120d2ff71b81e42811bfcf9b8fe0809d

See more details on using hashes here.

Supported by

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