Commit 98fd20df authored by Matteo Guardiani's avatar Matteo Guardiani
Browse files

fix warning.

parent be3f8150
......@@ -3,7 +3,7 @@
Test of SARS-CoV-2 viral-load age-causal-dependence via a non-parametric, hierarchical, Bayesian, and causal model. The
following is a Python implementation of the model described in
* Guardiani M. et al., Non-parametric Bayesian Causal Modeling of the SARS-CoV-2 Viral Load Distribution vs. Patient's
* Guardiani et al., Non-parametric Bayesian Causal Modeling of the SARS-CoV-2 Viral Load Distribution vs. Patient's
Age, [preprint](https://arxiv.org/abs/2105.13483) [1].
Please cite [1] when making use of this code.
......@@ -28,9 +28,8 @@ running the script `data.py` which outputs (for the two datasets respectively)
<img src="./plots/data_Cobas_Dataset.png" width="425"/> <img src="./plots/data_LC_480_Dataset.png" width="425"/>
These datasets have been extracted from Drosten et
al. [preprint](https://virologie-ccm.charite.de/fileadmin/user_upload/microsites/m_cc05/virologie-ccm/dateien_upload/Weitere_Dateien/Charite_SARS-CoV-2_viral_load_2020-06-02.pdf) (
Fig. 6).
These datasets have been extracted from Jones et
al. [preprint](https://virologie-ccm.charite.de/fileadmin/user_upload/microsites/m_cc05/virologie-ccm/dateien_upload/Weitere_Dateien/Charite_SARS-CoV-2_viral_load_2020-06-02.pdf) (Fig. 6).
## Run the code
......
......@@ -21,6 +21,7 @@ import string
import nifty8 as ift
import numpy as np
class GeomMaskOperator(ift.LinearOperator):
"""
Copyright @ Jakob Roth
......@@ -56,6 +57,7 @@ class GeomMaskOperator(ift.LinearOperator):
res[self._slices] = x
return ift.Field(self.domain, res)
class DomainBreak2D(ift.LinearOperator):
def __init__(self, domain):
self._domain = ift.DomainTuple.make(domain)
......@@ -131,7 +133,7 @@ class y_averager(ift.LinearOperator):
self._check_input(x, mode)
val = x.val
if self._alpha is not 0:
if self._alpha != 0:
weights = np.power(10, self._rv.val * self._alpha) * self._dV
res = np.sum((val * weights), axis=1)
res = np.power(res, 1. / self._alpha)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment