Skip to content

Commit 4d936cd

Browse files
authored
readme: fix broken link and add initialize instruction (#431)
Updates the example usage in the README to include initialization of AMReX. This is not strictly required for the example, but avoids the potential for users to follow the example for more complex usage that causes segfaults when AMReX is not initialized (#327). Also fixes a broken link.
1 parent aefc910 commit 4d936cd

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
[![Python3][api-py3]](https://www.python.org/)
44
![Python3 API: Beta][dev-beta]
55
[![Documentation Status](https://readthedocs.org/projects/pyamrex/badge/?version=latest)](https://pyamrex.readthedocs.io)
6-
[![Discussions](https://img.shields.io/badge/chat-discussions-turquoise.svg)](https://github.com/AMReX-Codes/pyamrex/discussions)
6+
[![Discussions](https://img.shields.io/badge/chat-discussions-turquoise.svg)](https://github.com/AMReX-Codes/pyamrex/discussions)
77
![Linux](https://github.com/AMReX-Codes/pyamrex/actions/workflows/ubuntu.yml/badge.svg?branch=development)
88
![macOS](https://github.com/AMReX-Codes/pyamrex/actions/workflows/macos.yml/badge.svg?branch=development)
9-
![Windows](https://github.com/AMReX-Codes/pyamrex/actions/workflows/windows.yml/badge.svg?branch=development)
9+
![Windows](https://github.com/AMReX-Codes/pyamrex/actions/workflows/windows.yml/badge.svg?branch=development)
1010
[![License pyAMReX](https://img.shields.io/badge/license-BSD--3--Clause--LBNL-blue.svg)](https://spdx.org/licenses/BSD-3-Clause-LBNL.html)
1111
[![DOI (source)](https://img.shields.io/badge/DOI%20(source)-10.5281/zenodo.8408733-blue.svg)](https://doi.org/10.5281/zenodo.8408733)
1212

@@ -24,21 +24,27 @@ pyAMReX [can be installed](https://pyamrex.readthedocs.io/en/latest/install/user
2424

2525
### Usage
2626

27-
Please see the [manual](https://pyamrex.readthedocs.io/en/latest/usage/how_to_run.html) and our [test cases](https://github.com/AMReX-Codes/pyamrex/tree/development/tests) for detailed examples.
27+
Please see the [manual](https://pyamrex.readthedocs.io/en/latest/usage/examples.html) and our [test cases](https://github.com/AMReX-Codes/pyamrex/tree/development/tests) for detailed examples.
2828

2929
Use AMReX objects and APIs from Python:
3030
```python
3131
import amrex.space3d as amr
3232

33+
amr.initialize([])
34+
3335
small_end = amr.IntVect()
3436
big_end = amr.IntVect(2, 3, 4)
3537

3638
b = amr.Box(small_end, big_end)
3739
print(b)
3840

3941
# ...
42+
43+
amr.finalize()
4044
```
4145

46+
Note that many AMReX functions may cause a segmentation fault if run without first initializing AMReX (`amr.initialize([])`).
47+
4248
## Developers
4349

4450
If you are new to CMake, [this short tutorial](https://hsf-training.github.io/hsf-training-cmake-webpage/) from the HEP Software foundation is the perfect place to get started with it.
@@ -241,6 +247,6 @@ If you have questions about your rights to use or distribute this software,
241247
please contact Berkeley Lab's Intellectual Property Office at
242248
243249

244-
Please see the full license agreement in [LICENSE](LICENSE).
245-
Please see the notices in [NOTICE](NOTICE).
250+
Please see the full license agreement in [LICENSE](LICENSE).
251+
Please see the notices in [NOTICE](NOTICE).
246252
The SPDX license identifier is `BSD-3-Clause-LBNL`.

0 commit comments

Comments
 (0)