<commit_before>"""
Random-dot stereogram patterns.

$Id$
"""
__version__='$Revision$'

from Numeric import zeros,ones,floor,where,choose,less,greater,Int
from RandomArray import random,seed

from topo.base.parameterclasses import Number,Integer
from topo.base.patterngenerator import PatternGenerator
from topo.base.sheetcoords import SheetCoordinateSystem
from topo.base.functionfamilies import IdentityOF

from topo.base.arrayutils import clip_lower


### JABHACKALERT: This code seems to work fine when the input regions
### are all the same size and shape, but for
### e.g. examples/hierarchical.ty the resulting images in the Test
### Pattern preview window are square (instead of the actual
### rectangular shapes), matching between the eyes (instead of the
### actual two different rectangles), and with dot sizes that don't
### match between the eyes.  It's not clear why this happens.

class RandomDotStereogram(PatternGenerator):
    """
    Random dot stereogram using rectangular black and white patches.

    Based on Matlab code originally from Jenny Read, implemented in
    Topographica by <NAME> (2006).
    """

    # Suppress unused parameters
    x = Number(hidden=True)
    y = Number(hidden=True)
    size = Number(hidden=True)
    orientation = Number(hidden=True)

    # Override defaults to make them appropriate
    scale  = Number(default=0.5)
    offset = Number(default=0.5)

    # New parameters for this pattern
    xdisparity = Number(default=0.0,bounds=(-1.0,1.0),softbounds=(-0.5,0.5),<commit_msg>Added alert<commit_after>"""
Random-dot stereogram patterns.

$Id$
"""
__version__='$Revision$'

from Numeric import zeros,ones,floor,where,choose,less,greater,Int
from RandomArray import random,seed

from topo.base.parameterclasses import Number,Integer
from topo.base.patterngenerator import PatternGenerator
from topo.base.sheetcoords import SheetCoordinateSystem
from topo.base.functionfamilies import IdentityOF

from topo.base.arrayutils import clip_lower


### JABHACKALERT: This code seems to work fine when the input regions
### are all the same size and shape, but for
### e.g. examples/hierarchical.ty the resulting images in the Test
### Pattern preview window are square (instead of the actual
### rectangular shapes), matching between the eyes (instead of the
### actual two different rectangles), and with dot sizes that don't
### match between the eyes.  It's not clear why this happens.

class RandomDotStereogram(PatternGenerator):
    """
    Random dot stereogram using rectangular black and white patches.

    Based on Matlab code originally from <NAME>, implemented in
    Topographica by <NAME> (2006).
    """

    # Suppress unused parameters
    x = Number(hidden=True)
    y = Number(hidden=True)
    size = Number(hidden=True)
    orientation = Number(hidden=True)

    # Override defaults to make them appropriate
    scale  = Number(default=0.5)
    offset = Number(default=0.5)

    # New parameters for this pattern

    #JABALERT: Should rename xdisparity and ydisparity to x and y, and simply
    #set them to different values for each pattern to get disparity
    xdisparity = Number(default=0.0,bounds=(-1.0,1.0),softbounds=(-0.5,0.5),
{'fraction_non_alphanumeric': 0.08929128941617234, 'fraction_numerical': 0.01123946300343428, 'mean_word_length': 4.514629948364888, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '728939', 'n_tokens_mistral': 937, 'n_tokens_neox': 885, 'n_words': 328}