@@ -8,6 +8,26 @@ The codebase uses Numba JIT compilation for computationally intensive kernels an
88
99---
1010
11+ ### Project Structure
12+
13+ The repository is organized to separate model logic, high-performance execution scripts, and data analysis:
14+
15+ ``` text
16+ .
17+ ├── models/ # Core simulation logic
18+ │ ├── CA.py # Base Cellular Automaton class
19+ │ ├── config.py # Phase-specific experiment configurations
20+ │ └── numba_optimized.py # JIT kernels and cluster detection
21+ ├── scripts/ # HPC execution scripts
22+ │ └── run_phase{1..5}.sh # Bash scripts for Slurm/SGE jobs
23+ ├── notebooks/ # Data analysis and visualization
24+ │ └── plots.ipynb # Results plotting and Hydra effect analysis
25+ ├── tests/ # Pytest suite for model validation
26+ ├── data/ # Local storage for simulation outputs (JSONL)
27+ └── requirements.txt # Project dependencies
28+
29+ ---
30+
1131### Background
1232
1333#### The Hydra Effect
@@ -278,7 +298,55 @@ Metadata files (`phase{N}_metadata.json`) accompany each results file with confi
278298
279299---
280300
281- ### Dependencies
301+ ### Testing
302+
303+ The project includes a pytest test suite covering all core modules.
304+
305+ #### Test Modules
306+
307+ | File | Coverage |
308+ | ------| ----------|
309+ | ` tests/test_ca.py ` | CA base class, PP model initialization, update mechanics, evolution, edge cases |
310+ | ` tests/test_numba_optimized.py ` | Cluster detection, PCF computation, PPKernel updates, performance |
311+ | ` tests/test_experiments.py ` | Utility functions, I/O operations, simulation runner, phase registration |
312+ | ` tests/test_config.py ` | Configuration defaults, phase configs, helper methods |
313+
314+ #### Running Tests
315+ ``` bash
316+ # Run all tests
317+ pytest tests/ -v
318+
319+ # Run specific test file
320+ pytest tests/test_ca.py -v
321+
322+ # Run with coverage report
323+ pytest tests/ --cov=models --cov-report=html
324+
325+ # Fast mode (stop on first failure)
326+ pytest tests/ -x --tb=short
327+ ```
328+
329+ ### Documentation
330+
331+ Full API documentation is available at: ** [ https://codegithubka.github.io/CSS_Project/ ] ( https://yourusername.github.io/CSS_Project/ ) **
332+
333+
334+ #### Generating Docs Locally
335+ ``` bash
336+ # Generate HTML documentation
337+ pdoc --output-dir docs --docformat numpy --no-include-undocumented \
338+ models.CA models.config models.numba_optimized experiments.py
339+
340+ # View locally
341+ open docs/index.html
342+ ```
343+
344+ Documentation is auto-generated from NumPy-style docstrings using [ pdoc] ( https://pdoc.dev/ ) .
345+
346+
347+ ### Getting Started
348+
349+ #### Dependencies
282350
283351** Required:**
284352- Python 3.8+
@@ -290,3 +358,32 @@ Metadata files (`phase{N}_metadata.json`) accompany each results file with confi
290358** Optional:**
291359- matplotlib (visualization)
292360- scipy (additional analysis)
361+
362+ #### Installation
363+ Clone the repository and install the dependencies. It is recommended to use a virtual environment.
364+
365+ ``` bash
366+ # Install dependencies
367+ pip install -r requirements.txt
368+ ```
369+
370+ #### Running simulations
371+
372+ The experiments are automated via bash-scripts in the ``` scripts ``` directory. These are configured for high-performance computing environments:
373+
374+ ``` bash
375+ # Grant execution permissions
376+ chmod +x scripts/* .sh
377+
378+ # Execute a specific phase (e.g., Phase 1)
379+ ./scripts/run_phase1.sh
380+ ```
381+
382+ #### Analysis and Visualization
383+
384+ Once simulations complete, raw data is stored in the ``` data/ ``` folder. Use the provided Jupyter notebook for analysis.
385+
386+ ``` bash
387+ jupyter notebook notebooks/plots.ipynb
388+ ```
389+
0 commit comments