Blueprint

class blaupause.Blueprint(count, participants, name='standard')

This is a small class without any practical use case.

This class has no useful functionality apart from learning how to write documentation for a class.

Parameters
  • count (numbers.real) – Number of items.

  • participants (numbers.real) – Number of participants. Must be larger than zero.

  • name (str) – Task name. Defaults to standard.

Raises

ValueError – If participants is not larger than zero.

Examples

>>> from blaupause import Blueprint
>>> bp = Blueprint(count=3, participants=1)
>>> bp
Blueprint(count=3, participants=1, name=standard)

Methods summary

__add__

Add two instances of MyClass

__radd__

Operator +=

__repr__

Return repr(self).

do_nothing

Method that does nothing.

mean_shares

Mean of the given value and class properties.

print_blueprint

Prints blueprint.

Attributes summary

participants

Number of participants.

shares

Divide a and b.


__add__(other)

Add two instances of MyClass

__radd__(other)

Operator +=

__repr__()

Return repr(self).

do_nothing()

Method that does nothing.

This method does not do anything. Its only purpose is to have more methods in the documentation.

mean_shares(value)

Mean of the given value and class properties.

This method computes the mean of the given value and the two values a and b of the current instance of MyClass.

Parameters

value (numbers.real) – Third value to compute mean with.

Returns

The mean.

Return type

numbers.real

Examples

>>> from blaupause import Blueprint
>>> bp = Blueprint(count=2, participants=3)
>>> bp.mean_shares(4)
2.0
static print_blueprint()

Prints blueprint.

This method only prints the word blueprint. Used to have a static method in the documentation.

property participants

Number of participants.

property shares

Divide a and b.

Returns

a / b

Return type

numbers.real

Examples

>>> from blaupause import Blueprint
>>> bp = Blueprint(count=6, participants=2)
>>> bp.shares
3.0