Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a patch release #2864

Merged
merged 15 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,41 @@

# Overview of OpenPNM

*OpenPNM* is a comprehensive framework for performing pore network simulations of porous materials.
OpenPNM is a comprehensive framework for performing pore network simulations of porous materials.

## More Information

For more details about the package can be found in the [on-line documentation](https://openpnm.org)
For more details about the package can be found in the [online documentation](https://openpnm.org)

## Installation and Requirements

### Preferred method
The preferred way of installing OpenPNM is through [Anaconda Cloud](https://anaconda.org/conda-forge/openpnm) using:
### [pip](https://pypi.org/project/openpnm/)
OpenPNM can be installed using `pip` by running the following command in a terminal:

```
conda install -c conda-forge openpnm
```shell
pip install openpnm
```

### Alternative method
OpenPNM can also be installed from the [Python Package Index](https://pypi.org/project/openpnm/) using:
### [conda-forge](https://anaconda.org/conda-forge/openpnm)
OpenPNM can also be installed from the [conda-forge](https://anaconda.org/conda-forge/openpnm) repository using:

```
pip install openpnm
conda install -c conda-forge openpnm
```

However, we don't recommend installing using `pip` since `pypardiso`, which is a blazing fast direct solver, is not available for Windows users who use Python 3.7+.
> [!WARNING]
> For compatibility with ARM64 architecture, we removed `pypardiso` as a hard dependency. However, we still strongly recommend that non-macOS users (including users of older Macs with an Intel CPU) manually install `pypardiso` via `pip install pypardiso` or `conda install -c conda-forge pypardiso`, otherwise OpenPNM simulations will be very slow.

### For developers
For developers who intend to change the source code or contribute to OpenPNM, the source code can be downloaded from [Github](https://github.com/pmeal/OpenPNM/) and installed by running:
For developers who intend to change the source code or contribute to OpenPNM, the source code can be downloaded from [Github](https://github.com/PMEAL/OpenPNM/) and installed by running:

```
pip install -e 'path/to/downloaded/files'
```

The advantage to installing from the source code is that you can edit the files and have access to your changes each time you import *OpenPNM*.
The advantage to installing from the source code is that you can edit the files and have access to your changes each time you import OpenPNM.

OpenPNM requires the *Scipy Stack* (Numpy, Scipy, Matplotlib, etc), which is most conveniently obtained by installing the [Anaconda Distribution](https://conda.io/docs/user-guide/install/download.html).
OpenPNM requires the Scipy Stack (Numpy, Scipy, Matplotlib, etc), which is most conveniently obtained by installing the [Anaconda Distribution](https://www.anaconda.com/download/).

## Asking Questions and Getting Help

Expand Down
2 changes: 1 addition & 1 deletion openpnm/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.3.0.dev0'
__version__ = '3.3.0.dev5'
2 changes: 1 addition & 1 deletion openpnm/_skgraph/generators/_voronoi_delaunay_dual.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def voronoi_delaunay_dual(
points=points,
shape=shape,
reflect=reflect,
f=1,
f=f,
)

# Generate mask to remove any dims with all 0's
Expand Down
2 changes: 1 addition & 1 deletion openpnm/_skgraph/generators/tools/_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def parse_points(shape, points, reflect=False, f=1):

"""
# Deal with input arguments
shape = np.array(shape, dtype=int)
shape = np.array(shape, dtype=float)
if isinstance(points, int):
points = generate_base_points(num_points=points,
domain_size=shape,
Expand Down
6 changes: 5 additions & 1 deletion openpnm/models/_doctxt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from matplotlib._docstring import Substitution
try:
from matplotlib._docstring import Substitution
except ModuleNotFoundError:
from matplotlib.docstring import Substitution

Check warning on line 4 in openpnm/models/_doctxt.py

View check run for this annotation

Codecov / codecov/patch

openpnm/models/_doctxt.py#L3-L4

Added lines #L3 - L4 were not covered by tests



__all__ = [
Expand Down
5 changes: 4 additions & 1 deletion openpnm/models/geometry/_geodocs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from matplotlib._docstring import Substitution
try:
from matplotlib._docstring import Substitution
except ModuleNotFoundError:
from matplotlib.docstring import Substitution

Check warning on line 4 in openpnm/models/geometry/_geodocs.py

View check run for this annotation

Codecov / codecov/patch

openpnm/models/geometry/_geodocs.py#L3-L4

Added lines #L3 - L4 were not covered by tests


__all__ = [
Expand Down
11 changes: 11 additions & 0 deletions openpnm/models/misc/_neighbor_lookups.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
neighboring throats
'mean' Returns the value of the mean property of the
neighboring throats
'sum' Returns the sum of the property of the neighboring
throats
=========== =====================================================

Returns
Expand Down Expand Up @@ -69,6 +71,11 @@
if ignore_nans:
np.subtract.at(counts, im.row, nans[im.col])
values = values/counts
if mode == 'sum':
if ignore_nans:
data[nans] = 0
values = np.zeros((network.Np, ))
np.add.at(values, im.row, data[im.col])

Check warning on line 78 in openpnm/models/misc/_neighbor_lookups.py

View check run for this annotation

Codecov / codecov/patch

openpnm/models/misc/_neighbor_lookups.py#L75-L78

Added lines #L75 - L78 were not covered by tests
return values


Expand Down Expand Up @@ -98,6 +105,8 @@
neighboring pores
'mean' Returns the value of the mean property of the
neighboring pores
'sum' Returns the sum of the property of the neighrboring
pores
=========== =====================================================

ignore_nans : bool (default is ``True``)
Expand All @@ -122,6 +131,8 @@
value = np.amax(pvalues, axis=1)
if mode == 'mean':
value = np.mean(pvalues, axis=1)
if mode == 'sum':
value = np.sum(pvalues, axis=1)

Check warning on line 135 in openpnm/models/misc/_neighbor_lookups.py

View check run for this annotation

Codecov / codecov/patch

openpnm/models/misc/_neighbor_lookups.py#L135

Added line #L135 was not covered by tests
except np.AxisError: # Handle case of empty pvalues
value = []
return np.array(value)
6 changes: 5 additions & 1 deletion openpnm/models/phase/_phasedocs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from matplotlib._docstring import Substitution
try:
from matplotlib._docstring import Substitution
except ModuleNotFoundError:
from matplotlib.docstring import Substitution

Check warning on line 4 in openpnm/models/phase/_phasedocs.py

View check run for this annotation

Codecov / codecov/patch

openpnm/models/phase/_phasedocs.py#L3-L4

Added lines #L3 - L4 were not covered by tests


__all__ = [
'_phasedocs',
Expand Down
15 changes: 9 additions & 6 deletions openpnm/phase/_phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,16 @@ def __getitem__(self, key):
if element + '.' + prop in self.keys():
vals = super().__getitem__(element + '.' + prop)
else: # If above are not triggered then try to interpolate
if self.settings['auto_interpolate']:
if (element == 'pore') and ('throat.'+prop not in self.keys()):
try:
if self.settings['auto_interpolate']:
if (element == 'pore') and ('throat.'+prop not in self.keys()):
raise KeyError(key)
elif (element == 'throat') and ('pore.'+prop not in self.keys()):
raise KeyError(key)
vals = self.interpolate_data(element + '.' + prop)
else:
raise KeyError(key)
elif (element == 'throat') and ('pore.'+prop not in self.keys()):
raise KeyError(key)
vals = self.interpolate_data(element + '.' + prop)
else:
except AttributeError:
raise KeyError(key)

# Finally get locs
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.3.0.dev0
current_version = 3.3.0.dev5
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.(?P<release>\D+)(?P<build>\d+)?
serialize = {major}.{minor}.{patch}.{release}{build}

Expand Down