semvec/pypi-packages huggingface dataset:
pyhedrals 0.2.0
A library for evaluating tabletop dice roll expressions
Requires Python: >=3.6

# PyHedrals [![Build Status](https://travis-ci.org/StarlitGhost/pyhedrals.svg?branch=master)](https://travis-ci.org/StarlitGhost/pyhedrals)

A library for evaluating tabletop dice roll expressions.

Used in the Mastodon bot [DiceCat](https://github.com/StarlitGhost/DiceCat), and the IRC bot [DesertBot](https://github.com/DesertBot/DesertBot)

### Usage Overview

Sample usage:
`5d6!>4 + (5d(2d10)dl - d10) * (d20 / 2) # for an unnecessarily complicated roll`

Sample output:
`84 for an unnecessarily complicated roll`

There is also a verbose mode that outputs every individual die roll, that output looks like this:
`[2d10: 2,5 (7) | 5d7: -1-,6,2,4,5 (17) | 1d10: 3 (3) | 1d20: 9 (9) | 5d6: 2,2,3,*5*,*5*,2,*5*,4 (28)] 84 for an unnecessarily complicated roll`

### Supported Operators
* Arithmetic: `+` `-` `*` `/` `%` `^` `()` (addition, subtraction, multiplication, division, modulus, exponent, parentheses)
* Dice: `#d#` (eg, `3d6`, `d20`)
  * Rolls the left number of dice with the right number of sides. `3d6` rolls 3 six-sided dice
  * The first number is optional and defaults to 1 if omitted
* Dice modifiers:
  * Keep/Drop Highest/Lowest: `kh#` `kl#` `dh#` `dl#`
    * Keeps/Drops only the # highest/lowest dice rolls. Any that are either not kept or dropped are removed from the total
    * The number is optional and defaults to 1 if omitted
  * Exploding: `!` `!#` `!>#` `!>=#` `!<#` `!<=#`
    * Each die that rolls maximum (`!`), or a specific number (`!#`), or over/under a threshold (`!>#` `!>=#` `!<#` `!<=#`), adds an additional die to the pool
      * This repeats for each die added to the pool
  * Reroll: `r` `r#` `r>#` `r>=#` `r<#` `r<=#`
    * Drops and rerolls each die that rolls minimum (`r`), or a specific number (`r#`), or over/under a threshold (`r>#` `r>=#` `r<#` `r<=#`)
      * This repeats for each die rerolled. You can make it only reroll each die once with `ro` instead of `r`
  * Count: `c` `c#` `c>#` `c>=#` `c<#` `c<=#`
    * Counts the number of dice that roll maximum (`c`), or a specific number (`c#`), or over/under a threshold (`c>#` `c>=#` `c<#` `c<=#`)
  * Sorting: `s` `sa` `sd`
    * Sorts the dice rolls in ascending (`s` `sa`) or descending (`sd`) order
    * This still applies in non-verbose mode but you won't see any visible effect
* Comments: `# your comment here`
  * Adds a comment to the end of the output, so you can describe what the roll is for. eg: `d20+5 # for initiative`
  * The `#` is a literal hash, not a number this time :)

If you have more ideas for operators, suggestions and pull requests are welcome!
comptests 1.4.34
Testing utilities for projects that use ConfTools for handling their configuration.

[![CircleCI](https://circleci.com/gh/AndreaCensi/comptests.svg?style=shield)](https://circleci.com/gh/AndreaCensi/comptests)

comptests
=========

Testing utilities built on top of [ConfTools][conftools], [CompMake][compmake]
and [QuickApp][quickapp].


Basic Usage
-----------

This is the usage for packages that register objects using [ConfTools][conftools].

# Defining tests

Call the function ``comptests_for_all`` to create a decorator:

    # get the library (ObjSpec)
    library_robots = get_conftools_robots()

    # Create a test decorator
    for_all_robots = comptests_for_all(library_robots)

    # Use the decorator to specify tests. Test functions
    # must take two arguments: id object and object itself

    @for_all_robots
    def check_robot_type(id_robot, robot):
        assert isinstance(robot, RobotInterface)

You can also register tests for pairs:

    library_nuisances = get_conftools_nuisances()
    for_all_robot_nuisance_pairs = comptests_for_all_pairs(library_robots, library_nuisances)

    @for_all_robot_nuisance_pairs
    def check_nuisances_obs(id_robot, robot, id_nuisance, nuisance):
        check_conversions(robot.get_spec().get_observations(), nuisance)

# Running tests

Use the command line:

    comptests <module>

This looks for the ``get_comptests()`` function in ``<module>``:

    def get_comptests():
        get_comptests():
        # get testing configuration directory
        from pkg_resources import resource_filename
        dirname = resource_filename("boot_agents", "configs")
        # load unittests
        from . import unittests
        from comptests import get_comptests_app
        # Get the Quickapp for the boot_config
        app = get_comptests_app(get_boot_config())
        return [app]

Finding coverage information
============================

It's very usuful to use the ``coverage`` tool together with comptests.

Install the ``coverage`` tool:

    pip install coverage

If ``coverage`` is installed then comptests automatically computes
the coverage information for nosetests execution.

To do the coverage information for the comptests, run like this:

    coverage run =comptests -c "make recurse=1" <package>

Note that you cannot use parallel testing (using ``parmake``) otherwise
coverage gets confused.

This displays the results:

    coverage report -m

Then create the HTML report:

    coverage html -d outdir
cirkit 3.0a2.dev5
A C++ logic synthesis framework

# CirKit (Python interface)

CirKit is a synthesis and optimization frameworks for classical logic networks.
It is implemented based on various
[EPFL logic sythesis libraries](https://github.com/lsils/lstools-showcase).

## Example

```python
import cirkit
cirkit.read_aiger(aig=True, filename="file.aig")
cirkit.ps(aig=True)
cirkit.cut_rewrite(aig=True)
cirkit.lut_mapping(aig=True)
cirkit.collapse_mapped(aig=True)
cirkit.ps(lut=True)
cirkit.write_bench(lut=True, filename="file.bench")
```

## EPFL logic sythesis libraries

CirKit and Revkit are based on the [EPFL logic synthesis](https://lsi.epfl.ch/page-138455-en.html) libraries.  The libraries and several examples on how to use and integrate the libraries can be found in the [logic synthesis tool showcase](https://github.com/lsils/lstools-showcase).