bio-logic-compiler 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,83 @@
1
+ Metadata-Version: 2.4
2
+ Name: bio-logic-compiler
3
+ Version: 0.1.0
4
+ Summary: A Python MVP for a Bio-Logic Compiler that models neural circuits as graphs, analyzes neuron firing thresholds, and reverse-engineers Boolean logic gates from biological connectivity.
5
+ Author: Your Name
6
+ Author-email: Your Name <your.email@example.com>
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: networkx
10
+ Requires-Dist: matplotlib
11
+ Dynamic: author
12
+ Dynamic: requires-python
13
+
14
+ # Bio-Logic Compiler
15
+
16
+ This project provides a Python MVP for a Bio-Logic Compiler that models neural circuits as graphs, analyzes neuron firing thresholds, and reverse-engineers Boolean logic gates (AND, OR, NOT, NAND, NOR, etc) from biological connectivity.
17
+
18
+ ## Features
19
+ - Model neurons as nodes and synapses as weighted edges (networkx)
20
+ - Add synapses manually or ingest from JSON/CSV files
21
+ - Extract logic gates from neuron thresholds and synaptic weights
22
+ - Detects AND, OR, NOT, NAND, NOR, direct pass-through, and complex motifs
23
+ - Visualize neural circuits with matplotlib
24
+ - Comprehensive unit tests
25
+
26
+ ## Usage
27
+
28
+ 1. **Install dependencies**
29
+ ```sh
30
+ pip install -r requirements.txt
31
+ ```
32
+
33
+ 2. **Run Example**
34
+ ```sh
35
+ python bio_compiler.py
36
+ ```
37
+
38
+ ```sh
39
+ python -m unittest test_bio_compiler.py
40
+ ```
41
+
42
+ ```sh
43
+ python test_visualization.py
44
+ ```
45
+
46
+
47
+ ## File Structure
48
+ - `bio_compiler.py` — Main class and logic extraction
49
+ - `app.py` — Dash web app (main UI)
50
+ - `sample_circuit.json` / `sample_circuit.csv` — Example data
51
+ - `requirements.txt` — Dependencies
52
+ - `pyproject.toml`, `setup.py` — Packaging
53
+
54
+ ## Logic Extraction Principle
55
+ A neuron fires if:
56
+
57
+ $$
58
+ \sum (I_n \cdot w_n) \geq \theta
59
+ $$
60
+
61
+ Where $I$ is the input (0 or 1), $w$ is the synaptic weight, and $\theta$ is the threshold.
62
+
63
+ - **AND**: All excitatory inputs must be active (threshold = sum of weights)
64
+ - **OR**: Any excitatory input triggers firing (threshold <= min weight)
65
+ - **NOT**: Inhibitory input vetoes firing
66
+ - **NAND/NOR**: Mixed motifs with both excitatory and inhibitory inputs
67
+
68
+ ## Extending
69
+ - Add support for temporal summation and motif discovery
70
+ - Integrate with real connectome data (e.g., FlyWire)
71
+ - Enhance visualization and reporting
72
+
73
+ ## Advanced Features
74
+ - FlyWire connectome data ingestion (JSON/CSV)
75
+ - Temporal modeling (simulate time steps)
76
+ - Motif discovery (logic motif extraction)
77
+
78
+ ## Packaging
79
+ - `pyproject.toml` and `setup.py` for pip/Poetry installation
80
+ - `requirements.txt` for quick dependency install
81
+
82
+ ## License
83
+ MIT
@@ -0,0 +1,70 @@
1
+ # Bio-Logic Compiler
2
+
3
+ This project provides a Python MVP for a Bio-Logic Compiler that models neural circuits as graphs, analyzes neuron firing thresholds, and reverse-engineers Boolean logic gates (AND, OR, NOT, NAND, NOR, etc) from biological connectivity.
4
+
5
+ ## Features
6
+ - Model neurons as nodes and synapses as weighted edges (networkx)
7
+ - Add synapses manually or ingest from JSON/CSV files
8
+ - Extract logic gates from neuron thresholds and synaptic weights
9
+ - Detects AND, OR, NOT, NAND, NOR, direct pass-through, and complex motifs
10
+ - Visualize neural circuits with matplotlib
11
+ - Comprehensive unit tests
12
+
13
+ ## Usage
14
+
15
+ 1. **Install dependencies**
16
+ ```sh
17
+ pip install -r requirements.txt
18
+ ```
19
+
20
+ 2. **Run Example**
21
+ ```sh
22
+ python bio_compiler.py
23
+ ```
24
+
25
+ ```sh
26
+ python -m unittest test_bio_compiler.py
27
+ ```
28
+
29
+ ```sh
30
+ python test_visualization.py
31
+ ```
32
+
33
+
34
+ ## File Structure
35
+ - `bio_compiler.py` — Main class and logic extraction
36
+ - `app.py` — Dash web app (main UI)
37
+ - `sample_circuit.json` / `sample_circuit.csv` — Example data
38
+ - `requirements.txt` — Dependencies
39
+ - `pyproject.toml`, `setup.py` — Packaging
40
+
41
+ ## Logic Extraction Principle
42
+ A neuron fires if:
43
+
44
+ $$
45
+ \sum (I_n \cdot w_n) \geq \theta
46
+ $$
47
+
48
+ Where $I$ is the input (0 or 1), $w$ is the synaptic weight, and $\theta$ is the threshold.
49
+
50
+ - **AND**: All excitatory inputs must be active (threshold = sum of weights)
51
+ - **OR**: Any excitatory input triggers firing (threshold <= min weight)
52
+ - **NOT**: Inhibitory input vetoes firing
53
+ - **NAND/NOR**: Mixed motifs with both excitatory and inhibitory inputs
54
+
55
+ ## Extending
56
+ - Add support for temporal summation and motif discovery
57
+ - Integrate with real connectome data (e.g., FlyWire)
58
+ - Enhance visualization and reporting
59
+
60
+ ## Advanced Features
61
+ - FlyWire connectome data ingestion (JSON/CSV)
62
+ - Temporal modeling (simulate time steps)
63
+ - Motif discovery (logic motif extraction)
64
+
65
+ ## Packaging
66
+ - `pyproject.toml` and `setup.py` for pip/Poetry installation
67
+ - `requirements.txt` for quick dependency install
68
+
69
+ ## License
70
+ MIT
@@ -0,0 +1,83 @@
1
+ Metadata-Version: 2.4
2
+ Name: bio-logic-compiler
3
+ Version: 0.1.0
4
+ Summary: A Python MVP for a Bio-Logic Compiler that models neural circuits as graphs, analyzes neuron firing thresholds, and reverse-engineers Boolean logic gates from biological connectivity.
5
+ Author: Your Name
6
+ Author-email: Your Name <your.email@example.com>
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: networkx
10
+ Requires-Dist: matplotlib
11
+ Dynamic: author
12
+ Dynamic: requires-python
13
+
14
+ # Bio-Logic Compiler
15
+
16
+ This project provides a Python MVP for a Bio-Logic Compiler that models neural circuits as graphs, analyzes neuron firing thresholds, and reverse-engineers Boolean logic gates (AND, OR, NOT, NAND, NOR, etc) from biological connectivity.
17
+
18
+ ## Features
19
+ - Model neurons as nodes and synapses as weighted edges (networkx)
20
+ - Add synapses manually or ingest from JSON/CSV files
21
+ - Extract logic gates from neuron thresholds and synaptic weights
22
+ - Detects AND, OR, NOT, NAND, NOR, direct pass-through, and complex motifs
23
+ - Visualize neural circuits with matplotlib
24
+ - Comprehensive unit tests
25
+
26
+ ## Usage
27
+
28
+ 1. **Install dependencies**
29
+ ```sh
30
+ pip install -r requirements.txt
31
+ ```
32
+
33
+ 2. **Run Example**
34
+ ```sh
35
+ python bio_compiler.py
36
+ ```
37
+
38
+ ```sh
39
+ python -m unittest test_bio_compiler.py
40
+ ```
41
+
42
+ ```sh
43
+ python test_visualization.py
44
+ ```
45
+
46
+
47
+ ## File Structure
48
+ - `bio_compiler.py` — Main class and logic extraction
49
+ - `app.py` — Dash web app (main UI)
50
+ - `sample_circuit.json` / `sample_circuit.csv` — Example data
51
+ - `requirements.txt` — Dependencies
52
+ - `pyproject.toml`, `setup.py` — Packaging
53
+
54
+ ## Logic Extraction Principle
55
+ A neuron fires if:
56
+
57
+ $$
58
+ \sum (I_n \cdot w_n) \geq \theta
59
+ $$
60
+
61
+ Where $I$ is the input (0 or 1), $w$ is the synaptic weight, and $\theta$ is the threshold.
62
+
63
+ - **AND**: All excitatory inputs must be active (threshold = sum of weights)
64
+ - **OR**: Any excitatory input triggers firing (threshold <= min weight)
65
+ - **NOT**: Inhibitory input vetoes firing
66
+ - **NAND/NOR**: Mixed motifs with both excitatory and inhibitory inputs
67
+
68
+ ## Extending
69
+ - Add support for temporal summation and motif discovery
70
+ - Integrate with real connectome data (e.g., FlyWire)
71
+ - Enhance visualization and reporting
72
+
73
+ ## Advanced Features
74
+ - FlyWire connectome data ingestion (JSON/CSV)
75
+ - Temporal modeling (simulate time steps)
76
+ - Motif discovery (logic motif extraction)
77
+
78
+ ## Packaging
79
+ - `pyproject.toml` and `setup.py` for pip/Poetry installation
80
+ - `requirements.txt` for quick dependency install
81
+
82
+ ## License
83
+ MIT
@@ -0,0 +1,10 @@
1
+ README.md
2
+ cli.py
3
+ pyproject.toml
4
+ setup.py
5
+ bio_logic_compiler.egg-info/PKG-INFO
6
+ bio_logic_compiler.egg-info/SOURCES.txt
7
+ bio_logic_compiler.egg-info/dependency_links.txt
8
+ bio_logic_compiler.egg-info/entry_points.txt
9
+ bio_logic_compiler.egg-info/requires.txt
10
+ bio_logic_compiler.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ bio-logic-compiler = bio_compiler:BioCompiler
@@ -0,0 +1,2 @@
1
+ networkx
2
+ matplotlib
@@ -0,0 +1,31 @@
1
+ import argparse
2
+ import subprocess
3
+ import sys
4
+ import os
5
+
6
+ def run_module(module):
7
+ # Run a Python module in a subprocess
8
+ python = sys.executable
9
+ subprocess.run([python, module])
10
+
11
+ def main():
12
+ parser = argparse.ArgumentParser(description="Bio-Logic Compiler CLI")
13
+ subparsers = parser.add_subparsers(dest="command")
14
+
15
+ subparsers.add_parser("start-api", help="Start the FastAPI server (api.py)")
16
+ subparsers.add_parser("start-ui", help="Start the Dash UI (app.py)")
17
+ subparsers.add_parser("run-sim", help="Run the CartPole environment (environment.py)")
18
+
19
+ args = parser.parse_args()
20
+
21
+ if args.command == "start-api":
22
+ run_module("api.py")
23
+ elif args.command == "start-ui":
24
+ run_module("app.py")
25
+ elif args.command == "run-sim":
26
+ run_module("environment.py")
27
+ else:
28
+ parser.print_help()
29
+
30
+ if __name__ == "__main__":
31
+ main()
@@ -0,0 +1,20 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "bio-logic-compiler"
7
+ version = "0.1.0"
8
+ description = "A Python MVP for a Bio-Logic Compiler that models neural circuits as graphs, analyzes neuron firing thresholds, and reverse-engineers Boolean logic gates from biological connectivity."
9
+ authors = [
10
+ { name = "Your Name", email = "your.email@example.com" }
11
+ ]
12
+ readme = "README.md"
13
+ requires-python = ">=3.8"
14
+ dependencies = [
15
+ "networkx",
16
+ "matplotlib"
17
+ ]
18
+
19
+ [project.scripts]
20
+ bio-logic-compiler = "bio_compiler:BioCompiler"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,24 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="bio-logic-compiler",
5
+ version="1.0.0",
6
+ description="Unified CLI for the Bio-Logic synthetic brain ecosystem",
7
+ author="Your Name",
8
+ author_email="your.email@example.com",
9
+ packages=find_packages(),
10
+ py_modules=["cli"],
11
+ install_requires=[
12
+ "networkx",
13
+ "matplotlib"
14
+ ],
15
+ python_requires=">=3.8",
16
+ include_package_data=True,
17
+ long_description=open("README.md").read(),
18
+ long_description_content_type="text/markdown",
19
+ entry_points={
20
+ "console_scripts": [
21
+ "biologic=cli:main"
22
+ ]
23
+ },
24
+ )