Skip to content
Snippets Groups Projects
  1. Jul 30, 2024
  2. Jul 26, 2024
  3. Jul 25, 2024
  4. Jul 24, 2024
  5. Jun 24, 2024
  6. Jun 19, 2024
  7. Jun 12, 2024
    • Thorsten Hater's avatar
      Fix snippets related to ions and units. (#2268) · 65a0e5fc
      Thorsten Hater authored
      Closes #2253
      65a0e5fc
    • Thorsten Hater's avatar
      🧹 Major housekeeping (#2274) · 3ef16823
      Thorsten Hater authored
      Housekeeping before v0.10.0
      
      ## bump and deprecate dependencies
      
      Go through all submodules, build docs, and other dependencies to adjust
      version numbers.
      Submodules go to Spack's latest
      
      ## `pip` now protects managed environments
      MacOS `brew` has becomes finicky lately when it comes to installing
      globally via `pip`,
      as new versions of `pip` are no longer allowing the user to break global
      environments.
      Fix by forcing `pip` to disregard that rule, as we set up and tear down
      VMs for precisely
      this purpose.
      
      Fixes #2273 
      
      ## spack develop started to misbehave
      
      Massage code in package.py around handling optimization flags. Output is
      a `version` object,
      input expects a string. Adjust by converting to string
      
      ## fix dubious type punning
      
      `network.cpp` uses `reinterpret_cast` to type pun. Use `memcpy` instead
      as recommended.
      Also got flagged by compiler warning with newer GCC
      
      ## `result_of` -> `invoke_result`
      
      Flagged as deprecated.
      
      ## fix includes in `test_*`
      
      Newer versions of GCC require including `algorithm` directly.
      3ef16823
  8. May 27, 2024
  9. May 23, 2024
  10. May 22, 2024
    • Simon Frasch's avatar
      Feature: High-level network specification (#2050) · 689eea33
      Simon Frasch authored
      
      Implement a high-level network specification as proposed in
      #418. It does not include support for gap junctions to allow the use of
      domain decomposition for some distributed network generation.
      The general idea is a DSL based on set algebra, which operates on the
      set of all possible connections, by selecting based on different
      criteria, such as the distance between cells or lists of labels. By
      operating on all possible connections, a separate definition of cell
      populations becomes unnecessary. An example for selecting all inter-cell
      connections with a certain source and destination label is:
      `(intersect (inter-cell) (source-label \"detector\") (destination-label
      \"syn\"))`
      
      For parameters such as weight and delay, a value can be defined in the
      DSL in a similar way with the usual mathematical operations available.
      An example would be:
      `(max 0.1 (exp (mul -0.5 (distance))))`
      
      The position of each connection site is calculated by resolving the
      local position on the cell and applying an isometry, which is provided
      by a new optional function of the recipe. In contrast to the usage of
      policies to select a member within a locset, each site is treated
      individually and can be distinguished by its position.
      
      Internally, some steps have been implemented in an attempt to reduce the
      overhead of generating connections:
      - Pre-select source and destination sites based on the selection to
      reduce the sampling space when possible
      - If selection is limited to a maximum distance, use an octree for
      efficient spatial sampling
      - When using MPI, only instantiate local cells and exchange source sites
      in a ring communication pattern to overlap communication and sampling.
      In addition, this reduces memory usage, since only the current and next
      source sites have to be stored in memory during the exchange process.
      
      Custom selection and value functions can still be provided by storing
      the wrapped function in a dictionary with an associated label, which can
      then be used in the DSL.
      
      Some challenges remain. In particular, how to handle combined explicit
      connections returned by `connections_on` and the new way to describe a
      network. Also, the use of non-blocking MPI is not easily integrated into
      the current context types, and the dry-run context is not supported so
      far.
      
      
      # Example
      A (trimmed) example in Python, where a ring connection combined with
      random connections based on the distance:
      ```py
      class recipe(arbor.recipe):
          def cell_isometry(self, gid):
              # place cells with equal distance on a circle
              radius = 500.0 # μm
              angle = 2.0 * math.pi * gid / self.ncells
              return arbor.isometry.translate(radius * math.cos(angle), radius * math.sin(angle), 0)
      
          def network_description(self):
              seed = 42
      
              # create a chain
              ring = f"(chain (gid-range 0 {self.ncells}))"
              # connect front and back of chain to form ring
              ring = f"(join {ring} (intersect (source-cell {self.ncells - 1}) (destination-cell 0)))"
      
              # Create random connections with probability inversely proportional to the distance within a
              # radius
              max_dist = 400.0 # μm
              probability = f"(div (sub {max_dist} (distance)) {max_dist})"
              rand = f"(intersect (random {seed} {probability}) (distance-lt {max_dist}))"
      
              # combine ring with random selection
              s = f"(join {ring} {rand})"
              # restrict to inter-cell connections and certain source / destination labels
              s = f"(intersect {s} (inter-cell) (source-label \"detector\") (destination-label \"syn\"))"
      
              # normal distributed weight with mean 0.02 μS, standard deviation 0.01 μS
              # and truncated to [0.005, 0.035]
              w = f"(truncated-normal-distribution {seed} 0.02 0.01 0.005 0.035)"
              # fixed delay
              d = "(scalar 5.0)"  # ms delay
      
              return arbor.network_description(s, w, d, {})
      ```
      Co-authored-by: default avatarThorsten Hater <24411438+thorstenhater@users.noreply.github.com>
      689eea33
  11. Apr 03, 2024
    • Thorsten Hater's avatar
      Remove `simulation::inject_events` (#2265) · 9f20e838
      Thorsten Hater authored
      This removes `simulation::inject_events` which is made obsolete by
      `recipe::event_generators`.
      The method exposed internals by giving access to the `lid` of synapses
      (over labels) and broke
      abstractions (`gid` must be present on this MPI rank and all events must
      be deliverable during
      the current time (as per documentation)). It was used only in a few
      tests and examples and these
      uses were replaced by `event_generator`s.
      9f20e838