Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rthibaut committed Jul 9, 2024
1 parent 37922a0 commit 8935793
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
8 changes: 2 additions & 6 deletions examples/demo_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def binary_polygon(
"""

# Creates a Polygon abject out of the polygon vertices in pzs
poly = Polygon(pzs, True)
poly = Polygon(pzs, closed=True)
# Checks which points are enclosed by polygon.
ind = np.nonzero(poly.contains_points(xys))[0]
phi = np.ones((nrow, ncol)) * outside # SD - create matrix of 'outside'
Expand Down Expand Up @@ -693,7 +693,7 @@ def plot_results(

if Y is not None:
# WHP - h test + training
fig_dir = jp(base_dir, root)
fig_dir = jp(base_dir, root, "uq")
ff = jp(fig_dir, "whpa.png") # figure name
Y = check_array(Y, allow_nd=True)
try:
Expand All @@ -717,8 +717,6 @@ def plot_results(
labels = ["Training", "Test"]
legend = _proxy_annotate(annotation=[], loc=2, fz=14)
_proxy_legend(legend1=legend, colors=colors, labels=labels, fig_file=ff)
if show:
plt.show()
plt.close()

# WHPs
Expand Down Expand Up @@ -777,8 +775,6 @@ def plot_results(
labels=labels,
fig_file=ff,
)
if show:
plt.show()
plt.close()


Expand Down
6 changes: 0 additions & 6 deletions examples/whpa_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,14 @@ def init_bel():
sub_dir = jp(os.getcwd(), "results")

# Folders
obj_dir = jp(sub_dir, "obj") # Location to save the BEL model
fig_data_dir = jp(sub_dir, "data") # Location to save the raw data figures
fig_pca_dir = jp(sub_dir, "pca") # Location to save the PCA figures
fig_cca_dir = jp(sub_dir, "regression_model") # Location to save the CCA figures
fig_pred_dir = jp(sub_dir, "uq") # Location to save the prediction figures

# Creates directories
[
utils.dirmaker(f, erase=True)
for f in [
obj_dir,
fig_data_dir,
fig_pca_dir,
fig_cca_dir,
fig_pred_dir,
]
]
Expand Down
7 changes: 3 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
scikit-learn
matplotlib
scipy
numpy
joblib
pandas
pandas<2
pytest
scikit-image
seaborn
tensorflow
tensorflow==2.14
loguru
tensorflow_probability
tensorflow_probability==0.22

0 comments on commit 8935793

Please sign in to comment.