Skip to content

Commit

Permalink
Fix examples.* docstrings (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
a5kin committed Jun 22, 2019
1 parent b56ea88 commit c0f5d2e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions examples/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Collection of base classes and helpers commonly used in examples."""
"""Base classes and helpers commonly used in examples."""

import abc

Expand Down Expand Up @@ -35,7 +35,7 @@ def color(self):


class RegularExperiment(core.Experiment):
"""Experiment with most common field size, zoom and pos."""
"""Experiment with the most common field size, zoom and pos."""

word = "I AM MUNDANE"
size = (640, 360, )
Expand Down
13 changes: 7 additions & 6 deletions examples/evolife.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ class EvoLife(RegularCA):
we choose one with larger N;
- Newly born cell's ruleset calculated as crossover between
'parent' cells rulesets;
- If cell is involved in breeding as a 'parent', it's loosing
BIRTH_COST units of energy per each non-zero gene passed;
- This doesn't apply in re-occupation case;
- Every turn, cell is loosing DEATH_SPEED units of energy;
- Cell with zero energy is dying;
- Cell cannot have more than MAX_GENES non-zero genes in ruleset.
Expand Down Expand Up @@ -212,7 +209,12 @@ class Topology(EvoLife.Topology):


class EvoLife6DExperiment(RegularExperiment):
"""Generic experiment for 6D EvoLife: 2 spatial, 4 micro-dimensions."""
"""
Generic experiment for 6D EvoLife: 2 spatial, 4 micro-dimensions.
WARNING: to run this model you need at least 9GB GPU RAM free.
"""

word = "SP1RALS 1N HYPERSP@CE"
size = (640, 380, 7, 5, 3, 3)
Expand Down Expand Up @@ -241,5 +243,4 @@ class EvoLife6DExperiment(RegularExperiment):


if __name__ == "__main__":
run_simulation(EvoLife6D, EvoLife6DExperiment)
# run_simulation(EvoLife, CrossbreedingExperiment2)
run_simulation(EvoLife, CrossbreedingExperiment2)
16 changes: 8 additions & 8 deletions examples/game_of_life.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ class GOLExperiment(core.Experiment):
Here, we define constants and initial conditions from which the
world's seed will be generated.
The ``word`` is RNG seed string. The ``size``, ``zoom`` and
The ``word`` is an RNG seed string. The ``size``, ``zoom`` and
``pos`` are board contstants. The ``seed`` is a pattern used in
initial board state generation.
the initial board state generation.
``BigBang`` is a pattern when small area initialized with a
high-density random values.
Expand Down Expand Up @@ -252,13 +252,13 @@ class GOLExperiment2(GOLExperiment):

class GOLExperimentColor(GOLExperiment):
"""
Experiment for GameOfLifeColor.
The experiment for ``GameOfLifeColor``.
Here, we introduce ``fade_out`` constant, which is used in
rendering causing cells slowly fade out.
rendering and slowly fading out the color of cells.
Note, it is only aestetic effect, and does not affect real cell
state.
Note, it is only an aestetic effect, and does not affect the real
cell state.
"""

Expand All @@ -280,7 +280,7 @@ class GOLExperiment6D(GOLExperiment2):
Special experiment for 6D Life.
Here, we define the world with 2 spatial and 4 looped
micro-dimensions, 3 cells length each.
micro-dimensions, 3 cells per micro-dimension.
As a result, we get large quasi-stable oscillators, looping over
micro-dimensions. Strangely formed, but nothing interesting,
Expand All @@ -292,7 +292,7 @@ class GOLExperiment6D(GOLExperiment2):


class DiamoebaExperiment(GOLExperiment):
"""Experiment with interactive rule."""
"""Experiment with the interactive rule."""
rule = LifeLike.golly2int("B35678/S5678")


Expand Down
4 changes: 2 additions & 2 deletions examples/noisetv.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class NoiseTV(RegularCA):
"""Just pseudorandom noise, tickling your eyes."""
"""Just a pseudorandom noise, tickling your eyes."""
rng = core.RandomProperty()

def emit(self):
Expand All @@ -29,7 +29,7 @@ def color(self):


class NoiseTVExperiment(RegularExperiment):
"""Default experiment for legacy EvoLife."""
"""Default experiment filling the whole board with a noise."""

word = "PSHSHSHSH!"
seed = seeds.patterns.PrimordialSoup(
Expand Down

0 comments on commit c0f5d2e

Please sign in to comment.