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

Resolves deprecation error #161

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion ncem/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def plot_degree_vs_dist(
mean_d = [np.mean(degree) for degree in degrees]
print(np.mean(mean_d))
mean_degree += mean_d
distances += [np.int(dist * lateral_resolution)] * len(mean_d)
distances += [int(dist * lateral_resolution)] * len(mean_d)

sns_data = pd.DataFrame(
{
Expand Down
6 changes: 3 additions & 3 deletions ncem/estimators/base_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def get_data(
)
if robustness:
np.random.seed(robustness_seed)
n_images = np.int(len(self.data.img_celldata) * robustness)
n_images = int(len(self.data.img_celldata) * robustness)
print(n_images)
image_keys = list(
np.random.choice(
Expand All @@ -332,10 +332,10 @@ def get_data(
if segmentation_robustness:
node_fraction = segmentation_robustness[0]
overflow_fraction = segmentation_robustness[1]
total_size = np.int(self.data.celldata.shape[0] * node_fraction)
total_size = int(self.data.celldata.shape[0] * node_fraction)

for key, ad in self.data.img_celldata.items():
size = np.int(ad.shape[0] * node_fraction)
size = int(ad.shape[0] * node_fraction)
random_indices = np.random.choice(ad.shape[0], size=size, replace=False)
a = ad.obsp["adjacency_matrix_connectivities"].toarray()
err_ad = ad.copy()
Expand Down
8 changes: 4 additions & 4 deletions ncem/interpretation/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ def _get_np_data(
for k, v in nodes_idx.items():
count = count + len(v)

with tqdm(total=np.int(count / self.n_eval_nodes_per_graph)) as pbar:
with tqdm(total=int(count / self.n_eval_nodes_per_graph)) as pbar:
for _step, (x_batch, y_batch) in enumerate(ds):
target_batch, interaction_batch, sf_batch, node_covar_batch, g_batch = x_batch
target.append(target_batch.numpy().squeeze())
Expand Down Expand Up @@ -919,7 +919,7 @@ def get_sender_receiver_effects(self, params_type: str = "ols", significance_thr
print("calculating inv fim.")
fim_inv = get_fim_inv(x_design, y)

interaction_shape = np.int(self.n_features_0**2)
interaction_shape = int(self.n_features_0**2)
params = params[:, self.n_features_0 : interaction_shape + self.n_features_0]
is_sign, pvalues, qvalues = wald_test(
params=params, fisher_inv=fim_inv, significance_threshold=significance_threshold
Expand Down Expand Up @@ -1902,7 +1902,7 @@ def _get_np_data(
def get_sender_receiver_effects(self, params_type: str = "ols", significance_threshold: float = 0.05):
data = {"target": self.data.celldata.obsm["node_types"], "proportions": self.data.celldata.obsm["proportions"]}
target = np.asarray(dmatrix("target-1", data))
interaction_shape = np.int(self.n_features_0**2)
interaction_shape = int(self.n_features_0**2)
interactions = np.asarray(dmatrix("target:proportions-1", data))

y = self.data.celldata.X
Expand All @@ -1922,7 +1922,7 @@ def get_sender_receiver_effects(self, params_type: str = "ols", significance_thr
is_sign, pvalues, qvalues = wald_test(
params=params, fisher_inv=fim_inv, significance_threshold=significance_threshold
)
interaction_shape = np.int(self.n_features_0**2)
interaction_shape = int(self.n_features_0**2)
# subset to interaction terms
is_sign = is_sign[self.n_features_0 : interaction_shape + self.n_features_0, :]
pvalues = pvalues[self.n_features_0 : interaction_shape + self.n_features_0, :]
Expand Down
Loading