Skip to content

Commit 86e5319

Browse files
authored
Merge pull request #5 from aetherspritee/gemini
Gemini Refactor
2 parents 18533aa + 2b18491 commit 86e5319

32 files changed

+5565
-1979
lines changed

.github/workflows/docs.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Build docs"
2+
on:
3+
workflow_dispatch:
4+
push:
5+
paths:
6+
- "docs/**/*"
7+
- ".github/workflows/docs.yml"
8+
9+
jobs:
10+
docs:
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: github-pages
14+
url: ${{ steps.deployment.outputs.page_url }}
15+
permissions:
16+
pages: write
17+
id-token: write
18+
steps:
19+
- id: deployment
20+
uses: sphinx-notes/pages@v3
21+
with:
22+
documentation_path: ./docs/source

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.envrc
22
.direnv
3+
RESULTS/
34

45
*.csv
56

README.md

Lines changed: 325 additions & 22 deletions
Large diffs are not rendered by default.

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
furo
2+
myst-parser
3+
sphinx-autoapi
4+
sphinx-autodoc-typehints
5+
sphinx-copybutton
6+
sphinx
7+
sphinxcontrib-bibtex
8+
sphinxcontrib-napoleon

docs/source/_static/logo.png

532 KB
Loading

docs/source/conf.py

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
import os
2+
import sys
3+
4+
from pyfracval import __version__, _authors
5+
6+
# Adjust the path to go up two levels from docs/source/ to the project root
7+
sys.path.insert(0, os.path.abspath("../../"))
8+
9+
# Configuration file for the Sphinx documentation builder.
10+
#
11+
# For the full list of built-in configuration values, see the documentation:
12+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
13+
14+
# -- Project information -----------------------------------------------------
15+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
16+
17+
18+
project = name = "PyFracVAL"
19+
author = _authors
20+
copyright = f"2025, {_authors}"
21+
version, release = __version__, __version__.split("+")[0]
22+
23+
# -- General configuration ---------------------------------------------------
24+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
25+
26+
extensions = [
27+
"sphinx.ext.napoleon", # Support for NumPy and Google style docstrings
28+
"sphinx.ext.autodoc", # Core Sphinx library to pull documentation from docstrings
29+
"sphinx.ext.intersphinx", # Link to other projects' documentation (e.g. Python, NumPy)
30+
"sphinx.ext.viewcode", # Add links to source code
31+
"sphinx_autodoc_typehints", # Automatically document types based on type hints
32+
"autoapi.extension",
33+
"myst_parser", # Parse Markdown files
34+
"sphinx_copybutton", # Add copy buttons to code blocks
35+
"sphinxcontrib.bibtex", # For BibTeX citation support
36+
]
37+
38+
source_suffix = {
39+
".rst": "restructuredtext",
40+
".md": "markdown",
41+
}
42+
43+
myst_enable_extensions = [
44+
"colon_fence", # Enables ::: directives for admonitions, etc.
45+
"deflist", # Enables definition lists
46+
"linkify", # Auto-detect URLs and make them links (use with caution)
47+
"tasklist", # Enable checklists - [ ] / - [x]
48+
]
49+
50+
templates_path = ["_templates"]
51+
exclude_patterns = []
52+
53+
54+
# -- Options for HTML output -------------------------------------------------
55+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
56+
57+
# html_theme = "alabaster"
58+
# html_theme = "furo"
59+
html_theme = "pydata_sphinx_theme"
60+
# html_logo = "_static/logo.png" # Optional: Add a logo file to _static/
61+
# html_favicon = "_static/favicon.ico" # Optional: Add a favicon
62+
html_static_path = ["_static"]
63+
64+
# Napoleon config
65+
# napoleon_google_docstring = True
66+
napoleon_numpy_docstring = True
67+
napoleon_include_init_with_doc = False # Include __init__ docstrings
68+
napoleon_include_private_with_doc = False # Usually False
69+
napoleon_include_special_with_doc = True
70+
napoleon_use_admonition_for_examples = False
71+
napoleon_use_admonition_for_notes = False
72+
napoleon_use_admonition_for_references = False
73+
# napoleon_use_ivar = False
74+
# napoleon_use_param = True
75+
# napoleon_use_rtype = True
76+
napoleon_preprocess_types = False # Let sphinx-autodoc-typehints handle types
77+
napoleon_type_aliases = None
78+
napoleon_attr_annotations = True
79+
80+
# autodoc
81+
autoclass_content = "class"
82+
autodoc_typehints = "none"
83+
autodoc_default_options = {
84+
"members": True,
85+
"member-order": "bysource",
86+
"undoc-members": True,
87+
"show-inheritance": True,
88+
}
89+
inheritance_alias = {}
90+
91+
# autoapi
92+
autoapi_dirs = ["../../pyfracval"]
93+
autoapi_options = [
94+
"members",
95+
# "undoc-members",
96+
# "private-members",
97+
# "show-inheritance",
98+
# "show-module-summary",
99+
# "special-members", # '__init__' etc.
100+
"imported-members",
101+
]
102+
autoapi_ignore = ["*migrations*", "__init__*"]
103+
autoapi_add_toctree_entry = True
104+
105+
## Use sphinx-autodoc-typehints setup
106+
# Add parameter types from Napoleon processing
107+
always_document_param_types = True
108+
# Show short names for types (e.g. ndarray instead of numpy.ndarray)
109+
typehints_fully_qualified = False
110+
# Process return type hints
111+
typehints_document_rtype = True
112+
# Don't use napoleon rtype processing, let extension handle it
113+
# typehints_use_rtype = False
114+
# Show default values after comma, 'braces' is other option
115+
# typehints_defaults = "comma"
116+
# Optional: Simplify representation of complex types like Union[str, Path]
117+
# typehints_formatter = lambda annotation, config: repr(annotation)
118+
always_use_bars_union = True
119+
120+
## BibTeX Configuration: Tell the extension where your .bib file is:
121+
bibtex_bibfiles = ["references.bib"] # Assumes references.bib is in docs/source/
122+
bibtex_default_style = "unsrt" # Common numeric style, others: plain, alpha
123+
# Optional: Control how citations look, e.g. [(Morán et al. 2019)]
124+
bibtex_reference_style = "author_year"
125+
126+
## Intersphinx Configuration: Set up links to external documentation:
127+
intersphinx_mapping = {
128+
"python": ("https://docs.python.org/3/", None),
129+
"numpy": ("https://numpy.org/doc/stable/", None),
130+
"pytest": ("https://docs.pytest.org/en/stable/", None),
131+
# Add others like scipy, pandas if you use/reference them
132+
}

