class_docstr: Domain class describing a rectangular domain
  
  Attributes:
      size (Tuple[int]): The size of the domain in absolute units.
      dx (Tuple(float)): The unit of measure
class_docstr_tok: ["Domain","class","describing","a","rectangular","domain","Attributes",":","size","(","Tuple","[","int","]",")",":","The","size","of","the","domain","in","absolute","units",".","dx","(","Tuple","(","float",")",")",":","The","unit","of","measure"]
docstr: Returns a function that samples a point on the boundary of the domain
  
  Returns:
      Callable: A function that samples a point on the boundary of the domain.
          This function takes a seed and an integer number of samples and returns
          a list of samples.
  
  !!! example
      ```python
      >>> domain = Domain((10, 10), (0.1, 0.1))
      >>> boundary_sampler = domain.boundary_sampler
      >>> boundary_sampler(random.PRNGKey(0), 10)
      Array([[-0.02072918,  0.5       ],
             [-0.5       ,  0.49063694],
             [-0.18872023, -0.5       ],
             [ 0.31801188, -0.5       ],
             [-0.1319474 , -0.5       ],
             [ 0.5       , -0.36944878],
             [ 0.5       ,  0.46956718],
             [ 0.4608934 , -0.5       ],
             [-0.09031796,  0.5       ],
             [-0.5       ,  0.40659428]], dtype=float32)
  
      ```
docstr_tok: ["Returns","a","function","that","samples","a","point","on","the","boundary","of","the","domain","Returns",":","Callable",":","A","function","that","samples","a","point","on","the","boundary","of","the","domain",".","This","function","takes","a","seed","and","an","integer","number","of","samples","and","returns","a","list","of","samples",".","!","!","!","example","``","`","python",">",">",">","domain","=","Domain","(","(","10",",","10",")",",","(","0.1",",","0.1",")",")",">",">",">","boundary_sampler","=","domain.boundary_sampler",">",">",">","boundary_sampler","(","random.PRNGKey","(","0",")",",","10",")","Array","(","[","[","-0.02072918",",","0.5","]",",","[","-0.5",",","0.49063694","]",",","[","-0.18872023",",","-0.5","]",",","[","0.31801188",",","-0.5","]",",","[","-0.1319474",",","-0.5","]",",","[","0.5",",","-0.36944878","]",",","[","0.5",",","0.46956718","]",",","[","0.4608934",",","-0.5","]",",","[","-0.09031796",",","0.5","]",",","[","-0.5",",","0.40659428","]","]",",","dtype=float32",")","``","`"]
code: def boundary_sampler(self):
      r"""Returns a function that samples a point on the boundary of the domain
  
      Returns:
          Callable: A function that samples a point on the boundary of the domain.
              This function takes a seed and an integer number of samples and returns
              a list of samples.
  
      !!! example
          ```python
          >>> domain = Domain((10, 10), (0.1, 0.1))
          >>> boundary_sampler = domain.boundary_sampler
          >>> boundary_sampler(random.PRNGKey(0), 10)
          Array([[-0.02072918,  0.5       ],
                 [-0.5       ,  0.49063694],
                 [-0.18872023, -0.5       ],
                 [ 0.31801188, -0.5       ],
                 [-0.1319474 , -0.5       ],
                 [ 0.5       , -0.36944878],
                 [ 0.5       ,  0.46956718],
                 [ 0.4608934 , -0.5       ],
                 [-0.09031796,  0.5       ],
                 [-0.5       ,  0.40659428]], dtype=float32)
  
          ```
  
      """
      L = jnp.asarray(self.size) / 2
  
      def sample(seed):
          seeds = random.split(seed, 3)
          first = 2 * jnp.expand_dims(random.uniform(seeds[0]), 0) - 1
          others = (
              2 * random.bernoulli(seeds[1], shape=(self.ndim - 1,)) - 1
          )
          sample = jnp.concatenate([first, others]).astype(jnp.float32)
          random_perm = random.permutation(seeds[2], sample)
          sample = random_perm * L
          return sample
  
      def multi_samples(seed, num_samples: int):
          seeds = random.split(seed, num_samples)
          return jax.vmap(sample)(seeds)
  
      return multi_samples
  
file_path: jaxdf/jaxdf/geometry.py
imports: from functools import reduce
  from typing import Iterable
  import equinox
  import jax
  from jax import numpy
  from jax import random
  from .mods import Module
label_desc: Use image node_id 5 for calling the Domain obj's underlying member method code with example usage: obj.boundary_sampler() and returns: multi_samples, sample, jax