pyafv 0.3.1__tar.gz → 0.3.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyafv
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Python implementation of the active-finite-Voronoi (AFV) model
5
5
  Author-email: "Wei Wang (汪巍)" <ww000721@gmail.com>
6
6
  License: MIT License
@@ -25,9 +25,9 @@ License: MIT License
25
25
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
26
  SOFTWARE.
27
27
 
28
- Project-URL: Download, https://test.pypi.org/project/pyafv/#files
28
+ Project-URL: Download, https://pypi.org/project/pyafv/#files
29
29
  Project-URL: Source Code, https://github.com/wwang721/pyafv
30
- Requires-Python: >=3.11.11
30
+ Requires-Python: >=3.11
31
31
  Description-Content-Type: text/markdown
32
32
  License-File: LICENSE
33
33
  Requires-Dist: numpy>=2.1.3
@@ -39,15 +39,47 @@ Requires-Dist: jupyter>=1.1.0; extra == "examples"
39
39
  Requires-Dist: tqdm>=4.67.1; extra == "examples"
40
40
  Dynamic: license-file
41
41
 
42
- <!--[![Tests](https://github.com/wwang721/pyafv/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/wwang721/pyafv/actions/workflows/tests.yml?query=branch:main)-->
42
+ [![PyPi](https://img.shields.io/pypi/v/pyafv?color=brightgreen)](https://pypi.org/project/pyafv/)
43
+ [![DOI](https://zenodo.org/badge/1124385738.svg)](https://doi.org/10.5281/zenodo.18091659)
44
+ <!--[![pytest](https://github.com/wwang721/pyafv/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/wwang721/pyafv/actions/workflows/tests.yml?query=branch:main)-->
43
45
  [![pytest](https://github.com/wwang721/pyafv/actions/workflows/tests.yml/badge.svg)](https://github.com/wwang721/pyafv/actions/workflows/tests.yml)
44
46
  [![codecov](https://codecov.io/github/wwang721/pyafv/branch/main/graph/badge.svg?token=VSXSOX8HVS)](https://codecov.io/github/wwang721/pyafv/tree/main)
45
- [![DOI](https://zenodo.org/badge/1124385738.svg)](https://doi.org/10.5281/zenodo.18091659)
47
+
46
48
 
47
49
  Python code that implements the **active-finite-Voronoi (AFV) model**.
48
50
  The AFV framework was introduced and developed in, for example, Refs. [[1](#huang2023bridging)&ndash;[3](#wang2026divergence)].
49
51
 
50
52
 
53
+ ## Installation
54
+
55
+ `PyAFV` is now available on [**PyPI**](https://pypi.org/project/pyafv/), so you should be able to install it through `pip`:
56
+ ```bash
57
+ pip install pyafv
58
+ ```
59
+ Python 3.11+ is set as the minimum requirement.
60
+
61
+
62
+ ## Usage
63
+
64
+ <!--Using `uv run python`, you should be able to import `pyafv` from anywhere within the repository directory.-->
65
+ The following example demonstrates how to construct a finite-Voronoi diagram:
66
+ ```python
67
+ import numpy as np
68
+ import pyafv as afv
69
+
70
+ N = 100 # number of cells
71
+ pts = np.random.rand(N, 2) * 10 # initial positions
72
+ params = afv.PhysicalParams() # use default parameter values
73
+ sim = afv.FiniteVoronoiSimulator(pts, params) # initialize the simulator
74
+ sim.plot_2d(show=True) # visualize the Voronoi diagram
75
+ ```
76
+ To compute the conservative forces and extract detailed geometric information (e.g., cell areas, vertices, and edges), call:
77
+ ```python
78
+ diag = sim.build()
79
+ ```
80
+ The returned object `diag` is a Python `dict` containing these quantities.
81
+
82
+
51
83
  ## More information
52
84
 
53
85
  GitHub: [https://github.com/wwang721/pyafv](https://github.com/wwang721/pyafv)
@@ -80,4 +112,3 @@ See important [**issues**](https://github.com/wwang721/pyafv/issues?q=is%3Aissue
80
112
  </td>
81
113
  </tr>
82
114
  </table>
83
-
@@ -1,7 +1,9 @@
1
- <!--[![Tests](https://github.com/wwang721/pyafv/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/wwang721/pyafv/actions/workflows/tests.yml?query=branch:main)-->
1
+ [![PyPi](https://img.shields.io/pypi/v/pyafv?color=brightgreen)](https://pypi.org/project/pyafv/)
2
+ [![DOI](https://zenodo.org/badge/1124385738.svg)](https://doi.org/10.5281/zenodo.18091659)
3
+ <!--[![pytest](https://github.com/wwang721/pyafv/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/wwang721/pyafv/actions/workflows/tests.yml?query=branch:main)-->
2
4
  [![pytest](https://github.com/wwang721/pyafv/actions/workflows/tests.yml/badge.svg)](https://github.com/wwang721/pyafv/actions/workflows/tests.yml)
3
5
  [![codecov](https://codecov.io/github/wwang721/pyafv/branch/main/graph/badge.svg?token=VSXSOX8HVS)](https://codecov.io/github/wwang721/pyafv/tree/main)
4
- [![DOI](https://zenodo.org/badge/1124385738.svg)](https://doi.org/10.5281/zenodo.18091659)
6
+
5
7
 
6
8
  # PyAFV
7
9
 
@@ -11,9 +13,18 @@ The AFV framework was introduced and developed in, for example, Refs. [[1](#huan
11
13
 
12
14
  ## Installation
13
15
 
16
+ `PyAFV` is now available on [**PyPI**](https://pypi.org/project/pyafv/), so you should be able to install it through `pip`:
17
+ ```bash
18
+ pip install pyafv
19
+ ```
20
+ Developed using Python 3.11.11, so Python 3.11+ is set as the minimum requirement. If you just want to use the package, skip directly to the [Usage](#usage) section.
21
+
22
+
23
+ ## Local development
24
+
14
25
  This project uses [`uv`](https://docs.astral.sh/uv/) for Python package management &ndash; a single tool to replace `pip` (⚡️10-100x faster) and `venv`.
15
26
 
16
- > Python 3.11.11 is my local development version, so it is set as the minimum requirement; if you'd like to use your own Python, ensure the `which python` version meets this requirement so `uv` doesn't automatically download a different interpreter; otherwise, I recommend letting `uv` manage everything, including the Python interpreter.
27
+ > If you'd like to use your own Python, ensure the `which python` version meets the requirement (>=3.11) so `uv` doesn't automatically download a different interpreter; otherwise, I recommend letting `uv` manage everything, including the Python interpreter.
17
28
 
18
29
  After cloning the repository, Linux/macOS users (Windows users: see [below](#windows-mingw-gcc)) can synchronize the dependencies with
19
30
  ```bash
@@ -40,7 +51,7 @@ or use `uv sync --no-dev` if you only intend to run the core code without develo
40
51
  <!--With this configuration in place, you even no longer need to pass the `--compiler=mingw32` flag when trying to compile with `uv run python setup.py build_ext --inplace`.-->
41
52
 
42
53
 
43
- ## Running tests
54
+ ### Running tests
44
55
 
45
56
  Current CI status of the test suite, run via [GitHub Actions](/.github/workflows/tests.yml) on Python 3.12, is shown in the badge at the top of this file.
46
57
 
@@ -57,7 +68,7 @@ Current CI status of the test suite, run via [GitHub Actions](/.github/workflows
57
68
 
58
69
  ## Usage
59
70
 
60
- Using `uv run python`, you should be able to import `pyafv` from anywhere within the repository directory.
71
+ <!--Using `uv run python`, you should be able to import `pyafv` from anywhere within the repository directory.-->
61
72
  The following example demonstrates how to construct a finite-Voronoi diagram:
62
73
  ```python
63
74
  import numpy as np
@@ -75,18 +86,24 @@ diag = sim.build()
75
86
  ```
76
87
  The returned object `diag` is a Python `dict` containing these quantities.
77
88
 
78
- #### More example scripts
79
- To run the example scripts in [`examples`](/examples), you need to install at least one additional dependency, `tqdm`, via `uv add tqdm`. Then you can simply run any script in [`examples`](/examples/) with
89
+
90
+ ### Featured examples
91
+ To run the example scripts and notebooks in [`examples`](/examples), you need to install at least one additional dependency `tqdm`.
92
+
93
+ For local development using `uv`: in the project root, run `uv add tqdm`. Then you can simply run any script in [`examples`](/examples/) with
80
94
  ```bash
81
95
  uv run <script_name>.py
82
96
  ```
83
97
  You can also install all optional dependencies (e.g., `tqdm`, `jupyter`) via `uv sync --extra examples` or `uv sync --all-extras`.
84
98
 
85
- * To launch Jupyter Notebook: after `uv` has synced all extra dependencies, start Jupyter with `uv run jupyter notebook`. Do not use your system-level Jupyter, as the Python kernel of the current `uv` environment is not registered there.
99
+ * For developers to launch Jupyter Notebook: after `uv` has synced all extra dependencies, start Jupyter with `uv run jupyter notebook`. Do not use your system-level Jupyter, as the Python kernel of the current `uv` environment is not registered there.
86
100
 
87
101
  > Jupyter notebooks and media are stored via [**Git LFS**](https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-git-large-file-storage). If you clone the repository without **Git LFS** installed, these files will appear as small text pointers. You can either install Git LFS to fetch them automatically or download the files manually (or download the repository as a ZIP archive) from the GitHub web interface.
88
102
 
89
- * Below are representative simulation snapshots generated using the code:
103
+
104
+ ### Simulation previews
105
+
106
+ Below are representative simulation snapshots generated using the code:
90
107
 
91
108
  | Model illustration | Periodic boundary conditions[*](/examples/jupyter/periodic_plotting.ipynb) |
92
109
  |-----------------|-----------------|
@@ -107,7 +124,7 @@ See important [**issues**](https://github.com/wwang721/pyafv/issues?q=is%3Aissue
107
124
 
108
125
  ## Zenodo
109
126
 
110
- The releases of this repository is cross-listed on [Zenodo](https://doi.org/10.5281/zenodo.18091659).
127
+ The releases of this repository are cross-listed on [Zenodo](https://doi.org/10.5281/zenodo.18091659).
111
128
 
112
129
 
113
130
  ## License
@@ -137,4 +154,3 @@ This project is licensed under the [MIT License](/LICENSE), which permits free u
137
154
  </td>
138
155
  </tr>
139
156
  </table>
140
-
@@ -1,12 +1,44 @@
1
- <!--[![Tests](https://github.com/wwang721/pyafv/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/wwang721/pyafv/actions/workflows/tests.yml?query=branch:main)-->
1
+ [![PyPi](https://img.shields.io/pypi/v/pyafv?color=brightgreen)](https://pypi.org/project/pyafv/)
2
+ [![DOI](https://zenodo.org/badge/1124385738.svg)](https://doi.org/10.5281/zenodo.18091659)
3
+ <!--[![pytest](https://github.com/wwang721/pyafv/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/wwang721/pyafv/actions/workflows/tests.yml?query=branch:main)-->
2
4
  [![pytest](https://github.com/wwang721/pyafv/actions/workflows/tests.yml/badge.svg)](https://github.com/wwang721/pyafv/actions/workflows/tests.yml)
3
5
  [![codecov](https://codecov.io/github/wwang721/pyafv/branch/main/graph/badge.svg?token=VSXSOX8HVS)](https://codecov.io/github/wwang721/pyafv/tree/main)
4
- [![DOI](https://zenodo.org/badge/1124385738.svg)](https://doi.org/10.5281/zenodo.18091659)
6
+
5
7
 
6
8
  Python code that implements the **active-finite-Voronoi (AFV) model**.
7
9
  The AFV framework was introduced and developed in, for example, Refs. [[1](#huang2023bridging)&ndash;[3](#wang2026divergence)].
8
10
 
9
11
 
12
+ ## Installation
13
+
14
+ `PyAFV` is now available on [**PyPI**](https://pypi.org/project/pyafv/), so you should be able to install it through `pip`:
15
+ ```bash
16
+ pip install pyafv
17
+ ```
18
+ Python 3.11+ is set as the minimum requirement.
19
+
20
+
21
+ ## Usage
22
+
23
+ <!--Using `uv run python`, you should be able to import `pyafv` from anywhere within the repository directory.-->
24
+ The following example demonstrates how to construct a finite-Voronoi diagram:
25
+ ```python
26
+ import numpy as np
27
+ import pyafv as afv
28
+
29
+ N = 100 # number of cells
30
+ pts = np.random.rand(N, 2) * 10 # initial positions
31
+ params = afv.PhysicalParams() # use default parameter values
32
+ sim = afv.FiniteVoronoiSimulator(pts, params) # initialize the simulator
33
+ sim.plot_2d(show=True) # visualize the Voronoi diagram
34
+ ```
35
+ To compute the conservative forces and extract detailed geometric information (e.g., cell areas, vertices, and edges), call:
36
+ ```python
37
+ diag = sim.build()
38
+ ```
39
+ The returned object `diag` is a Python `dict` containing these quantities.
40
+
41
+
10
42
  ## More information
11
43
 
12
44
  GitHub: [https://github.com/wwang721/pyafv](https://github.com/wwang721/pyafv)
@@ -39,4 +71,3 @@ See important [**issues**](https://github.com/wwang721/pyafv/issues?q=is%3Aissue
39
71
  </td>
40
72
  </tr>
41
73
  </table>
42
-
@@ -1,8 +1,13 @@
1
1
  from .physical_params import PhysicalParams, target_delta
2
2
  from .simulator import FiniteVoronoiSimulator
3
3
 
4
+ from importlib.metadata import version, PackageNotFoundError
4
5
 
5
- __version__ = "0.3.1"
6
+ try:
7
+ __version__ = version("pyafv")
8
+ except PackageNotFoundError:
9
+ # package is not installed
10
+ __version__ = "unknown"
6
11
 
7
12
  __all__ = [
8
13
  "PhysicalParams",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyafv
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Python implementation of the active-finite-Voronoi (AFV) model
5
5
  Author-email: "Wei Wang (汪巍)" <ww000721@gmail.com>
6
6
  License: MIT License
@@ -25,9 +25,9 @@ License: MIT License
25
25
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
26
  SOFTWARE.
27
27
 
28
- Project-URL: Download, https://test.pypi.org/project/pyafv/#files
28
+ Project-URL: Download, https://pypi.org/project/pyafv/#files
29
29
  Project-URL: Source Code, https://github.com/wwang721/pyafv
30
- Requires-Python: >=3.11.11
30
+ Requires-Python: >=3.11
31
31
  Description-Content-Type: text/markdown
32
32
  License-File: LICENSE
33
33
  Requires-Dist: numpy>=2.1.3
@@ -39,15 +39,47 @@ Requires-Dist: jupyter>=1.1.0; extra == "examples"
39
39
  Requires-Dist: tqdm>=4.67.1; extra == "examples"
40
40
  Dynamic: license-file
41
41
 
42
- <!--[![Tests](https://github.com/wwang721/pyafv/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/wwang721/pyafv/actions/workflows/tests.yml?query=branch:main)-->
42
+ [![PyPi](https://img.shields.io/pypi/v/pyafv?color=brightgreen)](https://pypi.org/project/pyafv/)
43
+ [![DOI](https://zenodo.org/badge/1124385738.svg)](https://doi.org/10.5281/zenodo.18091659)
44
+ <!--[![pytest](https://github.com/wwang721/pyafv/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/wwang721/pyafv/actions/workflows/tests.yml?query=branch:main)-->
43
45
  [![pytest](https://github.com/wwang721/pyafv/actions/workflows/tests.yml/badge.svg)](https://github.com/wwang721/pyafv/actions/workflows/tests.yml)
44
46
  [![codecov](https://codecov.io/github/wwang721/pyafv/branch/main/graph/badge.svg?token=VSXSOX8HVS)](https://codecov.io/github/wwang721/pyafv/tree/main)
45
- [![DOI](https://zenodo.org/badge/1124385738.svg)](https://doi.org/10.5281/zenodo.18091659)
47
+
46
48
 
47
49
  Python code that implements the **active-finite-Voronoi (AFV) model**.
48
50
  The AFV framework was introduced and developed in, for example, Refs. [[1](#huang2023bridging)&ndash;[3](#wang2026divergence)].
49
51
 
50
52
 
53
+ ## Installation
54
+
55
+ `PyAFV` is now available on [**PyPI**](https://pypi.org/project/pyafv/), so you should be able to install it through `pip`:
56
+ ```bash
57
+ pip install pyafv
58
+ ```
59
+ Python 3.11+ is set as the minimum requirement.
60
+
61
+
62
+ ## Usage
63
+
64
+ <!--Using `uv run python`, you should be able to import `pyafv` from anywhere within the repository directory.-->
65
+ The following example demonstrates how to construct a finite-Voronoi diagram:
66
+ ```python
67
+ import numpy as np
68
+ import pyafv as afv
69
+
70
+ N = 100 # number of cells
71
+ pts = np.random.rand(N, 2) * 10 # initial positions
72
+ params = afv.PhysicalParams() # use default parameter values
73
+ sim = afv.FiniteVoronoiSimulator(pts, params) # initialize the simulator
74
+ sim.plot_2d(show=True) # visualize the Voronoi diagram
75
+ ```
76
+ To compute the conservative forces and extract detailed geometric information (e.g., cell areas, vertices, and edges), call:
77
+ ```python
78
+ diag = sim.build()
79
+ ```
80
+ The returned object `diag` is a Python `dict` containing these quantities.
81
+
82
+
51
83
  ## More information
52
84
 
53
85
  GitHub: [https://github.com/wwang721/pyafv](https://github.com/wwang721/pyafv)
@@ -80,4 +112,3 @@ See important [**issues**](https://github.com/wwang721/pyafv/issues?q=is%3Aissue
80
112
  </td>
81
113
  </tr>
82
114
  </table>
83
-
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pyafv"
7
- version = "0.3.1"
7
+ version = "0.3.2"
8
8
  description = "Python implementation of the active-finite-Voronoi (AFV) model"
9
9
  readme = "README_PyPI.md"
10
10
  authors = [
11
11
  { name = "Wei Wang (汪巍)", email = "ww000721@gmail.com" }
12
12
  ]
13
13
  license = {file = "LICENSE"}
14
- requires-python = ">=3.11.11"
14
+ requires-python = ">=3.11"
15
15
  dependencies = [
16
16
  "numpy>=2.1.3",
17
17
  "scipy>=1.15.3",
@@ -19,7 +19,7 @@ dependencies = [
19
19
  ]
20
20
 
21
21
  [project.urls]
22
- "Download" = "https://test.pypi.org/project/pyafv/#files"
22
+ "Download" = "https://pypi.org/project/pyafv/#files"
23
23
  "Source Code" = "https://github.com/wwang721/pyafv"
24
24
 
25
25
  [project.optional-dependencies]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes