Skip to content

Commit 0d2c0fb

Browse files
committed
JOSS Review quick edits
Some quick edits to conform to reviewer feedback for JOSS paper.
1 parent 71e1afc commit 0d2c0fb

10 files changed

Lines changed: 82 additions & 93 deletions

examples/example_1_50x50_to_model.ipynb

Lines changed: 23 additions & 65 deletions
Large diffs are not rendered by default.

examples/example_2_100x100_to_model.ipynb

Lines changed: 19 additions & 15 deletions
Large diffs are not rendered by default.

examples/example_3_model_properties.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"\n",
5252
"path = os.getcwd()\n",
5353
"\n",
54-
"%matplotlib widget\n",
54+
"%matplotlib inline\n",
5555
"%load_ext autoreload\n",
5656
"%autoreload 2"
5757
]

examples/example_4_porespy_analysis.ipynb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616
"Maruti K. Mudunuru"
1717
]
1818
},
19+
{
20+
"cell_type": "code",
21+
"execution_count": null,
22+
"metadata": {},
23+
"outputs": [],
24+
"source": [
25+
"%pip install tqdm # For modules that use tdqm loading bars in notebook environments"
26+
]
27+
},
1928
{
2029
"cell_type": "code",
2130
"execution_count": 1,
@@ -37,7 +46,7 @@
3746
"\n",
3847
"path = os.getcwd()\n",
3948
"\n",
40-
"%matplotlib widget\n",
49+
"%matplotlib inline\n",
4150
"%load_ext autoreload\n",
4251
"%autoreload 2"
4352
]

examples/example_5_vtk_exporting.ipynb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616
"Maruti K. Mudunuru"
1717
]
1818
},
19+
{
20+
"cell_type": "code",
21+
"execution_count": null,
22+
"metadata": {},
23+
"outputs": [],
24+
"source": [
25+
"%pip install tqdm # For modules that use tdqm loading bars in notebook environments"
26+
]
27+
},
1928
{
2029
"cell_type": "code",
2130
"execution_count": 3,
@@ -40,9 +49,10 @@
4049
"\n",
4150
"path = os.getcwd()\n",
4251
"\n",
43-
"%matplotlib widget\n",
52+
"%matplotlib inline\n",
4453
"%load_ext autoreload\n",
45-
"%autoreload 2"
54+
"%autoreload 2\n",
55+
"os.makedirs('example_outputs', exist_ok=True) # Ensures output folder exists"
4656
]
4757
},
4858
{

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ numpy
55
opencv-python
66
openpnm
77
porespy
8-
pypardiso
98
scikit-image
109
scipy
1110
yapf
1211
svglib
13-
reportlab
12+
reportlab==3.6.13
1413
cairosvg
1514
gstools
1615
jaxlib

src/pore2chip/export.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def network2svg(
2121
throat_random_debug=False,
2222
no_throats=False,
2323
middle_pores=None,
24-
disconnected=None
25-
): # Boolean to draw perp. lines for throat placement (debugging)
24+
disconnected=None,
25+
throat_vector_thres=None): # Boolean to draw perp. lines for throat placement (debugging)
2626
r"""
2727
Create an SVG file from an OpenPNM network.
2828
The network2svg function converts an OpenPNM network into an SVG image.
@@ -210,6 +210,18 @@ def network2svg(
210210
pore1_coords = [pore1_x, (-pore1_y) + d2]
211211
pore2_coords = [pore2_x, (-pore2_y) + d2]
212212

213+
# If small throats are vectors
214+
if throat_vector_thres is not None:
215+
if generated_network['throat.diameter'][throat_index] < throat_vector_thres:
216+
design.append(
217+
dr.Line(pore1_coords[0],
218+
pore1_coords[1],
219+
pore2_coords[0],
220+
pore2_coords[1],
221+
stroke='red',
222+
stroke_width=1))
223+
continue
224+
213225
# Distance between the two pores
214226
distance = math.dist(pore1_coords, pore2_coords)
215227

src/pore2chip/filter_im.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def filter_single(image,
2525
thresh (int): Threshold value. If not given, then Otsu's threshold is used
2626
gauss (int): Radius of Gaussian Blur. Default is 5
2727
invert (Boolean): Inverts pixel values of image
28+
returnthres (Boolean): Returns the threshold value calculated using Otsu
2829
2930
Returns:
3031
2D numpy array: Filtered image

tests/test_export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
# Set up the module path (I am in tests folder)
1414
# Modify these lines if the pore2chip package is not in the PYTHONPATH
15-
mod_path = Path("__file__").resolve().parents[2]
15+
mod_path = Path(os.getcwd()).resolve().parent
1616
sys.path.append(os.path.abspath(mod_path))
1717

1818
# Importing specific functions for exporting network data to SVG and DXF formats

tests/test_filter_im.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ def main():
7171
ax[2].imshow(filtered2)
7272
ax[3].imshow(filtered3)
7373
plt.show()
74-
plt.waitforbuttonpress() # Wait for a user interaction before closing
75-
plt.close()
7674

7775
### Advanced Tests ###
7876

@@ -93,8 +91,6 @@ def main():
9391
ax[2].imshow(filtered_stack[1])
9492
ax[3].imshow(filtered_stack[2])
9593
plt.show()
96-
plt.waitforbuttonpress() # Wait for user interaction before closing
97-
plt.close()
9894

9995

10096
if __name__ == "__main__":

0 commit comments

Comments
 (0)