Skip to content
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
1 change: 0 additions & 1 deletion src/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,6 @@ def reinitialization(self,initialization,microbes_pp,output,mode,pulse,*args):
# last: assign microbes to each grid box randomly based on prior densities
choose_taxa = np.zeros((self.n_taxa,self.gridsize), dtype='int8')
for i in range(self.n_taxa):
choose_taxa[i,:] = np.random.binomial(1, frequencies[i], self.gridsize)
freq=np.float64(frequencies.iloc[1]) #working independent of indexing (based on location not index labels)
p_vec = np.array([freq, 1.0 - freq], dtype=np.float64) #solve numoy issues
p_vec = p_vec / p_vec.sum()
Expand Down
8 changes: 4 additions & 4 deletions src/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import numpy as np
import pandas as pd
import pickle
from scipy.stats import distributions
from scipy.stats import uniform, norm # instead of calling the whole distributions package (heavy) we call only the needed objects


def LHS(n,loc,upc,dist):
Expand All @@ -34,9 +34,9 @@ def LHS(n,loc,upc,dist):

scale = upc - loc
if dist == 'uniform':
rv = distributions.uniform(loc=loc, scale=scale)
rv = uniform(loc=loc, scale=scale)
elif dist == 'normal':
rv = distributions.norm(loc=loc, scale=scale)
rv = norm(loc=loc, scale=scale)

lhs = rv.ppf(points)

Expand Down Expand Up @@ -87,4 +87,4 @@ def export(output,site,name):
"""

with open(site + "_" + str(name) + ".pickle", "wb") as f:
pickle.dump(output, f, pickle.HIGHEST_PROTOCOL)
pickle.dump(output, f, pickle.HIGHEST_PROTOCOL)
Loading