docs/source/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Welcome to pyfracval's documentation!
2+
3+
<img src="_static/logo.png" alt="PyFracVAL Logo" width="50%">
4+
5+
PyFracVAL generates fractal-like aggregates... (add a brief description)
6+
7+
```{toctree}
8+
:maxdepth: 2
9+
:caption: Contents:
10+
11+
installation
12+
usage
13+
references
14+
```

docs/source/installation.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Installation
2+
3+
This page provides instructions on how to install the `pyfracval` package.
4+
5+
## Prerequisites
6+
7+
- Python 3.10 or higher (check your version with `python --version`).
8+
- `pip` (Python package installer)
9+
10+
## Standard Installation
11+
12+
The recommended way to install `pyfracval` is using `pip` from the Python Package Index (PyPI) (once you publish it there):
13+
14+
```bash
15+
pip install pyfracval
16+
```
17+
18+
This will install the package and its required dependencies (like NumPy, Pydantic, etc.).
19+
20+
## Installation from Source (for Development)
21+
22+
If you want to contribute to the project or install the latest development version directly from the source code (e.g., after cloning from GitHub), follow these steps:
23+
24+
1. **Clone the Repository:**
25+
26+
```bash
27+
git clone https://github.com/your-username/pyfracval.git
28+
cd pyfracval
29+
```
30+
31+
_(Replace with your actual repository URL)_
32+
33+
2. **Create a Virtual Environment (Recommended):**
34+
It's highly recommended to use a virtual environment to manage dependencies:
35+
36+
```bash
37+
# Using venv (built-in)
38+
python -m venv .venv
39+
source .venv/bin/activate # On Linux/macOS
40+
# .\venv\Scripts\activate # On Windows
41+
42+
# Or using conda
43+
# conda create -n pyfracval-env python=3.11 # Or your preferred version
44+
# conda activate pyfracval-env
45+
```
46+
47+
3. **Install in Editable Mode:**
48+
Installing in editable mode (`-e`) links the installed package to your source code, so changes you make are immediately reflected without reinstalling.
49+
```bash
50+
pip install -e .[dev,test,docs]
51+
```
52+
- The `.` refers to the current directory (where `pyproject.toml` is).
53+
- The `[dev,test,docs]` part installs optional dependencies needed for development, running tests, and building documentation (assuming you define these groups in your `pyproject.toml`). Adjust or remove this part as needed. If you don't have groups defined, you might just do `pip install -e .` and install dev tools separately.
54+
55+
## Checking the Installation
56+
57+
You can verify the installation by importing the package in a Python interpreter:
58+
59+
```python
60+
import pyfracval
61+
# Optional: check version if you have defined __version__
62+
# print(pyfracval.__version__)
63+
```
64+
65+
If no errors occur, the installation was successful.

docs/source/references.bib

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@article{Moran2019FracVAL,
2+
author = {J. Morán and A. Fuentes and F. Liu and J. Yon},
3+
title = {{FracVAL: An improved tunable algorithm of cluster-cluster
4+
aggregation for generation of fractal structures formed by
5+
polydisperse primary particles}},
6+
journal = {Computer Physics Communications},
7+
year = {2019},
8+
volume = {239},
9+
pages = {225--237},
10+
doi = {10.1016/j.cpc.2019.01.015},
11+
}
12+
13+
@article{Filippov2000Tunable,
14+
author = {Filippov, A. V. and Zurita, M. and Rosner, D. E.},
15+
title = {{Fractal-like Aggregates: Relation between Morphology and Physical
16+
Properties}},
17+
journal = {Journal of Colloid and Interface Science},
18+
year = {2000},
19+
volume = {229},
20+
number = {1},
21+
pages = {261--273},
22+
doi = {10.1006/jcis.2000.7027},
23+
}

0 commit comments

Comments
 (0)