after_merge stringlengths 28 79.6k | before_merge stringlengths 20 79.6k | url stringlengths 38 71 | full_traceback stringlengths 43 922k | traceback_type stringclasses 555
values |
|---|---|---|---|---|
def penn_tokenize(self, text, return_str=False):
"""
This is a Python port of the Penn treebank tokenizer adapted by the Moses
machine translation community. It's a little different from the
version in nltk.tokenize.treebank.
"""
# Converts input string into unicode.
text = text_type(text)
... | def penn_tokenize(self, text, return_str=False):
"""
This is a Python port of the Penn treebank tokenizer adapted by the Moses
machine translation community. It's a little different from the
version in nltk.tokenize.treebank.
"""
# Converts input string into unicode.
text = text_type(text)
... | https://github.com/nltk/nltk/issues/1551 | $ python -c 'from nltk.tokenize.moses import MosesTokenizer; m = MosesTokenizer(); m.penn_tokenize("this aint funny")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "nltk/tokenize/moses.py", line 299, in penn_tokenize
text = re.sub(regexp, subsitution, text)
File "/System/Library/Framewor... | sre_constants.error |
def tokenize(self, text, agressive_dash_splits=False, return_str=False):
"""
Python port of the Moses tokenizer.
>>> mtokenizer = MosesTokenizer()
>>> text = u'Is 9.5 or 525,600 my favorite number?'
>>> print (mtokenizer.tokenize(text, return_str=True))
Is 9.5 or 525,600 my favorite number ?
... | def tokenize(self, text, agressive_dash_splits=False, return_str=False):
"""
Python port of the Moses tokenizer.
>>> mtokenizer = MosesTokenizer()
>>> text = u'Is 9.5 or 525,600 my favorite number?'
>>> print (mtokenizer.tokenize(text, return_str=True))
Is 9.5 or 525,600 my favorite number ?
... | https://github.com/nltk/nltk/issues/1551 | $ python -c 'from nltk.tokenize.moses import MosesTokenizer; m = MosesTokenizer(); m.penn_tokenize("this aint funny")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "nltk/tokenize/moses.py", line 299, in penn_tokenize
text = re.sub(regexp, subsitution, text)
File "/System/Library/Framewor... | sre_constants.error |
def unescape_xml(self, text):
for regexp, substitution in self.MOSES_UNESCAPE_XML_REGEXES:
text = re.sub(regexp, substitution, text)
return text
| def unescape_xml(self, text):
for regexp, subsitution in self.MOSES_UNESCAPE_XML_REGEXES:
text = re.sub(regexp, subsitution, text)
return text
| https://github.com/nltk/nltk/issues/1551 | $ python -c 'from nltk.tokenize.moses import MosesTokenizer; m = MosesTokenizer(); m.penn_tokenize("this aint funny")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "nltk/tokenize/moses.py", line 299, in penn_tokenize
text = re.sub(regexp, subsitution, text)
File "/System/Library/Framewor... | sre_constants.error |
def tokenize(self, tokens, return_str=False):
"""
Python port of the Moses detokenizer.
:param tokens: A list of strings, i.e. tokenized text.
:type tokens: list(str)
:return: str
"""
# Convert the list of tokens into a string and pad it with spaces.
text = " {} ".format(" ".join(tokens... | def tokenize(self, tokens, return_str=False):
"""
Python port of the Moses detokenizer.
:param tokens: A list of strings, i.e. tokenized text.
:type tokens: list(str)
:return: str
"""
# Convert the list of tokens into a string and pad it with spaces.
text = " {} ".format(" ".join(tokens... | https://github.com/nltk/nltk/issues/1551 | $ python -c 'from nltk.tokenize.moses import MosesTokenizer; m = MosesTokenizer(); m.penn_tokenize("this aint funny")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "nltk/tokenize/moses.py", line 299, in penn_tokenize
text = re.sub(regexp, subsitution, text)
File "/System/Library/Framewor... | sre_constants.error |
def handles_nonbreaking_prefixes(self, text):
# Splits the text into tokens to check for nonbreaking prefixes.
tokens = text.split()
num_tokens = len(tokens)
for i, token in enumerate(tokens):
# Checks if token ends with a fullstop.
token_ends_with_period = re.search(r"^(\S+)\.$", text)
... | def handles_nonbreaking_prefixes(self, text):
# Splits the text into tokens to check for nonbreaking prefixes.
tokens = text.split()
num_tokens = len(tokens)
for i, token in enumerate(tokens):
# Checks if token ends with a fullstop.
token_ends_with_period = re.match(r"^(\S+)\.$", text)
... | https://github.com/nltk/nltk/issues/1551 | $ python -c 'from nltk.tokenize.moses import MosesTokenizer; m = MosesTokenizer(); m.penn_tokenize("this aint funny")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "nltk/tokenize/moses.py", line 299, in penn_tokenize
text = re.sub(regexp, subsitution, text)
File "/System/Library/Framewor... | sre_constants.error |
def tokenize(self, tokens, return_str=False):
"""
Python port of the Moses detokenizer.
:param tokens: A list of strings, i.e. tokenized text.
:type tokens: list(str)
:return: str
"""
# Convert the list of tokens into a string and pad it with spaces.
text = " {} ".format(" ".join(tokens... | def tokenize(self, tokens, return_str=False):
"""
Python port of the Moses detokenizer.
:param tokens: A list of strings, i.e. tokenized text.
:type tokens: list(str)
:return: str
"""
# Convert the list of tokens into a string and pad it with spaces.
text = " {} ".format(" ".join(tokens... | https://github.com/nltk/nltk/issues/1551 | $ python -c 'from nltk.tokenize.moses import MosesTokenizer; m = MosesTokenizer(); m.penn_tokenize("this aint funny")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "nltk/tokenize/moses.py", line 299, in penn_tokenize
text = re.sub(regexp, subsitution, text)
File "/System/Library/Framewor... | sre_constants.error |
def _update_index(self, url=None):
"""A helper function that ensures that self._index is
up-to-date. If the index is older than self.INDEX_TIMEOUT,
then download it again."""
# Check if the index is aleady up-to-date. If so, do nothing.
if not (
self._index is None
or url is not No... | def _update_index(self, url=None):
"""A helper function that ensures that self._index is
up-to-date. If the index is older than self.INDEX_TIMEOUT,
then download it again."""
# Check if the index is aleady up-to-date. If so, do nothing.
if not (
self._index is None
or url is not No... | https://github.com/nltk/nltk/issues/882 | $ sudo python -m nltk.downloader
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/runpy.py", line 85, in _ru... | AttributeError |
def getattr_value(self, val):
if isinstance(val, string_types):
val = getattr(self, val)
if isinstance(val, tt.TensorVariable):
return val.tag.test_value
if isinstance(val, tt.sharedvar.SharedVariable):
return val.get_value()
if isinstance(val, theano_constant):
return... | def getattr_value(self, val):
if isinstance(val, string_types):
val = getattr(self, val)
if isinstance(val, tt.TensorVariable):
return val.tag.test_value
if isinstance(val, tt.sharedvar.TensorSharedVariable):
return val.get_value()
if isinstance(val, theano_constant):
... | https://github.com/pymc-devs/pymc3/issues/3139 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-6-6131815c61f7> in <module>()
4 a = pm.Lognormal('a',mu=product_mu_shared, sd=product_sd)
5 b = pm.Normal('b',mu=0.0, sd=product_sd)
----> 6 ... | TypeError |
def sample(
draws=1000,
step=None,
init="auto",
n_init=200000,
start=None,
trace=None,
chain_idx=0,
chains=None,
cores=None,
tune=1000,
progressbar=True,
model=None,
random_seed=None,
discard_tuned_samples=True,
compute_convergence_checks=True,
callback=No... | def sample(
draws=1000,
step=None,
init="auto",
n_init=200000,
start=None,
trace=None,
chain_idx=0,
chains=None,
cores=None,
tune=1000,
progressbar=True,
model=None,
random_seed=None,
discard_tuned_samples=True,
compute_convergence_checks=True,
callback=No... | https://github.com/pymc-devs/pymc3/issues/4276 | WARNING: autodoc: failed to import function 't_stick_breaking' from module 'pymc3.distributions.transforms'; the following exception was raised:
Traceback (most recent call last):
File "/Users/rpg/.virtualenvs/pymc3/lib/python3.7/site-packages/sphinx/util/inspect.py", line 334, in safe_getattr
return getattr(obj, name,... | AttributeError |
def init_nuts(
init="auto",
chains=1,
n_init=500000,
model=None,
random_seed=None,
progressbar=True,
**kwargs,
):
"""Set up the mass matrix initialization for NUTS.
NUTS convergence and sampling speed is extremely dependent on the
choice of mass/scaling matrix. This function imp... | def init_nuts(
init="auto",
chains=1,
n_init=500000,
model=None,
random_seed=None,
progressbar=True,
**kwargs,
):
"""Set up the mass matrix initialization for NUTS.
NUTS convergence and sampling speed is extremely dependent on the
choice of mass/scaling matrix. This function imp... | https://github.com/pymc-devs/pymc3/issues/4276 | WARNING: autodoc: failed to import function 't_stick_breaking' from module 'pymc3.distributions.transforms'; the following exception was raised:
Traceback (most recent call last):
File "/Users/rpg/.virtualenvs/pymc3/lib/python3.7/site-packages/sphinx/util/inspect.py", line 334, in safe_getattr
return getattr(obj, name,... | AttributeError |
def __str__(self, **kwargs):
try:
return self._str_repr(formatting="plain", **kwargs)
except:
return super().__str__()
| def __str__(self, **kwargs):
return self._str_repr(formatting="plain", **kwargs)
| https://github.com/pymc-devs/pymc3/issues/4240 | vals
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sayam/.local/lib/python3.8/site-packages/theano/gof/graph.py", line 449, in __repr__
to_print = [str(self)]
File "/home/sayam/Desktop/pymc/pymc3/pymc3/model.py", line 83, in __str__
return self._str_repr(formatting="plain", **kwargs... | AttributeError |
def _distr_parameters_for_repr(self):
return ["mu"]
| def _distr_parameters_for_repr(self):
return ["a"]
| https://github.com/pymc-devs/pymc3/issues/4240 | vals
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sayam/.local/lib/python3.8/site-packages/theano/gof/graph.py", line 449, in __repr__
to_print = [str(self)]
File "/home/sayam/Desktop/pymc/pymc3/pymc3/model.py", line 83, in __str__
return self._str_repr(formatting="plain", **kwargs... | AttributeError |
def __init__(self, w, comp_dists, *args, **kwargs):
# comp_dists type checking
if not (
isinstance(comp_dists, Distribution)
or (
isinstance(comp_dists, Iterable)
and all((isinstance(c, Distribution) for c in comp_dists))
)
):
raise TypeError(
... | def __init__(self, w, comp_dists, *args, **kwargs):
# comp_dists type checking
if not (
isinstance(comp_dists, Distribution)
or (
isinstance(comp_dists, Iterable)
and all((isinstance(c, Distribution) for c in comp_dists))
)
):
raise TypeError(
... | https://github.com/pymc-devs/pymc3/issues/3994 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~/.local/lib/python3.8/site-packages/pymc3/distributions/mixture.py in _comp_modes(self)
289 try:
--> 290 return tt.as_tensor_variable(self.comp_dis... | AttributeError |
def logp(self, value):
"""
Calculate log-probability of defined Mixture distribution at specified value.
Parameters
----------
value: numeric
Value(s) for which log-probability is calculated. If the log probabilities for multiple
values are desired the values must be provided in a n... | def logp(self, value):
"""
Calculate log-probability of defined Mixture distribution at specified value.
Parameters
----------
value: numeric
Value(s) for which log-probability is calculated. If the log probabilities for multiple
values are desired the values must be provided in a n... | https://github.com/pymc-devs/pymc3/issues/3994 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~/.local/lib/python3.8/site-packages/pymc3/distributions/mixture.py in _comp_modes(self)
289 try:
--> 290 return tt.as_tensor_variable(self.comp_dis... | AttributeError |
def logsumexp(x, axis=None, keepdims=True):
# Adapted from https://github.com/Theano/Theano/issues/1563
x_max = tt.max(x, axis=axis, keepdims=True)
res = tt.log(tt.sum(tt.exp(x - x_max), axis=axis, keepdims=True)) + x_max
return res if keepdims else res.squeeze()
| def logsumexp(x, axis=None):
# Adapted from https://github.com/Theano/Theano/issues/1563
x_max = tt.max(x, axis=axis, keepdims=True)
return tt.log(tt.sum(tt.exp(x - x_max), axis=axis, keepdims=True)) + x_max
| https://github.com/pymc-devs/pymc3/issues/3994 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~/.local/lib/python3.8/site-packages/pymc3/distributions/mixture.py in _comp_modes(self)
289 try:
--> 290 return tt.as_tensor_variable(self.comp_dis... | AttributeError |
def pandas_to_array(data):
if hasattr(data, "values"): # pandas
if data.isnull().any().any(): # missing values
ret = np.ma.MaskedArray(data.values, data.isnull().values)
else:
ret = data.values
elif hasattr(data, "mask"):
if data.mask.any():
ret = da... | def pandas_to_array(data):
if hasattr(data, "values"): # pandas
if data.isnull().any().any(): # missing values
ret = np.ma.MaskedArray(data.values, data.isnull().values)
else:
ret = data.values
elif hasattr(data, "mask"):
ret = data
elif isinstance(data, the... | https://github.com/pymc-devs/pymc3/issues/3576 | /usr/local/lib/python3.6/dist-packages/pymc3/model.py:1331: UserWarning: Data in X_t contains missing values and will be automatically imputed from the sampling distribution.
warnings.warn(impute_message, UserWarning)
Auto-assigning NUTS sampler...
Initializing NUTS using adapt_diag...
Multiprocess sampling (2 chains i... | ValueError |
def random(self, point=None, size=None):
"""
Draw random values from TruncatedNormal distribution.
Parameters
----------
point : dict, optional
Dict of variable values on which random values are to be
conditioned (uses default point if not specified).
size : int, optional
... | def random(self, point=None, size=None):
"""
Draw random values from TruncatedNormal distribution.
Parameters
----------
point : dict, optional
Dict of variable values on which random values are to be
conditioned (uses default point if not specified).
size : int, optional
... | https://github.com/pymc-devs/pymc3/issues/3481 | ValueError Traceback (most recent call last)
~/projects/xplan/xplan-experiment-analysis/sample_prior_predictive_error.py in <module>
8
9 with model:
---> 10 pre_trace = pm.sample_prior_predictive()
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/... | ValueError |
def random(self, point=None, size=None):
"""
Draw random values from Triangular distribution.
Parameters
----------
point : dict, optional
Dict of variable values on which random values are to be
conditioned (uses default point if not specified).
size : int, optional
Des... | def random(self, point=None, size=None):
"""
Draw random values from Triangular distribution.
Parameters
----------
point : dict, optional
Dict of variable values on which random values are to be
conditioned (uses default point if not specified).
size : int, optional
Des... | https://github.com/pymc-devs/pymc3/issues/3481 | ValueError Traceback (most recent call last)
~/projects/xplan/xplan-experiment-analysis/sample_prior_predictive_error.py in <module>
8
9 with model:
---> 10 pre_trace = pm.sample_prior_predictive()
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/... | ValueError |
def random(self, point=None, size=None):
"""
Draw random values from Rice distribution.
Parameters
----------
point : dict, optional
Dict of variable values on which random values are to be
conditioned (uses default point if not specified).
size : int, optional
Desired s... | def random(self, point=None, size=None):
"""
Draw random values from Rice distribution.
Parameters
----------
point : dict, optional
Dict of variable values on which random values are to be
conditioned (uses default point if not specified).
size : int, optional
Desired s... | https://github.com/pymc-devs/pymc3/issues/3481 | ValueError Traceback (most recent call last)
~/projects/xplan/xplan-experiment-analysis/sample_prior_predictive_error.py in <module>
8
9 with model:
---> 10 pre_trace = pm.sample_prior_predictive()
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/... | ValueError |
def random(self, point=None, size=None):
"""
Draw random values from ZeroInflatedNegativeBinomial distribution.
Parameters
----------
point : dict, optional
Dict of variable values on which random values are to be
conditioned (uses default point if not specified).
size : int, op... | def random(self, point=None, size=None):
"""
Draw random values from ZeroInflatedNegativeBinomial distribution.
Parameters
----------
point : dict, optional
Dict of variable values on which random values are to be
conditioned (uses default point if not specified).
size : int, op... | https://github.com/pymc-devs/pymc3/issues/3481 | ValueError Traceback (most recent call last)
~/projects/xplan/xplan-experiment-analysis/sample_prior_predictive_error.py in <module>
8
9 with model:
---> 10 pre_trace = pm.sample_prior_predictive()
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/... | ValueError |
def _repr_cov_params(self, dist=None):
if dist is None:
dist = self
if self._cov_type == "chol":
chol = get_variable_name(self.chol_cov)
return r"\mathit{{chol}}={}".format(chol)
elif self._cov_type == "cov":
cov = get_variable_name(self.cov)
return r"\mathit{{cov}}={... | def _repr_cov_params(self, dist=None):
if dist is None:
dist = self
if self._cov_type == "chol":
chol = get_variable_name(self.chol)
return r"\mathit{{chol}}={}".format(chol)
elif self._cov_type == "cov":
cov = get_variable_name(self.cov)
return r"\mathit{{cov}}={}".f... | https://github.com/pymc-devs/pymc3/issues/3450 | Traceback (most recent call last):
File "fail.py", line 9, in <module>
print(d.distribution._repr_latex_())
File "/nix/store/4c6ihiawh232fszikcyxhdk32rzk4l28-python3-3.7.2-env/lib/python3.7/site-packages/pymc3/distributions/multivariate.py", line 286, in _repr_latex_
.format(name, name_mu, self._repr_cov_params(dist)))... | AttributeError |
def __init__(
self,
mu=0,
sigma=None,
tau=None,
lower=None,
upper=None,
transform="auto",
sd=None,
*args,
**kwargs,
):
if sd is not None:
sigma = sd
tau, sigma = get_tau_sigma(tau=tau, sigma=sigma)
self.sigma = self.sd = tt.as_tensor_variable(sigma)
self.t... | def __init__(
self,
mu=0,
sigma=None,
tau=None,
lower=None,
upper=None,
transform="auto",
sd=None,
*args,
**kwargs,
):
if sd is not None:
sigma = sd
tau, sigma = get_tau_sigma(tau=tau, sigma=sigma)
self.sigma = self.sd = tt.as_tensor_variable(sigma)
self.t... | https://github.com/pymc-devs/pymc3/issues/3248 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Applications/anaconda3/envs/Fit2/lib/python3.6/site-packages/pymc3/distributions/continuous.py", line 578, in random
[self.mu, self.sd, self.lower, self.upper], point=point, size=size)
File "/Applications/anaconda3/envs/Fit2/lib/python3.6/sit... | ValueError |
def logp(self, value):
"""
Calculate log-probability of TruncatedNormal distribution at specified value.
Parameters
----------
value : numeric
Value(s) for which log-probability is calculated. If the log probabilities for multiple
values are desired the values must be provided in a ... | def logp(self, value):
"""
Calculate log-probability of TruncatedNormal distribution at specified value.
Parameters
----------
value : numeric
Value(s) for which log-probability is calculated. If the log probabilities for multiple
values are desired the values must be provided in a ... | https://github.com/pymc-devs/pymc3/issues/3248 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Applications/anaconda3/envs/Fit2/lib/python3.6/site-packages/pymc3/distributions/continuous.py", line 578, in random
[self.mu, self.sd, self.lower, self.upper], point=point, size=size)
File "/Applications/anaconda3/envs/Fit2/lib/python3.6/sit... | ValueError |
def _normalization(self):
mu, sigma = self.mu, self.sigma
if self.lower_check is None and self.upper_check is None:
return 0.0
if self.lower_check is not None and self.upper_check is not None:
lcdf_a = normal_lcdf(mu, sigma, self.lower)
lcdf_b = normal_lcdf(mu, sigma, self.upper)
... | def _normalization(self):
mu, sigma = self.mu, self.sigma
if self.lower is None and self.upper is None:
return 0.0
if self.lower is not None and self.upper is not None:
lcdf_a = normal_lcdf(mu, sigma, self.lower)
lcdf_b = normal_lcdf(mu, sigma, self.upper)
lsf_a = normal_lc... | https://github.com/pymc-devs/pymc3/issues/3248 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Applications/anaconda3/envs/Fit2/lib/python3.6/site-packages/pymc3/distributions/continuous.py", line 578, in random
[self.mu, self.sd, self.lower, self.upper], point=point, size=size)
File "/Applications/anaconda3/envs/Fit2/lib/python3.6/sit... | ValueError |
def __new__(cls, *args, **kwargs):
# resolves the parent instance
instance = super().__new__(cls)
if cls.get_contexts():
potential_parent = cls.get_contexts()[-1]
# We have to make sure that the context is a _DrawValuesContext
# and not a Model
if isinstance(potential_parent,... | def __new__(cls, *args, **kwargs):
# resolves the parent instance
instance = super().__new__(cls)
if cls.get_contexts():
potential_parent = cls.get_contexts()[-1]
# We have to make sure that the context is a _DrawValuesContext
# and not a Model
if isinstance(potential_parent,... | https://github.com/pymc-devs/pymc3/issues/3246 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-7300cc3c60ce> in <module>()
8
9 with model:
---> 10 pm.sample_prior_predictive(50)
11
~/anaconda3/lib/python3.6/site-packages/pymc3-3.5-py3.6.egg/... | ValueError |
def __init__(self):
if self.parent is not None:
# All _DrawValuesContext instances that are in the context of
# another _DrawValuesContext will share the reference to the
# drawn_vars dictionary. This means that separate branches
# in the nested _DrawValuesContext context tree will s... | def __init__(self):
if self.parent is not None:
# All _DrawValuesContext instances that are in the context of
# another _DrawValuesContext will share the reference to the
# drawn_vars dictionary. This means that separate branches
# in the nested _DrawValuesContext context tree will s... | https://github.com/pymc-devs/pymc3/issues/3246 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-7300cc3c60ce> in <module>()
8
9 with model:
---> 10 pm.sample_prior_predictive(50)
11
~/anaconda3/lib/python3.6/site-packages/pymc3-3.5-py3.6.egg/... | ValueError |
def draw_values(params, point=None, size=None):
"""
Draw (fix) parameter values. Handles a number of cases:
1) The parameter is a scalar
2) The parameter is an *RV
a) parameter can be fixed to the value in the point
b) parameter can be fixed by sampling from the *RV
... | def draw_values(params, point=None, size=None):
"""
Draw (fix) parameter values. Handles a number of cases:
1) The parameter is a scalar
2) The parameter is an *RV
a) parameter can be fixed to the value in the point
b) parameter can be fixed by sampling from the *RV
... | https://github.com/pymc-devs/pymc3/issues/3246 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-7300cc3c60ce> in <module>()
8
9 with model:
---> 10 pm.sample_prior_predictive(50)
11
~/anaconda3/lib/python3.6/site-packages/pymc3-3.5-py3.6.egg/... | ValueError |
def _draw_value(param, point=None, givens=None, size=None):
"""Draw a random value from a distribution or return a constant.
Parameters
----------
param : number, array like, theano variable or pymc3 random variable
The value or distribution. Constants or shared variables
will be conver... | def _draw_value(param, point=None, givens=None, size=None):
"""Draw a random value from a distribution or return a constant.
Parameters
----------
param : number, array like, theano variable or pymc3 random variable
The value or distribution. Constants or shared variables
will be conver... | https://github.com/pymc-devs/pymc3/issues/3246 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-7300cc3c60ce> in <module>()
8
9 with model:
---> 10 pm.sample_prior_predictive(50)
11
~/anaconda3/lib/python3.6/site-packages/pymc3-3.5-py3.6.egg/... | ValueError |
def to_tuple(shape):
"""Convert ints, arrays, and Nones to tuples"""
if shape is None:
return tuple()
temp = np.atleast_1d(shape)
if temp.size == 0:
return tuple()
else:
return tuple(temp)
| def to_tuple(shape):
"""Convert ints, arrays, and Nones to tuples"""
if shape is None:
return tuple()
return tuple(np.atleast_1d(shape))
| https://github.com/pymc-devs/pymc3/issues/3246 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-7300cc3c60ce> in <module>()
8
9 with model:
---> 10 pm.sample_prior_predictive(50)
11
~/anaconda3/lib/python3.6/site-packages/pymc3-3.5-py3.6.egg/... | ValueError |
def _comp_samples(self, point=None, size=None):
if self._comp_dists_vect or size is None:
try:
return self.comp_dists.random(point=point, size=size)
except AttributeError:
samples = np.array(
[
comp_dist.random(point=point, size=size)
... | def _comp_samples(self, point=None, size=None):
try:
samples = self.comp_dists.random(point=point, size=size)
except AttributeError:
samples = np.column_stack(
[comp_dist.random(point=point, size=size) for comp_dist in self.comp_dists]
)
return np.squeeze(samples)
| https://github.com/pymc-devs/pymc3/issues/3246 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-7300cc3c60ce> in <module>()
8
9 with model:
---> 10 pm.sample_prior_predictive(50)
11
~/anaconda3/lib/python3.6/site-packages/pymc3-3.5-py3.6.egg/... | ValueError |
def random(self, point=None, size=None):
# Convert size to tuple
size = to_tuple(size)
# Draw mixture weights and a sample from each mixture to infer shape
with _DrawValuesContext() as draw_context:
# We first need to check w and comp_tmp shapes and re compute size
w = draw_values([self.... | def random(self, point=None, size=None):
with _DrawValuesContext() as draw_context:
w = draw_values([self.w], point=point)[0]
comp_tmp = self._comp_samples(point=point, size=None)
if np.asarray(self.shape).size == 0:
distshape = np.asarray(np.broadcast(w, comp_tmp).shape)[..., :-1]
e... | https://github.com/pymc-devs/pymc3/issues/3246 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-7300cc3c60ce> in <module>()
8
9 with model:
---> 10 pm.sample_prior_predictive(50)
11
~/anaconda3/lib/python3.6/site-packages/pymc3-3.5-py3.6.egg/... | ValueError |
def random(self, point=None, size=None):
if size is None:
size = tuple()
else:
if not isinstance(size, tuple):
try:
size = tuple(size)
except TypeError:
size = (size,)
if self._cov_type == "cov":
mu, cov = draw_values([self.mu,... | def random(self, point=None, size=None):
if size is None:
size = []
else:
try:
size = list(size)
except TypeError:
size = [size]
if self._cov_type == "cov":
mu, cov = draw_values([self.mu, self.cov], point=point, size=size)
if mu.shape[-1] != ... | https://github.com/pymc-devs/pymc3/issues/3246 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-7300cc3c60ce> in <module>()
8
9 with model:
---> 10 pm.sample_prior_predictive(50)
11
~/anaconda3/lib/python3.6/site-packages/pymc3-3.5-py3.6.egg/... | ValueError |
def __init__(self, eta, n, sd_dist, *args, **kwargs):
self.n = n
self.eta = eta
if "transform" in kwargs and kwargs["transform"] is not None:
raise ValueError("Invalid parameter: transform.")
if "shape" in kwargs:
raise ValueError("Invalid parameter: shape.")
shape = n * (n + 1) //... | def __init__(self, eta, n, sd_dist, *args, **kwargs):
self.n = n
self.eta = eta
if "transform" in kwargs:
raise ValueError("Invalid parameter: transform.")
if "shape" in kwargs:
raise ValueError("Invalid parameter: shape.")
shape = n * (n + 1) // 2
if sd_dist.shape.ndim not in... | https://github.com/pymc-devs/pymc3/issues/3246 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-7300cc3c60ce> in <module>()
8
9 with model:
---> 10 pm.sample_prior_predictive(50)
11
~/anaconda3/lib/python3.6/site-packages/pymc3-3.5-py3.6.egg/... | ValueError |
def forward_val(self, y, point=None):
y[..., self.diag_idxs] = np.log(y[..., self.diag_idxs])
return y
| def forward_val(self, y, point=None):
y[self.diag_idxs] = np.log(y[self.diag_idxs])
return y
| https://github.com/pymc-devs/pymc3/issues/3246 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-7300cc3c60ce> in <module>()
8
9 with model:
---> 10 pm.sample_prior_predictive(50)
11
~/anaconda3/lib/python3.6/site-packages/pymc3-3.5-py3.6.egg/... | ValueError |
def _get_named_nodes_and_relations(
graph, parent, leaf_nodes, node_parents, node_children
):
if getattr(graph, "owner", None) is None: # Leaf node
if graph.name is not None: # Named leaf node
leaf_nodes.update({graph.name: graph})
if parent is not None: # Is None for the root... | def _get_named_nodes_and_relations(
graph, parent, leaf_nodes, node_parents, node_children
):
if getattr(graph, "owner", None) is None: # Leaf node
if graph.name is not None: # Named leaf node
leaf_nodes.update({graph.name: graph})
if parent is not None: # Is None for the root... | https://github.com/pymc-devs/pymc3/issues/3246 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-7300cc3c60ce> in <module>()
8
9 with model:
---> 10 pm.sample_prior_predictive(50)
11
~/anaconda3/lib/python3.6/site-packages/pymc3-3.5-py3.6.egg/... | ValueError |
def _random(self, n, p, size=None):
original_dtype = p.dtype
# Set float type to float64 for numpy. This change is related to numpy issue #8317 (https://github.com/numpy/numpy/issues/8317)
p = p.astype("float64")
# Now, re-normalize all of the values in float64 precision. This is done inside the conditi... | def _random(self, n, p, size=None):
original_dtype = p.dtype
# Set float type to float64 for numpy. This change is related to numpy issue #8317 (https://github.com/numpy/numpy/issues/8317)
p = p.astype("float64")
# Now, re-normalize all of the values in float64 precision. This is done inside the conditi... | https://github.com/pymc-devs/pymc3/issues/3271 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-10-06599b7f288c> in <module>()
----> 1 sim_priors = pm.sample_prior_predictive(samples=1000, model=dm_model, random_seed=RANDOM_SEED)
/anaconda/envs/cdf... | TypeError |
def __call__(self, name, *args, **kwargs):
if "observed" in kwargs:
raise ValueError(
"Observed Bound distributions are not supported. "
"If you want to model truncated data "
"you can use a pm.Potential in combination "
"with the cumulative probability functi... | def __call__(self, *args, **kwargs):
if "observed" in kwargs:
raise ValueError(
"Observed Bound distributions are not supported. "
"If you want to model truncated data "
"you can use a pm.Potential in combination "
"with the cumulative probability function. Se... | https://github.com/pymc-devs/pymc3/issues/3149 | ---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-18-c9645cb7d458> in <module>()
3 with example:
4 BoundPoisson = pm.Bound(pm.Poisson, upper = 6)
----> 5 y = BoundPoisson(name = "y", mu = 1)
~/m... | IndexError |
def _run_convergence_checks(self, trace, model):
if trace.nchains == 1:
msg = (
"Only one chain was sampled, this makes it impossible to "
"run some convergence checks"
)
warn = SamplerWarning(WarningType.BAD_PARAMS, msg, "info", None, None, None)
self._add_wa... | def _run_convergence_checks(self, trace, model):
if trace.nchains == 1:
msg = (
"Only one chain was sampled, this makes it impossible to "
"run some convergence checks"
)
warn = SamplerWarning(WarningType.BAD_PARAMS, msg, "info", None, None, None)
self._add_wa... | https://github.com/pymc-devs/pymc3/issues/2933 | ---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-7-45e332f1b8ef> in <module>()
1 with model:
----> 2 trace = sample(1000, trace=[dL0])
~/Repos/pymc3/pymc3/sampling.py in sample(draws, step, init, n... | KeyError |
def __init__(self, distribution, lower, upper, transform="infer", *args, **kwargs):
self.dist = distribution.dist(*args, **kwargs)
self.__dict__.update(self.dist.__dict__)
self.__dict__.update(locals())
if hasattr(self.dist, "mode"):
self.mode = self.dist.mode
if transform == "infer":
... | def __init__(self, distribution, lower, upper, transform="infer", *args, **kwargs):
self.dist = distribution.dist(*args, **kwargs)
self.__dict__.update(self.dist.__dict__)
self.__dict__.update(locals())
if hasattr(self.dist, "mode"):
self.mode = self.dist.mode
if transform == "infer":
... | https://github.com/pymc-devs/pymc3/issues/1491 | Traceback (most recent call last):
File "garch_example.py", line 40, in <module>
beta1 = BoundedNormal('beta1', 0, sd=1e6)
File "/Users/**/anaconda3/envs/py35/lib/python3.5/site-packages/pymc3/distributions/continuous.py", line 1102, in __call__
*args, **kwargs)
File "/Users/**/anaconda3/envs/py35/lib/python3.5/site-pa... | AttributeError |
def __init__(self, *args, **kwargs):
first, args = args[0], args[1:]
super(self, _BoundedDist).__init__(
first, distribution, lower, upper, *args, **kwargs
)
| def __init__(self, distribution, lower=-np.inf, upper=np.inf):
self.distribution = distribution
self.lower = lower
self.upper = upper
| https://github.com/pymc-devs/pymc3/issues/1491 | Traceback (most recent call last):
File "garch_example.py", line 40, in <module>
beta1 = BoundedNormal('beta1', 0, sd=1e6)
File "/Users/**/anaconda3/envs/py35/lib/python3.5/site-packages/pymc3/distributions/continuous.py", line 1102, in __call__
*args, **kwargs)
File "/Users/**/anaconda3/envs/py35/lib/python3.5/site-pa... | AttributeError |
def dist(cls, *args, **kwargs):
return Bounded.dist(distribution, lower, upper, *args, **kwargs)
| def dist(self, *args, **kwargs):
return Bounded.dist(self.distribution, self.lower, self.upper, *args, **kwargs)
| https://github.com/pymc-devs/pymc3/issues/1491 | Traceback (most recent call last):
File "garch_example.py", line 40, in <module>
beta1 = BoundedNormal('beta1', 0, sd=1e6)
File "/Users/**/anaconda3/envs/py35/lib/python3.5/site-packages/pymc3/distributions/continuous.py", line 1102, in __call__
*args, **kwargs)
File "/Users/**/anaconda3/envs/py35/lib/python3.5/site-pa... | AttributeError |
def __init__(self, *args, **kwargs):
first, args = args[0], args[1:]
super(self, _BoundedDist).__init__(
first, distribution, lower, upper, *args, **kwargs
)
| def __init__(self, mu=0.0, sd=None, tau=None, alpha=1, *args, **kwargs):
super(SkewNormal, self).__init__(*args, **kwargs)
self.mu = mu
self.tau, self.sd = get_tau_sd(tau=tau, sd=sd)
self.alpha = alpha
self.mean = mu + self.sd * (2 / np.pi) ** 0.5 * alpha / (1 + alpha**2) ** 0.5
self.variance = ... | https://github.com/pymc-devs/pymc3/issues/1491 | Traceback (most recent call last):
File "garch_example.py", line 40, in <module>
beta1 = BoundedNormal('beta1', 0, sd=1e6)
File "/Users/**/anaconda3/envs/py35/lib/python3.5/site-packages/pymc3/distributions/continuous.py", line 1102, in __call__
*args, **kwargs)
File "/Users/**/anaconda3/envs/py35/lib/python3.5/site-pa... | AttributeError |
def run(n=1000):
if n == "short":
n = 50
with get_garch_model():
tr = sample(n, n_init=10000)
return tr
| def run(n=1000):
if n == "short":
n = 50
with garch:
tr = sample(n)
| https://github.com/pymc-devs/pymc3/issues/1491 | Traceback (most recent call last):
File "garch_example.py", line 40, in <module>
beta1 = BoundedNormal('beta1', 0, sd=1e6)
File "/Users/**/anaconda3/envs/py35/lib/python3.5/site-packages/pymc3/distributions/continuous.py", line 1102, in __call__
*args, **kwargs)
File "/Users/**/anaconda3/envs/py35/lib/python3.5/site-pa... | AttributeError |
def __init__(self, n, p, *args, **kwargs):
super(Multinomial, self).__init__(*args, **kwargs)
p = p / tt.sum(p, axis=-1, keepdims=True)
n = np.squeeze(n) # works also if n is a tensor
if len(self.shape) > 1:
m = self.shape[-2]
try:
assert n.shape == (m,)
except (At... | def __init__(self, n, p, *args, **kwargs):
super(Multinomial, self).__init__(*args, **kwargs)
p = p / tt.sum(p, axis=-1, keepdims=True)
lst = range(self.shape[-1])
if len(self.shape) > 1:
m = self.shape[-2]
try:
assert n.shape == (m,)
except AttributeError:
... | https://github.com/pymc-devs/pymc3/issues/2550 | import numpy as np
import pandas as pd
import pymc3 as pm
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(color_codes=True)
import theano
from scipy.stats import norm
def hierarchical_normal(name, shape, mu=0.,cs=5.):
delta = pm.Normal('delta_{}'.format(name), 0., 1., shape=shape)
sigma = pm.HalfCauchy... | TypeError |
def _random(self, n, p, size=None):
original_dtype = p.dtype
# Set float type to float64 for numpy. This change is related to numpy issue #8317 (https://github.com/numpy/numpy/issues/8317)
p = p.astype("float64")
# Now, re-normalize all of the values in float64 precision. This is done inside the conditi... | def _random(self, n, p, size=None):
original_dtype = p.dtype
# Set float type to float64 for numpy. This change is related to numpy issue #8317 (https://github.com/numpy/numpy/issues/8317)
p = p.astype("float64")
# Now, re-normalize all of the values in float64 precision. This is done inside the conditi... | https://github.com/pymc-devs/pymc3/issues/2550 | import numpy as np
import pandas as pd
import pymc3 as pm
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(color_codes=True)
import theano
from scipy.stats import norm
def hierarchical_normal(name, shape, mu=0.,cs=5.):
delta = pm.Normal('delta_{}'.format(name), 0., 1., shape=shape)
sigma = pm.HalfCauchy... | TypeError |
def init_nuts(
init="auto",
njobs=1,
n_init=500000,
model=None,
random_seed=-1,
progressbar=True,
**kwargs,
):
"""Set up the mass matrix initialization for NUTS.
NUTS convergence and sampling speed is extremely dependent on the
choice of mass/scaling matrix. This function implem... | def init_nuts(
init="auto",
njobs=1,
n_init=500000,
model=None,
random_seed=-1,
progressbar=True,
**kwargs,
):
"""Set up the mass matrix initialization for NUTS.
NUTS convergence and sampling speed is extremely dependent on the
choice of mass/scaling matrix. This function implem... | https://github.com/pymc-devs/pymc3/issues/2442 | Traceback (most recent call last):
File "<ipython-input-10-aea93a5e8087>", line 5, in <module>
pm.sample(init='adapt_diag')
File "/home/laoj/Documents/Github/pymc3/pymc3/sampling.py", line 247, in sample
progressbar=progressbar, **args)
File "/home/laoj/Documents/Github/pymc3/pymc3/sampling.py", line 729, in init_nu... | MissingInputError |
def __init__(
self,
n,
initial_mean,
initial_diag=None,
initial_weight=0,
adaptation_window=100,
dtype=None,
):
"""Set up a diagonal mass matrix."""
if initial_diag is not None and initial_diag.ndim != 1:
raise ValueError("Initial diagonal must be one-dimensional.")
if in... | def __init__(
self,
n,
initial_mean,
initial_diag=None,
initial_weight=0,
adaptation_window=100,
dtype=None,
):
"""Set up a diagonal mass matrix."""
if initial_diag is not None and initial_diag.ndim != 1:
raise ValueError("Initial diagonal must be one-dimensional.")
if in... | https://github.com/pymc-devs/pymc3/issues/2442 | Traceback (most recent call last):
File "<ipython-input-10-aea93a5e8087>", line 5, in <module>
pm.sample(init='adapt_diag')
File "/home/laoj/Documents/Github/pymc3/pymc3/sampling.py", line 247, in sample
progressbar=progressbar, **args)
File "/home/laoj/Documents/Github/pymc3/pymc3/sampling.py", line 729, in init_nu... | MissingInputError |
def random(self, point=None, size=None, repeat=None):
def random_choice(*args, **kwargs):
w = kwargs.pop("w")
w /= w.sum(axis=-1, keepdims=True)
k = w.shape[-1]
if w.ndim > 1:
return np.row_stack([np.random.choice(k, p=w_) for w_ in w])
else:
return n... | def random(self, point=None, size=None, repeat=None):
def random_choice(*args, **kwargs):
w = kwargs.pop("w")
w /= w.sum(axis=-1, keepdims=True)
k = w.shape[-1]
if w.ndim > 1:
return np.row_stack([np.random.choice(k, p=w_) for w_ in w])
else:
return n... | https://github.com/pymc-devs/pymc3/issues/2346 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-16-2fd0a2e33b32> in <module>()
5
6 with model:
----> 7 pp_trace = pm.sample_ppc(trace, PP_SAMPLES, random_seed=SEED)
/Users/fonnescj/Repos/pymc3/pym... | AttributeError |
def __init__(self, dist, transform, *args, **kwargs):
"""
Parameters
----------
dist : Distribution
transform : Transform
args, kwargs
arguments to Distribution"""
forward = transform.forward
testval = forward(dist.default())
forward_val = transform.forward_val
self.dist... | def __init__(self, dist, transform, *args, **kwargs):
"""
Parameters
----------
dist : Distribution
transform : Transform
args, kwargs
arguments to Distribution"""
forward = transform.forward
testval = forward(dist.default())
self.dist = dist
self.transform_used = transf... | https://github.com/pymc-devs/pymc3/issues/2258 | Traceback (most recent call last):
File "<ipython-input-1-e7f2b743f1a1>", line 5, in <module>
pm.sample(1000)
File "/usr/local/lib/python3.5/dist-packages/pymc3/sampling.py", line 273, in sample
return sample_func(**sample_args)[discard:]
File "/usr/local/lib/python3.5/dist-packages/pymc3/sampling.py", line 288, in ... | MissingInputError |
def forward(self, x):
a = self.a
return tt.log(x - a)
| def forward(self, x):
a = self.a
r = tt.log(x - a)
return r
| https://github.com/pymc-devs/pymc3/issues/2258 | Traceback (most recent call last):
File "<ipython-input-1-e7f2b743f1a1>", line 5, in <module>
pm.sample(1000)
File "/usr/local/lib/python3.5/dist-packages/pymc3/sampling.py", line 273, in sample
return sample_func(**sample_args)[discard:]
File "/usr/local/lib/python3.5/dist-packages/pymc3/sampling.py", line 288, in ... | MissingInputError |
def forward(self, x):
b = self.b
return tt.log(b - x)
| def forward(self, x):
b = self.b
r = tt.log(b - x)
return r
| https://github.com/pymc-devs/pymc3/issues/2258 | Traceback (most recent call last):
File "<ipython-input-1-e7f2b743f1a1>", line 5, in <module>
pm.sample(1000)
File "/usr/local/lib/python3.5/dist-packages/pymc3/sampling.py", line 273, in sample
return sample_func(**sample_args)[discard:]
File "/usr/local/lib/python3.5/dist-packages/pymc3/sampling.py", line 288, in ... | MissingInputError |
def _update_start_vals(a, b, model):
"""Update a with b, without overwriting existing keys. Values specified for
transformed variables on the original scale are also transformed and inserted.
"""
if model is not None:
for free_RV in model.free_RVs:
tname = free_RV.name
fo... | def _update_start_vals(a, b, model):
"""Update a with b, without overwriting existing keys. Values specified for
transformed variables on the original scale are also transformed and inserted.
"""
for name in a:
for tname in b:
if is_transformed_name(tname) and get_untransformed_name(... | https://github.com/pymc-devs/pymc3/issues/2258 | Traceback (most recent call last):
File "<ipython-input-1-e7f2b743f1a1>", line 5, in <module>
pm.sample(1000)
File "/usr/local/lib/python3.5/dist-packages/pymc3/sampling.py", line 273, in sample
return sample_func(**sample_args)[discard:]
File "/usr/local/lib/python3.5/dist-packages/pymc3/sampling.py", line 288, in ... | MissingInputError |
def random(self, point=None, size=None, repeat=None):
sd = draw_values([self.sd], point=point)[0]
return generate_samples(
stats.halfnorm.rvs, loc=0.0, scale=sd, dist_shape=self.shape, size=size
)
| def random(self, point=None, size=None, repeat=None):
sd = draw_values([self.sd], point=point)
return generate_samples(
stats.halfnorm.rvs, loc=0.0, scale=sd, dist_shape=self.shape, size=size
)
| https://github.com/pymc-devs/pymc3/issues/2307 | TypeError Traceback (most recent call last)
in ()
1 ann_input.set_value(X_test)
2 ann_output.set_value(Y_test)
----> 3 ppc = pm.sample_ppc(trace, model=neural_network, samples=500, progressbar=False)
4
C:\Users\Nikos\Documents\Lasagne\python-3.4.4.amd64\lib\site-packages\pymc3\sampling.py in sample_ppc(trace, samples,... | TypeError |
def random(self, point=None, size=None, repeat=None):
lam = draw_values([self.lam], point=point)[0]
return generate_samples(
np.random.exponential, scale=1.0 / lam, dist_shape=self.shape, size=size
)
| def random(self, point=None, size=None, repeat=None):
lam = draw_values([self.lam], point=point)
return generate_samples(
np.random.exponential, scale=1.0 / lam, dist_shape=self.shape, size=size
)
| https://github.com/pymc-devs/pymc3/issues/2307 | TypeError Traceback (most recent call last)
in ()
1 ann_input.set_value(X_test)
2 ann_output.set_value(Y_test)
----> 3 ppc = pm.sample_ppc(trace, model=neural_network, samples=500, progressbar=False)
4
C:\Users\Nikos\Documents\Lasagne\python-3.4.4.amd64\lib\site-packages\pymc3\sampling.py in sample_ppc(trace, samples,... | TypeError |
def random(self, point=None, size=None, repeat=None):
beta = draw_values([self.beta], point=point)[0]
return generate_samples(self._random, beta, dist_shape=self.shape, size=size)
| def random(self, point=None, size=None, repeat=None):
beta = draw_values([self.beta], point=point)
return generate_samples(self._random, beta, dist_shape=self.shape, size=size)
| https://github.com/pymc-devs/pymc3/issues/2307 | TypeError Traceback (most recent call last)
in ()
1 ann_input.set_value(X_test)
2 ann_output.set_value(Y_test)
----> 3 ppc = pm.sample_ppc(trace, model=neural_network, samples=500, progressbar=False)
4
C:\Users\Nikos\Documents\Lasagne\python-3.4.4.amd64\lib\site-packages\pymc3\sampling.py in sample_ppc(trace, samples,... | TypeError |
def random(self, point=None, size=None, repeat=None):
p = draw_values([self.p], point=point)[0]
return generate_samples(stats.bernoulli.rvs, p, dist_shape=self.shape, size=size)
| def random(self, point=None, size=None, repeat=None):
p = draw_values([self.p], point=point)
return generate_samples(stats.bernoulli.rvs, p, dist_shape=self.shape, size=size)
| https://github.com/pymc-devs/pymc3/issues/2307 | TypeError Traceback (most recent call last)
in ()
1 ann_input.set_value(X_test)
2 ann_output.set_value(Y_test)
----> 3 ppc = pm.sample_ppc(trace, model=neural_network, samples=500, progressbar=False)
4
C:\Users\Nikos\Documents\Lasagne\python-3.4.4.amd64\lib\site-packages\pymc3\sampling.py in sample_ppc(trace, samples,... | TypeError |
def random(self, point=None, size=None, repeat=None):
mu = draw_values([self.mu], point=point)[0]
return generate_samples(stats.poisson.rvs, mu, dist_shape=self.shape, size=size)
| def random(self, point=None, size=None, repeat=None):
mu = draw_values([self.mu], point=point)
return generate_samples(stats.poisson.rvs, mu, dist_shape=self.shape, size=size)
| https://github.com/pymc-devs/pymc3/issues/2307 | TypeError Traceback (most recent call last)
in ()
1 ann_input.set_value(X_test)
2 ann_output.set_value(Y_test)
----> 3 ppc = pm.sample_ppc(trace, model=neural_network, samples=500, progressbar=False)
4
C:\Users\Nikos\Documents\Lasagne\python-3.4.4.amd64\lib\site-packages\pymc3\sampling.py in sample_ppc(trace, samples,... | TypeError |
def random(self, point=None, size=None, repeat=None):
p = draw_values([self.p], point=point)[0]
return generate_samples(np.random.geometric, p, dist_shape=self.shape, size=size)
| def random(self, point=None, size=None, repeat=None):
p = draw_values([self.p], point=point)
return generate_samples(np.random.geometric, p, dist_shape=self.shape, size=size)
| https://github.com/pymc-devs/pymc3/issues/2307 | TypeError Traceback (most recent call last)
in ()
1 ann_input.set_value(X_test)
2 ann_output.set_value(Y_test)
----> 3 ppc = pm.sample_ppc(trace, model=neural_network, samples=500, progressbar=False)
4
C:\Users\Nikos\Documents\Lasagne\python-3.4.4.amd64\lib\site-packages\pymc3\sampling.py in sample_ppc(trace, samples,... | TypeError |
def random(self, point=None, size=None, repeat=None):
c = draw_values([self.c], point=point)[0]
dtype = np.array(c).dtype
def _random(c, dtype=dtype, size=None):
return np.full(size, fill_value=c, dtype=dtype)
return generate_samples(_random, c=c, dist_shape=self.shape, size=size).astype(
... | def random(self, point=None, size=None, repeat=None):
c = draw_values([self.c], point=point)
dtype = np.array(c).dtype
def _random(c, dtype=dtype, size=None):
return np.full(size, fill_value=c, dtype=dtype)
return generate_samples(_random, c=c, dist_shape=self.shape, size=size).astype(
... | https://github.com/pymc-devs/pymc3/issues/2307 | TypeError Traceback (most recent call last)
in ()
1 ann_input.set_value(X_test)
2 ann_output.set_value(Y_test)
----> 3 ppc = pm.sample_ppc(trace, model=neural_network, samples=500, progressbar=False)
4
C:\Users\Nikos\Documents\Lasagne\python-3.4.4.amd64\lib\site-packages\pymc3\sampling.py in sample_ppc(trace, samples,... | TypeError |
def draw_values(params, point=None):
"""
Draw (fix) parameter values. Handles a number of cases:
1) The parameter is a scalar
2) The parameter is an *RV
a) parameter can be fixed to the value in the point
b) parameter can be fixed by sampling from the *RV
c)... | def draw_values(params, point=None):
"""
Draw (fix) parameter values. Handles a number of cases:
1) The parameter is a scalar
2) The parameter is an *RV
a) parameter can be fixed to the value in the point
b) parameter can be fixed by sampling from the *RV
c)... | https://github.com/pymc-devs/pymc3/issues/2307 | TypeError Traceback (most recent call last)
in ()
1 ann_input.set_value(X_test)
2 ann_output.set_value(Y_test)
----> 3 ppc = pm.sample_ppc(trace, model=neural_network, samples=500, progressbar=False)
4
C:\Users\Nikos\Documents\Lasagne\python-3.4.4.amd64\lib\site-packages\pymc3\sampling.py in sample_ppc(trace, samples,... | TypeError |
def random(self, point=None, size=None):
a = draw_values([self.a], point=point)[0]
def _random(a, size=None):
return stats.dirichlet.rvs(a, None if size == a.shape else size)
samples = generate_samples(_random, a, dist_shape=self.shape, size=size)
return samples
| def random(self, point=None, size=None):
a = draw_values([self.a], point=point)
def _random(a, size=None):
return stats.dirichlet.rvs(a, None if size == a.shape else size)
samples = generate_samples(_random, a, dist_shape=self.shape, size=size)
return samples
| https://github.com/pymc-devs/pymc3/issues/2307 | TypeError Traceback (most recent call last)
in ()
1 ann_input.set_value(X_test)
2 ann_output.set_value(Y_test)
----> 3 ppc = pm.sample_ppc(trace, model=neural_network, samples=500, progressbar=False)
4
C:\Users\Nikos\Documents\Lasagne\python-3.4.4.amd64\lib\site-packages\pymc3\sampling.py in sample_ppc(trace, samples,... | TypeError |
def astep(self, q0, logp):
"""q0 : current state
logp : log probability function
"""
# Draw from the normal prior by multiplying the Cholesky decomposition
# of the covariance with draws from a standard normal
chol = draw_values([self.prior_chol])[0]
nu = np.dot(chol, nr.randn(chol.shape[0]... | def astep(self, q0, logp):
"""q0 : current state
logp : log probability function
"""
# Draw from the normal prior by multiplying the Cholesky decomposition
# of the covariance with draws from a standard normal
chol = draw_values([self.prior_chol])
nu = np.dot(chol, nr.randn(chol.shape[0]))
... | https://github.com/pymc-devs/pymc3/issues/2307 | TypeError Traceback (most recent call last)
in ()
1 ann_input.set_value(X_test)
2 ann_output.set_value(Y_test)
----> 3 ppc = pm.sample_ppc(trace, model=neural_network, samples=500, progressbar=False)
4
C:\Users\Nikos\Documents\Lasagne\python-3.4.4.amd64\lib\site-packages\pymc3\sampling.py in sample_ppc(trace, samples,... | TypeError |
def _slice(self, idx):
with self.activate_file:
start, stop, step = idx.indices(len(self))
sliced = ndarray.NDArray(model=self.model, vars=self.vars)
sliced.chain = self.chain
sliced.samples = {v: self.samples[v][start:stop:step] for v in self.varnames}
sliced.draw_idx = (sto... | def _slice(self, idx):
with self.activate_file:
if idx.start is None:
burn = 0
else:
burn = idx.start
if idx.step is None:
thin = 1
else:
thin = idx.step
sliced = ndarray.NDArray(model=self.model, vars=self.vars)
sliced... | https://github.com/pymc-devs/pymc3/issues/1906 | {
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import numpy as np\n",
"import pymc3 as pm"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": ... | IndexError |
def _slice(self, idx):
# Slicing directly instead of using _slice_as_ndarray to
# support stop value in slice (which is needed by
# iter_sample).
# Only the first `draw_idx` value are valid because of preallocation
idx = slice(*idx.indices(len(self)))
sliced = NDArray(model=self.model, vars=se... | def _slice(self, idx):
# Slicing directly instead of using _slice_as_ndarray to
# support stop value in slice (which is needed by
# iter_sample).
# Only the first `draw_idx` value are valid because of preallocation
idx = slice(*idx.indices(len(self)))
sliced = NDArray(model=self.model, vars=se... | https://github.com/pymc-devs/pymc3/issues/1906 | {
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import numpy as np\n",
"import pymc3 as pm"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": ... | IndexError |
def _slice_as_ndarray(strace, idx):
sliced = NDArray(model=strace.model, vars=strace.vars)
sliced.chain = strace.chain
# Happy path where we do not need to load everything from the trace
if (idx.step is None or idx.step >= 1) and (
idx.stop is None or idx.stop == len(strace)
):
star... | def _slice_as_ndarray(strace, idx):
if idx.start is None:
burn = 0
else:
burn = idx.start
if idx.step is None:
thin = 1
else:
thin = idx.step
sliced = NDArray(model=strace.model, vars=strace.vars)
sliced.chain = strace.chain
sliced.samples = {
v: stra... | https://github.com/pymc-devs/pymc3/issues/1906 | {
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import numpy as np\n",
"import pymc3 as pm"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": ... | IndexError |
def get_values(self, varname, burn=0, thin=1):
"""Get values from trace.
Parameters
----------
varname : str
burn : int
thin : int
Returns
-------
A NumPy array
"""
if burn is None:
burn = 0
if thin is None:
thin = 1
if burn < 0:
burn = max(... | def get_values(self, varname, burn=0, thin=1):
"""Get values from trace.
Parameters
----------
varname : str
burn : int
thin : int
Returns
-------
A NumPy array
"""
if burn < 0:
burn = max(0, len(self) + burn)
if thin < 1:
raise ValueError("Only positive... | https://github.com/pymc-devs/pymc3/issues/1906 | {
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import numpy as np\n",
"import pymc3 as pm"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": ... | IndexError |
def __init__(self, lam, *args, **kwargs):
super(Exponential, self).__init__(*args, **kwargs)
self.lam = lam = tt.as_tensor_variable(lam)
self.mean = 1.0 / self.lam
self.median = self.mean * tt.log(2)
self.mode = tt.zeros_like(self.lam)
self.variance = self.lam**-2
assert_negative_support(l... | def __init__(self, lam, *args, **kwargs):
super(Exponential, self).__init__(*args, **kwargs)
self.lam = lam = tt.as_tensor_variable(lam)
self.mean = 1.0 / self.lam
self.median = self.mean * tt.log(2)
self.mode = 0
self.variance = self.lam**-2
assert_negative_support(lam, "lam", "Exponentia... | https://github.com/pymc-devs/pymc3/issues/1882 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-1724aa75761e> in <module>()
11 #arrival time model
12 t = pm.Lognormal('t', 100, 50, shape=cluster_number)
---> 13 t_obs = pm.Mixture('t_ob... | ValueError |
def reshape_sampled(sampled, size, dist_shape):
dist_shape = infer_shape(dist_shape)
repeat_shape = infer_shape(size)
if np.size(sampled) == 1 or repeat_shape or dist_shape:
return np.reshape(sampled, repeat_shape + dist_shape)
else:
return sampled
| def reshape_sampled(sampled, size, dist_shape):
dist_shape = infer_shape(dist_shape)
repeat_shape = infer_shape(size)
return np.reshape(sampled, repeat_shape + dist_shape)
| https://github.com/pymc-devs/pymc3/issues/1695 | {
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from... | ValueError |
def find_MAP(
start=None, vars=None, fmin=None, return_raw=False, model=None, *args, **kwargs
):
"""
Sets state to the local maximum a posteriori point given a model.
Current default of fmin_Hessian does not deal well with optimizing close
to sharp edges, especially if they are the minimum.
Par... | def find_MAP(
start=None, vars=None, fmin=None, return_raw=False, model=None, *args, **kwargs
):
"""
Sets state to the local maximum a posteriori point given a model.
Current default of fmin_Hessian does not deal well with optimizing close
to sharp edges, especially if they are the minimum.
Par... | https://github.com/pymc-devs/pymc3/issues/639 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/mnt/sda1/JoeFiles/Joe_Home/PythonWorkarea/pyMCMCworks/MyModel_3.py in <module>()
87
88 # Inference...
---> 89 start = pm.find_MAP() # Find starting value by op... | AttributeError |
def __getitem__(self, index_value):
"""
Return copy NpTrace with sliced sample values if a slice is passed,
or the array of samples if a varname is passed.
"""
if isinstance(index_value, slice):
sliced_trace = NpTrace(self.vars)
sliced_trace.samples = dict(
(name, vals[i... | def __getitem__(self, index_value):
"""
Return copy NpTrace with sliced sample values if a slice is passed,
or the array of samples if a varname is passed.
"""
if isinstance(index_value, slice):
sliced_trace = NpTrace(self.vars)
sliced_trace.samples = dict(
(name, vals[i... | https://github.com/pymc-devs/pymc3/issues/488 | ======================================================================
ERROR: pymc.tests.test_plots.test_plots
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/nose-1.2.1-py2.7.egg/nose/case.py", line 197, in runTest
self.t... | IndexError |
async def purge_history(
self, room_id: str, token: str, delete_local_events: bool
) -> Set[int]:
"""Deletes room history before a certain point.
Note that only a single purge can occur at once, this is guaranteed via
a higher level (in the PaginationHandler).
Args:
room_id:
token:... | async def purge_history(
self, room_id: str, token: str, delete_local_events: bool
) -> Set[int]:
"""Deletes room history before a certain point
Args:
room_id:
token: A topological token to delete events before
delete_local_events:
if True, we will delete local events as... | https://github.com/matrix-org/synapse/issues/9481 | synapse.http.server: [POST-10040] Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7f57646fa970 method='POST' uri='/_matrix/client/r0/join/%23synapse%3Amatrix.org' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/synapse/http/serve... | twisted.internet.defer.FirstError |
def _purge_history_txn(
self, txn, room_id: str, token: RoomStreamToken, delete_local_events: bool
) -> Set[int]:
# Tables that should be pruned:
# event_auth
# event_backward_extremities
# event_edges
# event_forward_extremities
# event_json
# event_push_actions
... | def _purge_history_txn(self, txn, room_id, token, delete_local_events):
# Tables that should be pruned:
# event_auth
# event_backward_extremities
# event_edges
# event_forward_extremities
# event_json
# event_push_actions
# event_reference_hashes
# eve... | https://github.com/matrix-org/synapse/issues/9481 | synapse.http.server: [POST-10040] Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7f57646fa970 method='POST' uri='/_matrix/client/r0/join/%23synapse%3Amatrix.org' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/synapse/http/serve... | twisted.internet.defer.FirstError |
def _purge_room_txn(self, txn, room_id: str) -> List[int]:
# First we fetch all the state groups that should be deleted, before
# we delete that information.
txn.execute(
"""
SELECT DISTINCT state_group FROM events
INNER JOIN event_to_state_groups USING(event_id)
... | def _purge_room_txn(self, txn, room_id):
# First we fetch all the state groups that should be deleted, before
# we delete that information.
txn.execute(
"""
SELECT DISTINCT state_group FROM events
INNER JOIN event_to_state_groups USING(event_id)
WHERE ... | https://github.com/matrix-org/synapse/issues/9481 | synapse.http.server: [POST-10040] Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7f57646fa970 method='POST' uri='/_matrix/client/r0/join/%23synapse%3Amatrix.org' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/synapse/http/serve... | twisted.internet.defer.FirstError |
async def _find_unreferenced_groups(self, state_groups: Set[int]) -> Set[int]:
"""Used when purging history to figure out which state groups can be
deleted.
Args:
state_groups: Set of state groups referenced by events
that are going to be deleted.
Returns:
The set of state ... | async def _find_unreferenced_groups(self, state_groups: Set[int]) -> Set[int]:
"""Used when purging history to figure out which state groups can be
deleted.
Args:
state_groups: Set of state groups referenced by events
that are going to be deleted.
Returns:
The set of state ... | https://github.com/matrix-org/synapse/issues/9481 | synapse.http.server: [POST-10040] Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7f57646fa970 method='POST' uri='/_matrix/client/r0/join/%23synapse%3Amatrix.org' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/synapse/http/serve... | twisted.internet.defer.FirstError |
def __init__(self, database: DatabasePool, db_conn, hs):
super().__init__(database, db_conn, hs)
self.db_pool.updates.register_background_update_handler(
self.EVENT_ORIGIN_SERVER_TS_NAME, self._background_reindex_origin_server_ts
)
self.db_pool.updates.register_background_update_handler(
... | def __init__(self, database: DatabasePool, db_conn, hs):
super().__init__(database, db_conn, hs)
self.db_pool.updates.register_background_update_handler(
self.EVENT_ORIGIN_SERVER_TS_NAME, self._background_reindex_origin_server_ts
)
self.db_pool.updates.register_background_update_handler(
... | https://github.com/matrix-org/synapse/issues/9481 | synapse.http.server: [POST-10040] Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7f57646fa970 method='POST' uri='/_matrix/client/r0/join/%23synapse%3Amatrix.org' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/synapse/http/serve... | twisted.internet.defer.FirstError |
def _purge_room_txn(self, txn, room_id: str) -> List[int]:
# First we fetch all the state groups that should be deleted, before
# we delete that information.
txn.execute(
"""
SELECT DISTINCT state_group FROM events
INNER JOIN event_to_state_groups USING(event_id)
... | def _purge_room_txn(self, txn, room_id: str) -> List[int]:
# First we fetch all the state groups that should be deleted, before
# we delete that information.
txn.execute(
"""
SELECT DISTINCT state_group FROM events
INNER JOIN event_to_state_groups USING(event_id)
... | https://github.com/matrix-org/synapse/issues/9481 | synapse.http.server: [POST-10040] Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7f57646fa970 method='POST' uri='/_matrix/client/r0/join/%23synapse%3Amatrix.org' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/synapse/http/serve... | twisted.internet.defer.FirstError |
def __init__(self, hs: "HomeServer"):
super().__init__(hs)
self.hs = hs
self.auth = hs.get_auth()
self.admin_handler = hs.get_admin_handler()
self.state_handler = hs.get_state_handler()
| def __init__(self, hs: "HomeServer"):
self.hs = hs
self.auth = hs.get_auth()
self.room_member_handler = hs.get_room_member_handler()
self.admin_handler = hs.get_admin_handler()
self.state_handler = hs.get_state_handler()
| https://github.com/matrix-org/synapse/issues/9505 | 2021-02-26 14:01:23,554 - synapse.http.server - 94 - ERROR - POST-320 - Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7feef12ec358 method='POST' uri='/_synapse/admin/v1/join/%23test%3Aexemple.test.com' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/opt/synap... | ValueError |
async def on_POST(
self, request: SynapseRequest, room_identifier: str
) -> Tuple[int, JsonDict]:
requester = await self.auth.get_user_by_req(request)
await assert_user_is_admin(self.auth, requester.user)
content = parse_json_object_from_request(request)
assert_params_in_dict(content, ["user_id"])... | async def on_POST(
self, request: SynapseRequest, room_identifier: str
) -> Tuple[int, JsonDict]:
requester = await self.auth.get_user_by_req(request)
await assert_user_is_admin(self.auth, requester.user)
content = parse_json_object_from_request(request)
assert_params_in_dict(content, ["user_id"])... | https://github.com/matrix-org/synapse/issues/9505 | 2021-02-26 14:01:23,554 - synapse.http.server - 94 - ERROR - POST-320 - Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7feef12ec358 method='POST' uri='/_synapse/admin/v1/join/%23test%3Aexemple.test.com' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/opt/synap... | ValueError |
def __init__(self, hs: "HomeServer"):
super().__init__(hs)
self.hs = hs
self.auth = hs.get_auth()
self.event_creation_handler = hs.get_event_creation_handler()
self.state_handler = hs.get_state_handler()
self.is_mine_id = hs.is_mine_id
| def __init__(self, hs: "HomeServer"):
self.hs = hs
self.auth = hs.get_auth()
self.room_member_handler = hs.get_room_member_handler()
self.event_creation_handler = hs.get_event_creation_handler()
self.state_handler = hs.get_state_handler()
self.is_mine_id = hs.is_mine_id
| https://github.com/matrix-org/synapse/issues/9505 | 2021-02-26 14:01:23,554 - synapse.http.server - 94 - ERROR - POST-320 - Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7feef12ec358 method='POST' uri='/_synapse/admin/v1/join/%23test%3Aexemple.test.com' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/opt/synap... | ValueError |
async def on_POST(
self, request: SynapseRequest, room_identifier: str
) -> Tuple[int, JsonDict]:
requester = await self.auth.get_user_by_req(request)
await assert_user_is_admin(self.auth, requester.user)
content = parse_json_object_from_request(request, allow_empty_body=True)
room_id, _ = await se... | async def on_POST(self, request, room_identifier):
requester = await self.auth.get_user_by_req(request)
await assert_user_is_admin(self.auth, requester.user)
content = parse_json_object_from_request(request, allow_empty_body=True)
# Resolve to a room ID, if necessary.
if RoomID.is_valid(room_identi... | https://github.com/matrix-org/synapse/issues/9505 | 2021-02-26 14:01:23,554 - synapse.http.server - 94 - ERROR - POST-320 - Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7feef12ec358 method='POST' uri='/_synapse/admin/v1/join/%23test%3Aexemple.test.com' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/opt/synap... | ValueError |
def __init__(self, hs: "HomeServer"):
super().__init__(hs)
self.hs = hs
self.auth = hs.get_auth()
self.store = hs.get_datastore()
| def __init__(self, hs: "HomeServer"):
self.hs = hs
self.auth = hs.get_auth()
self.room_member_handler = hs.get_room_member_handler()
self.store = hs.get_datastore()
| https://github.com/matrix-org/synapse/issues/9505 | 2021-02-26 14:01:23,554 - synapse.http.server - 94 - ERROR - POST-320 - Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7feef12ec358 method='POST' uri='/_synapse/admin/v1/join/%23test%3Aexemple.test.com' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/opt/synap... | ValueError |
async def on_DELETE(
self, request: SynapseRequest, room_identifier: str
) -> Tuple[int, JsonDict]:
requester = await self.auth.get_user_by_req(request)
await assert_user_is_admin(self.auth, requester.user)
room_id, _ = await self.resolve_room_id(room_identifier)
deleted_count = await self.store.d... | async def on_DELETE(self, request, room_identifier):
requester = await self.auth.get_user_by_req(request)
await assert_user_is_admin(self.auth, requester.user)
room_id = await self.resolve_room_id(room_identifier)
deleted_count = await self.store.delete_forward_extremities_for_room(room_id)
return... | https://github.com/matrix-org/synapse/issues/9505 | 2021-02-26 14:01:23,554 - synapse.http.server - 94 - ERROR - POST-320 - Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7feef12ec358 method='POST' uri='/_synapse/admin/v1/join/%23test%3Aexemple.test.com' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/opt/synap... | ValueError |
async def on_GET(
self, request: SynapseRequest, room_identifier: str
) -> Tuple[int, JsonDict]:
requester = await self.auth.get_user_by_req(request)
await assert_user_is_admin(self.auth, requester.user)
room_id, _ = await self.resolve_room_id(room_identifier)
extremities = await self.store.get_fo... | async def on_GET(self, request, room_identifier):
requester = await self.auth.get_user_by_req(request)
await assert_user_is_admin(self.auth, requester.user)
room_id = await self.resolve_room_id(room_identifier)
extremities = await self.store.get_forward_extremities_for_room(room_id)
return 200, {"... | https://github.com/matrix-org/synapse/issues/9505 | 2021-02-26 14:01:23,554 - synapse.http.server - 94 - ERROR - POST-320 - Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7feef12ec358 method='POST' uri='/_synapse/admin/v1/join/%23test%3Aexemple.test.com' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/opt/synap... | ValueError |
def __init__(self, hs: "HomeServer"):
super().__init__()
self.clock = hs.get_clock()
self.room_context_handler = hs.get_room_context_handler()
self._event_serializer = hs.get_event_client_serializer()
self.auth = hs.get_auth()
| def __init__(self, hs):
super().__init__()
self.clock = hs.get_clock()
self.room_context_handler = hs.get_room_context_handler()
self._event_serializer = hs.get_event_client_serializer()
self.auth = hs.get_auth()
| https://github.com/matrix-org/synapse/issues/9505 | 2021-02-26 14:01:23,554 - synapse.http.server - 94 - ERROR - POST-320 - Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7feef12ec358 method='POST' uri='/_synapse/admin/v1/join/%23test%3Aexemple.test.com' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/opt/synap... | ValueError |
async def on_GET(
self, request: SynapseRequest, room_id: str, event_id: str
) -> Tuple[int, JsonDict]:
requester = await self.auth.get_user_by_req(request, allow_guest=False)
await assert_user_is_admin(self.auth, requester.user)
limit = parse_integer(request, "limit", default=10)
# picking the AP... | async def on_GET(self, request, room_id, event_id):
requester = await self.auth.get_user_by_req(request, allow_guest=False)
await assert_user_is_admin(self.auth, requester.user)
limit = parse_integer(request, "limit", default=10)
# picking the API shape for symmetry with /messages
filter_str = par... | https://github.com/matrix-org/synapse/issues/9505 | 2021-02-26 14:01:23,554 - synapse.http.server - 94 - ERROR - POST-320 - Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7feef12ec358 method='POST' uri='/_synapse/admin/v1/join/%23test%3Aexemple.test.com' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/opt/synap... | ValueError |
async def resolve_room_id(
self, room_identifier: str, remote_room_hosts: Optional[List[str]] = None
) -> Tuple[str, Optional[List[str]]]:
"""
Resolve a room identifier to a room ID, if necessary.
This also performanes checks to ensure the room ID is of the proper form.
Args:
room_identifi... | async def resolve_room_id(self, room_identifier: str) -> str:
"""Resolve to a room ID, if necessary."""
if RoomID.is_valid(room_identifier):
resolved_room_id = room_identifier
elif RoomAlias.is_valid(room_identifier):
room_alias = RoomAlias.from_string(room_identifier)
room_id, _ = a... | https://github.com/matrix-org/synapse/issues/9505 | 2021-02-26 14:01:23,554 - synapse.http.server - 94 - ERROR - POST-320 - Failed handle request via 'JoinRoomAliasServlet': <XForwardedForRequest at 0x7feef12ec358 method='POST' uri='/_synapse/admin/v1/join/%23test%3Aexemple.test.com' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
File "/opt/synap... | ValueError |
async def _unsafe_process(self) -> None:
# If self.pos is None then means we haven't fetched it from DB
if self.pos is None:
self.pos = await self.store.get_user_directory_stream_pos()
# If still None then the initial background update hasn't happened yet.
if self.pos is None:
return No... | async def _unsafe_process(self) -> None:
# If self.pos is None then means we haven't fetched it from DB
if self.pos is None:
self.pos = await self.store.get_user_directory_stream_pos()
# Loop round handling deltas until we're up to date
while True:
with Measure(self.clock, "user_dir_del... | https://github.com/matrix-org/synapse/issues/9420 | 2021-02-16 17:36:09,420 - synapse.metrics.background_process_metrics - 211 - ERROR - user_directory.notify_new_event-9 - Background process 'user_directory.notify_new_event' threw an exception
Traceback (most recent call last):
File "/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/metrics/background_proce... | TypeError |
async def get_user_directory_stream_pos(self) -> Optional[int]:
"""
Get the stream ID of the user directory stream.
Returns:
The stream token or None if the initial background update hasn't happened yet.
"""
return await self.db_pool.simple_select_one_onecol(
table="user_directory_s... | async def get_user_directory_stream_pos(self) -> int:
return await self.db_pool.simple_select_one_onecol(
table="user_directory_stream_pos",
keyvalues={},
retcol="stream_id",
desc="get_user_directory_stream_pos",
)
| https://github.com/matrix-org/synapse/issues/9420 | 2021-02-16 17:36:09,420 - synapse.metrics.background_process_metrics - 211 - ERROR - user_directory.notify_new_event-9 - Background process 'user_directory.notify_new_event' threw an exception
Traceback (most recent call last):
File "/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/metrics/background_proce... | TypeError |
async def clone_existing_room(
self,
requester: Requester,
old_room_id: str,
new_room_id: str,
new_room_version: RoomVersion,
tombstone_event_id: str,
) -> None:
"""Populate a new room based on an old room
Args:
requester: the user requesting the upgrade
old_room_id : th... | async def clone_existing_room(
self,
requester: Requester,
old_room_id: str,
new_room_id: str,
new_room_version: RoomVersion,
tombstone_event_id: str,
) -> None:
"""Populate a new room based on an old room
Args:
requester: the user requesting the upgrade
old_room_id : th... | https://github.com/matrix-org/synapse/issues/9378 | 2021-02-10 21:24:57,160 - synapse.http.server - 91 - ERROR - POST-269- Failed handle request via 'RoomUpgradeRestServlet': <XForwardedForRequest at 0x7ff64c3a6520 method='POST' uri='/_matrix/client/r0/rooms/!GvvSMoCBZYwiTcVaOt%3Aamorgan.xyz/upgrade' clientproto='HTTP/1.0' site='8008'>
Traceback (most recent call last):... | TypeError |
async def delete_pusher_by_app_id_pushkey_user_id(
self, app_id: str, pushkey: str, user_id: str
) -> None:
def delete_pusher_txn(txn, stream_id):
self._invalidate_cache_and_stream( # type: ignore
txn, self.get_if_user_has_pusher, (user_id,)
)
# It is expected that there is... | async def delete_pusher_by_app_id_pushkey_user_id(
self, app_id: str, pushkey: str, user_id: str
) -> None:
def delete_pusher_txn(txn, stream_id):
self._invalidate_cache_and_stream( # type: ignore
txn, self.get_if_user_has_pusher, (user_id,)
)
self.db_pool.simple_delete_one... | https://github.com/matrix-org/synapse/issues/5101 | 2019-04-26 13:17:52,980 - synapse.push.httppusher - 144 - ERROR - httppush.process-34525- Exception processing notifs
Traceback (most recent call last):
File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/push/httppusher.py", line 142, in _process
yield self._unsafe_process()
File "/opt/venvs/matrix-syn... | synapse.api.errors.StoreError |
def delete_pusher_txn(txn, stream_id):
self._invalidate_cache_and_stream( # type: ignore
txn, self.get_if_user_has_pusher, (user_id,)
)
# It is expected that there is exactly one pusher to delete, but
# if it isn't there (or there are multiple) delete them all.
self.db_pool.simple_delete_t... | def delete_pusher_txn(txn, stream_id):
self._invalidate_cache_and_stream( # type: ignore
txn, self.get_if_user_has_pusher, (user_id,)
)
self.db_pool.simple_delete_one_txn(
txn,
"pushers",
{"app_id": app_id, "pushkey": pushkey, "user_name": user_id},
)
# it's possib... | https://github.com/matrix-org/synapse/issues/5101 | 2019-04-26 13:17:52,980 - synapse.push.httppusher - 144 - ERROR - httppush.process-34525- Exception processing notifs
Traceback (most recent call last):
File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/push/httppusher.py", line 142, in _process
yield self._unsafe_process()
File "/opt/venvs/matrix-syn... | synapse.api.errors.StoreError |
def sorted_topologically(
nodes: Iterable[T],
graph: Mapping[T, Collection[T]],
) -> Generator[T, None, None]:
"""Given a set of nodes and a graph, yield the nodes in toplogical order.
For example `sorted_topologically([1, 2], {1: [2]})` will yield `2, 1`.
"""
# This is implemented by Kahn's a... | def sorted_topologically(
nodes: Iterable[T],
graph: Mapping[T, Collection[T]],
) -> Generator[T, None, None]:
"""Given a set of nodes and a graph, yield the nodes in toplogical order.
For example `sorted_topologically([1, 2], {1: [2]})` will yield `2, 1`.
"""
# This is implemented by Kahn's a... | https://github.com/matrix-org/synapse/issues/9208 | ΡΠ½Π² 22 19:05:51 stratofortress.nexus.i.intelfx.name synapse[373164]: synapse.storage.background_updates: [background_updates-0] Starting update batch on background update 'chain_cover'
ΡΠ½Π² 22 19:05:51 stratofortress.nexus.i.intelfx.name synapse[373164]: synapse.storage.background_updates: [background_updates-0] Error d... | KeyError |
async def get_file(
self,
url: str,
output_stream: BinaryIO,
max_size: Optional[int] = None,
headers: Optional[RawHeaders] = None,
) -> Tuple[int, Dict[bytes, List[bytes]], str, int]:
"""GETs a file from a given URL
Args:
url: The URL to GET
output_stream: File to write the r... | async def get_file(
self,
url: str,
output_stream: BinaryIO,
max_size: Optional[int] = None,
headers: Optional[RawHeaders] = None,
) -> Tuple[int, Dict[bytes, List[bytes]], str, int]:
"""GETs a file from a given URL
Args:
url: The URL to GET
output_stream: File to write the r... | https://github.com/matrix-org/synapse/issues/9132 | 2021-01-15 20:32:45,345 - synapse.http.matrixfederationclient - 987 - WARNING - GET-25- {GET-O-1} [matrix.org] Requested file is too large > 10485760 bytes
2021-01-15 20:32:45,345 - synapse.rest.media.v1.media_repository - 417 - ERROR - GET-25- Failed to fetch remote media matrix.org/cPeSAplLYzzcKlpJjLtwlzrT
Traceback ... | UnboundLocalError |
async def get_file(
self,
destination: str,
path: str,
output_stream,
args: Optional[QueryArgs] = None,
retry_on_dns_fail: bool = True,
max_size: Optional[int] = None,
ignore_backoff: bool = False,
) -> Tuple[int, Dict[bytes, List[bytes]]]:
"""GETs a file from a given homeserver
... | async def get_file(
self,
destination: str,
path: str,
output_stream,
args: Optional[QueryArgs] = None,
retry_on_dns_fail: bool = True,
max_size: Optional[int] = None,
ignore_backoff: bool = False,
) -> Tuple[int, Dict[bytes, List[bytes]]]:
"""GETs a file from a given homeserver
... | https://github.com/matrix-org/synapse/issues/9132 | 2021-01-15 20:32:45,345 - synapse.http.matrixfederationclient - 987 - WARNING - GET-25- {GET-O-1} [matrix.org] Requested file is too large > 10485760 bytes
2021-01-15 20:32:45,345 - synapse.rest.media.v1.media_repository - 417 - ERROR - GET-25- Failed to fetch remote media matrix.org/cPeSAplLYzzcKlpJjLtwlzrT
Traceback ... | UnboundLocalError |
async def on_PUT(self, request, user_id):
requester = await self.auth.get_user_by_req(request)
await assert_user_is_admin(self.auth, requester.user)
target_user = UserID.from_string(user_id)
body = parse_json_object_from_request(request)
if not self.hs.is_mine(target_user):
raise SynapseEr... | async def on_PUT(self, request, user_id):
requester = await self.auth.get_user_by_req(request)
await assert_user_is_admin(self.auth, requester.user)
target_user = UserID.from_string(user_id)
body = parse_json_object_from_request(request)
if not self.hs.is_mine(target_user):
raise SynapseEr... | https://github.com/matrix-org/synapse/issues/8871 | 2020-12-03 17:54:46,740 - synapse.http.server - 79 - ERROR - PUT-4829- Failed handle request via 'UserRestServletV2': <XForwardedForRequest at 0x7fea0361d880 method='PUT' uri='/_synapse/admin/v2/users/%40demo2_fake%3Ahs-mi1-staging.ems.host' clientproto='HTTP/1.1' site=8008>
Traceback (most recent call last):
File "/us... | AttributeError |
def start(hs: "synapse.server.HomeServer", listeners: Iterable[ListenerConfig]):
"""
Start a Synapse server or worker.
Should be called once the reactor is running and (if we're using ACME) the
TLS certificates are in place.
Will start the main HTTP listeners and do some other startup tasks, and t... | def start(hs: "synapse.server.HomeServer", listeners: Iterable[ListenerConfig]):
"""
Start a Synapse server or worker.
Should be called once the reactor is running and (if we're using ACME) the
TLS certificates are in place.
Will start the main HTTP listeners and do some other startup tasks, and t... | https://github.com/matrix-org/synapse/issues/8769 | --- Logging error ---
Traceback (most recent call last):
File "/usr/local/lib/python3.7/logging/__init__.py", line 1038, in emit
self.flush()
File "/usr/local/lib/python3.7/logging/__init__.py", line 1018, in flush
self.stream.flush()
File "/home/synapse/src/synapse/app/_base.py", line 253, in handle_sighup
i(*args, **... | RuntimeError |
async def get_profile(self, user_id: str) -> JsonDict:
target_user = UserID.from_string(user_id)
if self.hs.is_mine(target_user):
try:
displayname = await self.store.get_profile_displayname(
target_user.localpart
)
avatar_url = await self.store.get_pr... | async def get_profile(self, user_id: str) -> JsonDict:
target_user = UserID.from_string(user_id)
if self.hs.is_mine(target_user):
try:
displayname = await self.store.get_profile_displayname(
target_user.localpart
)
avatar_url = await self.store.get_pr... | https://github.com/matrix-org/synapse/issues/8520 | 2020-10-11 14:17:11,057 - synapse.crypto.keyring - 624 - INFO - PUT-394911 - Requesting keys dict_items([('conduit.rs', {'ed25519:vNlc2BKa': 1602425831054})]) from notary server matrix.org
2020-10-11 14:17:11,109 - synapse.http.matrixfederationclient - 204 - INFO - PUT-394911 - {POST-O-111774} [matrix.org] Completed re... | synapse.api.errors.HttpResponseException |
def respond_with_json_bytes(
request: Request,
code: int,
json_bytes: bytes,
send_cors: bool = False,
):
"""Sends encoded JSON in response to the given request.
Args:
request: The http request to respond to.
code: The HTTP response code.
json_bytes: The json bytes to use... | def respond_with_json_bytes(
request: Request,
code: int,
json_bytes: bytes,
send_cors: bool = False,
):
"""Sends encoded JSON in response to the given request.
Args:
request: The http request to respond to.
code: The HTTP response code.
json_bytes: The json bytes to use... | https://github.com/matrix-org/synapse/issues/5304 | 2019-05-31 11:55:56,270 - synapse.access.http.8008 - 233 - INFO - GET-1116745- 176.14.254.64 - 8008 - Received request: GET /_matrix/media/v1/thumbnail/amorgan.xyz/JpHpuDNOxuALIaPSENEAzZIu?width=800&height=600
2019-05-31 11:55:56,273 - synapse.access.http.8008 - 302 - INFO - GET-1116745- 176.14.254.64 - 8008 - {Non... | AttributeError |
async def respond_with_responder(
request, responder, media_type, file_size, upload_name=None
):
"""Responds to the request with given responder. If responder is None then
returns 404.
Args:
request (twisted.web.http.Request)
responder (Responder|None)
media_type (str): The medi... | async def respond_with_responder(
request, responder, media_type, file_size, upload_name=None
):
"""Responds to the request with given responder. If responder is None then
returns 404.
Args:
request (twisted.web.http.Request)
responder (Responder|None)
media_type (str): The medi... | https://github.com/matrix-org/synapse/issues/5304 | 2019-05-31 11:55:56,270 - synapse.access.http.8008 - 233 - INFO - GET-1116745- 176.14.254.64 - 8008 - Received request: GET /_matrix/media/v1/thumbnail/amorgan.xyz/JpHpuDNOxuALIaPSENEAzZIu?width=800&height=600
2019-05-31 11:55:56,273 - synapse.access.http.8008 - 302 - INFO - GET-1116745- 176.14.254.64 - 8008 - {Non... | AttributeError |
def check_redaction(
room_version_obj: RoomVersion,
event: EventBase,
auth_events: StateMap[EventBase],
) -> bool:
"""Check whether the event sender is allowed to redact the target event.
Returns:
True if the the sender is allowed to redact the target event if the
target event was c... | def check_redaction(
room_version_obj: RoomVersion,
event: EventBase,
auth_events: StateMap[EventBase],
) -> bool:
"""Check whether the event sender is allowed to redact the target event.
Returns:
True if the the sender is allowed to redact the target event if the
target event was c... | https://github.com/matrix-org/synapse/issues/8397 | synapse_1 | 2020-09-24 18:15:54,480 - synapse.handlers.federation - 1146 - ERROR - GET-3753 - Failed to backfill from t2bot.io because FirstError[#0, [Failure instance: Traceback: <class 'AttributeError'>: 'NoneType' object has no attribute 'find'
synapse_1 | /usr/local/lib/python3.7/site-packages/twisted/internet/de... | FirstError |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.