semvec/pypi-packages huggingface dataset:
circuit-rs 0.4.0
A library for doing efficient operations on neural circuits
License: MIT
Requires Python: >=3.12

# rusted_circuits

Exposing useful operations to manipulate the neural circuits that can be derived from [Flywire](https://flywire.ai/), a project which maps out the Drosophila brain.

## Context

In my research, I found myself repeatedly needing to find a minimal circuit (connectivity-wise) from a given set of source and sink nodes. Specifically, I needed to identify the smallest subcircuit containing all nodes on all simple paths between a set of (source, sink) nodes. The python code I used was too slow, even considering various biological priors (e.g. I think it's possible to traverse from most neurons to almost any other within 5 jumps, and if you can't then it's probably not possible), and existing solutions such as [networkx-all_simple_paths](https://networkx.org/documentation/stable/_modules/networkx/algorithms/simple_paths.html#all_simple_paths), and [rustworkx-all_simple_paths](https://www.rustworkx.org/apiref/rustworkx.all_simple_paths.html) only consider single source-sink pairs at a time, so I'd need rerun the algorithm #Source * #Sink times, but by writing my own script, I only needed to run it #Source times. Also, those libraries return lists-of-lists, which can cause lots of memory to build up and since I only care about the nodes and not the actual path, I figure I can avoid that expense.

# Design

We accept numpy arrays of 2D where column 1 is the pre-synaptic and column 2 is the post-synaptic.

# Functions

```
isolate_subcircuit(
    edge_array: np.ndarray[u64, u64]
    sources: set[int],
    sinks: set[int],
    max_depth: int,
    max_paths: int,
    nid_to_cidx_map: dict[int,int] | None
  
)
  
map_neuron_ids_to_cmat_idxs(
  edge_array: np.ndarray[u64, u64],
)

adjacency_map_from_edge_list(
  edge_array=np.ndarray[u64, u64],
  nid_to_cidx_map=dict[int, int] | None
)

```

# Example

## Smallest Subcircuit

Here is a simple working example, where we have a linear path from source `(1)` to sink `(5)`

```python

edge_list = np.asarray([(1, 2), (2, 3), (3, 4), (4, 5)])
sources = {1}
sinks = {5}
max_depth = 10
max_paths = 100

# The nid_to_cidx_map is optional, and if it is not specified, we derive the mapping of the neuron-id-to-connectivity-matrix-index.
nid_to_cidx_map = {1: 10, 2: 20, 3: 30, 4: 40, 5: 50}

# Expected: all nodes on the path from source to sink
expected = {10, 20, 30, 40, 50}
actual_np = isolate_subcircuit_np_edgelist(edge_list, sources, sinks, max_depth, max_paths, nid_to_cidx_map)

# -OR-, from a list
actual_list = isolate_subcircuit(edge_list.tolist(), sources, sinks, max_depth, max_paths, nid_to_cidx_map)
```

# Maintainers

1. Add code/documentation changes via `git add ...`

2. Attach a commit message e.g. `git commit -m '...'`

Note: in step 3, replace `VERSION_NUMBER` below by an actual version number e.g. v0.1.0

3. `git tag $VERSION_NUMBER`

4. Modify `Cargo.toml`, the `version` to be the same (not strictly necessary, but it's just nicer).

5. `git push origin $VERSION_NUMBER`
pinetree 0.5.0
stochastic simulation of gene expression with site-specific translation rates
License: MIT
Keywords: gene, codon, transcription, translation, biology, stochastic

![pinetree](https://github.com/clauswilke/pinetree/blob/master/docs/pinetree-logo.png?raw=true)

# pinetree 
[![Build Status](https://travis-ci.org/clauswilke/pinetree.svg?branch=master)](https://travis-ci.org/clauswilke/pinetree)
[![Documentation Status](https://readthedocs.org/projects/pinetree/badge/?version=latest)](http://pinetree.readthedocs.io/en/latest/?badge=latest)

A flexible gene expression simulator with codon-specific translation rates.

## Requirements

Pinetree requires Python, CMake, and a modern C++ compiler. Python 3 is recommended.

## Installation

To install the latest stable version of pinetree from PyPI, run the following:

```
pip3 install cmake  # CMake must be installed before installing pinetree
pip3 install pinetree 
```

The latest development build may be installed from GitHub as follows:

```
pip3 install cmake   
git clone https://github.com/benjaminjack/pinetree.git
cd pinetree
pip3 install .
```

## Documentation

Full documentation is available [here](http://pinetree.readthedocs.io/).

You may also build the documentation from the source code. Building the documentation requires sphinx.

```
pinetree/setup.py build_sphinx
```

## Reproducing plots from manuscript

This repository contains scripts to reproduce the simulations and plots from the manuscript that describes Pinetree. R and the R packages `cowplot`, `readr`, `dplyr`, and `stringr` are required to generate plots. Run the following to reproduce the plots from the manuscript:

```
python3 ./examples/three_genes.py
python3 ./examples/three_genes_recoded.py
Rscript plots.R
```

To simulate a bacteriophage T7 infection, run the following script.

```
# WARNING: This simulation takes approximately 2-3 hours to complete
python3 ./examples/phage_model.py
```
math-mcp-server-testing 1.0.5
MCP server for mathematical calculations
License: MIT
Requires Python: >=3.10

# Math MCP Server

A Model Context Protocol (MCP) server for mathematical calculations.

## Features

- **Basic Calculations**: Evaluate mathematical expressions
- **Equation Solving**: Solve linear equations
- **Safe Evaluation**: Secure expression parsing

## Installation

### Using npx (Recommended)
```bash
npx math-mcp-server
```

### Using npm
```bash
npm install -g math-mcp-server
math-mcp-server
```

## Usage

The server provides two tools:

### 1. calculate
Evaluate mathematical expressions:
```json
{
  "name": "calculate",
  "arguments": {
    "expression": "2 + 3 * 4"
  }
}
```

### 2. solve_equation
Solve linear equations:
```json
{
  "name": "solve_equation",
  "arguments": {
    "equation": "2x + 5 = 15"
  }
}
```

## MCP Client Configuration

Add to your MCP client configuration:

```json
{
  "mcpServers": {
    "math": {
      "command": "npx",
      "args": ["math-mcp-server"]
    }
  }
}
```

## Development

```bash
git clone <your-repo>
cd math-mcp
npm install
npm run build
npm start
```