Skip to content

Commit

Permalink
Fix codecov upload
Browse files Browse the repository at this point in the history
  • Loading branch information
aarmey committed Mar 1, 2024
1 parent 7ae9f29 commit 36f7616
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ jobs:
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
3 changes: 1 addition & 2 deletions lineage/HMM/E_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@ def get_beta(

cIDXs = np.arange(MSD.shape[0])
cIDXs = np.delete(cIDXs, leaves_idx)
cIDXs = np.flip(cIDXs)

for pii in cIDXs:
for pii in reversed(cIDXs):
ch_ii = cell_to_daughters[pii, :]
ratt = (beta[ch_ii, :] / MSD_array[ch_ii, :]) @ T.T
fac1 = np.prod(ratt, axis=0) * ELMSD[pii, :]
Expand Down
2 changes: 1 addition & 1 deletion lineage/HMM/M_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_all_zetas(
TbetaMSD = np.clip(betaMSD @ T.T, np.finfo(float).eps, np.inf)

cIDXs = np.arange(gammas.shape[0])
cIDXs = np.delete(cIDXs, leaves_idx, axis=0)
cIDXs = np.delete(cIDXs, leaves_idx)

dIDXs = cell_to_daughters[cIDXs, :]

Expand Down
4 changes: 2 additions & 2 deletions lineage/import_lineage.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ def assign_observs_MCF10A(cell, lineage, uniq_id: int):
parent_id = lineage["motherID"].unique()

# cell fate: die = 0, divide = 1
if not (
uniq_id in parent_id
if (
uniq_id not in parent_id
): # if the cell has not divided, means either died or reached experiment end time
if (
np.max(lineage.loc[lineage["TID"] == uniq_id]["tmin"]) == t_end
Expand Down
12 changes: 6 additions & 6 deletions lineage/states/StateDistributionGaPhs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class StateDistribution:

def __init__(
self,
bern_p1=0.9,
bern_p2=0.75,
gamma_a1=7.0,
gamma_scale1=3,
gamma_a2=14.0,
gamma_scale2=6,
bern_p1: float = 0.9,
bern_p2: float = 0.75,
gamma_a1: float = 7.0,
gamma_scale1: float = 3.0,
gamma_a2: float = 14.0,
gamma_scale2: float = 6.0,
): # user has to identify what parameters to use for each state
"""Initialization function should take in just in the parameters for the observations that comprise the multivariate random variable emission they expect their data to have."""
self.params = np.array(
Expand Down
4 changes: 3 additions & 1 deletion lineage/states/StateDistributionGamma.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class StateDistribution:
StateDistribution for cells with gamma distributed times.
"""

def __init__(self, bern_p=0.9, gamma_a=7, gamma_scale=4.5):
def __init__(
self, bern_p: float = 0.9, gamma_a: float = 7.0, gamma_scale: float = 4.5
):
"""Initialization function should take in just in the parameters
for the observations that comprise the multivariate random variable emission they expect their data to have.
In this case, we used Gamma distribution for cell lifetime, which has 2 parameters; shape and scale.
Expand Down
12 changes: 6 additions & 6 deletions lineage/states/stateCommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ def gamma_LL(


def gamma_estimator(
gamma_obs: list[np.ndarray],
time_cen: list[np.ndarray],
gammas: list[np.ndarray],
x0: np.ndarray,
gamma_obs: list[arr_type],
time_cen: list[arr_type],
gammas: list[arr_type],
x0: arr_type,
phase: str = "all",
) -> npt.NDArray[np.float64]:
) -> arr_type:
"""
This is a weighted, closed-form estimator for two parameters
of the Gamma distribution for estimating shared shape and separate scale parameters of several drug concentrations at once.
Expand Down Expand Up @@ -100,7 +100,7 @@ def gamma_estimator(
else:
linc = ()

bnd = Bounds(-4.0, 7.0, keep_feasible=True)
bnd = Bounds(-4.0, 7.0, keep_feasible=False)

with np.errstate(all="raise"):
res = minimize(
Expand Down
18 changes: 9 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 36f7616

Please sign in to comment.