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 forward(self, init_features: Tensor) -> Tensor:
features = [init_features]
for name, layer in self.items():
new_features = layer(features)
features.append(new_features)
return torch.cat(features, 1)
| def forward(self, init_features: Tensor) -> Tensor: # type: ignore[override]
features = [init_features]
for name, layer in self.items():
new_features = layer(features)
features.append(new_features)
return torch.cat(features, 1)
| https://github.com/pytorch/vision/issues/3027 | Traceback (most recent call last):
File "repro.py", line 7, in <module>
torch.jit.script(model).save('densenet161.pt')
File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/torch/jit/_script.py", line 911, in script
return torch.jit._recursive.create_script_module(
File "/... | RuntimeError |
def pad(img, padding, fill=0, padding_mode="constant"):
r"""Pad the given PIL.Image on all sides with the given "pad" value.
Args:
img (PIL Image): Image to be padded.
padding (int or tuple or list): Padding on each border. If a single int is provided this
is used to pad all borders... | def pad(img, padding, fill=0, padding_mode="constant"):
r"""Pad the given PIL.Image on all sides with the given "pad" value.
Args:
img (PIL Image): Image to be padded.
padding (int or tuple or list): Padding on each border. If a single int is provided this
is used to pad all borders... | https://github.com/pytorch/vision/issues/2512 | TypeError Traceback (most recent call last)
<ipython-input-28-086b6b55847c> in <module>
4 x = PIL.Image.fromarray(t.numpy())
5 f = torchvision.transforms.Pad(2)
----> 6 f(x)
~/anaconda3/lib/python3.7/site-packages/torchvision/transforms/transforms.py in __call__(self, img)
338 ... | TypeError |
def _parse_fill(fill, img, min_pil_version, name="fillcolor"):
"""Helper function to get the fill color for rotate, perspective transforms, and pad.
Args:
fill (n-tuple or int or float): Pixel fill value for area outside the transformed
image. If int or float, the value is used for all band... | def _parse_fill(fill, img, min_pil_version):
"""Helper function to get the fill color for rotate and perspective transforms.
Args:
fill (n-tuple or int or float): Pixel fill value for area outside the transformed
image. If int or float, the value is used for all bands respectively.
... | https://github.com/pytorch/vision/issues/2512 | TypeError Traceback (most recent call last)
<ipython-input-28-086b6b55847c> in <module>
4 x = PIL.Image.fromarray(t.numpy())
5 f = torchvision.transforms.Pad(2)
----> 6 f(x)
~/anaconda3/lib/python3.7/site-packages/torchvision/transforms/transforms.py in __call__(self, img)
338 ... | TypeError |
def googlenet(pretrained=False, progress=True, **kwargs):
r"""GoogLeNet (Inception v1) model architecture from
`"Going Deeper with Convolutions" <http://arxiv.org/abs/1409.4842>`_.
Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
progress (bool): If True, displays a... | def googlenet(pretrained=False, progress=True, **kwargs):
r"""GoogLeNet (Inception v1) model architecture from
`"Going Deeper with Convolutions" <http://arxiv.org/abs/1409.4842>`_.
Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
progress (bool): If True, displays a... | https://github.com/pytorch/vision/issues/1936 | Traceback (most recent call last):
File "quantize_resnet.py", line 181, in <module>
main()
File "quantize_resnet.py", line 138, in main
m = torch.jit.script(model.float().eval())
File "/data/users/jerryzh/anaconda3/envs/py3/lib/python3.7/site-packages/torch/jit/__init__.py", line 1267, in script
return torch.jit._recur... | RuntimeError |
def __init__(
self,
num_classes=1000,
aux_logits=True,
transform_input=False,
init_weights=True,
blocks=None,
):
super(GoogLeNet, self).__init__()
if blocks is None:
blocks = [BasicConv2d, Inception, InceptionAux]
assert len(blocks) == 3
conv_block = blocks[0]
incepti... | def __init__(
self,
num_classes=1000,
aux_logits=True,
transform_input=False,
init_weights=True,
blocks=None,
):
super(GoogLeNet, self).__init__()
if blocks is None:
blocks = [BasicConv2d, Inception, InceptionAux]
assert len(blocks) == 3
conv_block = blocks[0]
incepti... | https://github.com/pytorch/vision/issues/1936 | Traceback (most recent call last):
File "quantize_resnet.py", line 181, in <module>
main()
File "quantize_resnet.py", line 138, in main
m = torch.jit.script(model.float().eval())
File "/data/users/jerryzh/anaconda3/envs/py3/lib/python3.7/site-packages/torch/jit/__init__.py", line 1267, in script
return torch.jit._recur... | RuntimeError |
def _forward(self, x):
# type: (Tensor) -> Tuple[Tensor, Optional[Tensor], Optional[Tensor]]
# N x 3 x 224 x 224
x = self.conv1(x)
# N x 64 x 112 x 112
x = self.maxpool1(x)
# N x 64 x 56 x 56
x = self.conv2(x)
# N x 64 x 56 x 56
x = self.conv3(x)
# N x 192 x 56 x 56
x = self.... | def _forward(self, x):
# type: (Tensor) -> Tuple[Tensor, Optional[Tensor], Optional[Tensor]]
# N x 3 x 224 x 224
x = self.conv1(x)
# N x 64 x 112 x 112
x = self.maxpool1(x)
# N x 64 x 56 x 56
x = self.conv2(x)
# N x 64 x 56 x 56
x = self.conv3(x)
# N x 192 x 56 x 56
x = self.... | https://github.com/pytorch/vision/issues/1936 | Traceback (most recent call last):
File "quantize_resnet.py", line 181, in <module>
main()
File "quantize_resnet.py", line 138, in main
m = torch.jit.script(model.float().eval())
File "/data/users/jerryzh/anaconda3/envs/py3/lib/python3.7/site-packages/torch/jit/__init__.py", line 1267, in script
return torch.jit._recur... | RuntimeError |
def set_cell_anchors(self, dtype, device):
# type: (int, Device) -> None # noqa: F821
if self.cell_anchors is not None:
cell_anchors = self.cell_anchors
assert cell_anchors is not None
# suppose that all anchors have the same device
# which is a valid assumption in the current... | def set_cell_anchors(self, dtype, device):
# type: (int, Device) -> None # noqa: F821
if self.cell_anchors is not None:
return
cell_anchors = [
self.generate_anchors(sizes, aspect_ratios, dtype, device)
for sizes, aspect_ratios in zip(self.sizes, self.aspect_ratios)
]
sel... | https://github.com/pytorch/vision/issues/1738 | Traceback (most recent call last):
File "/home/ubrdog/PycharmProjects/FacialDetection/bug_replication.py", line 17, in <module>
out_data2 = model(dummy_data)
File "/home/ubrdog/miniconda3/envs/FacialDetection/lib/python3.7/site-packages/torch/nn/modules/module.py", line 539, in __call__
result = self.forward(*input, **... | RuntimeError |
def __init__(
self, root, split="train", transform=None, target_transform=None, download=False
):
if split not in self.splits:
raise ValueError(
'Split "{}" not found. Valid splits are: {}'.format(
split,
", ".join(self.splits),
)
)
sup... | def __init__(
self, root, split="train", transform=None, target_transform=None, download=False
):
if split not in self.splits:
raise ValueError(
'Split "{}" not found. Valid splits are: {}'.format(
split,
", ".join(self.splits),
)
)
sel... | https://github.com/pytorch/vision/issues/968 | In [1]: from torchvision.datasets import STL10
In [2]: data = STL10("Documents/dataset", download=True)
Files already downloaded and verified
In [3]: print(data)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipy... | AttributeError |
def __repr__(self):
head = "Dataset " + self.__class__.__name__
body = ["Number of datapoints: {}".format(self.__len__())]
if self.root is not None:
body.append("Root location: {}".format(self.root))
body += self.extra_repr().splitlines()
if hasattr(self, "transforms") and self.transforms is... | def __repr__(self):
head = "Dataset " + self.__class__.__name__
body = ["Number of datapoints: {}".format(self.__len__())]
if self.root is not None:
body.append("Root location: {}".format(self.root))
body += self.extra_repr().splitlines()
if self.transforms is not None:
body += [repr... | https://github.com/pytorch/vision/issues/968 | In [1]: from torchvision.datasets import STL10
In [2]: data = STL10("Documents/dataset", download=True)
Files already downloaded and verified
In [3]: print(data)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipy... | AttributeError |
def resolve_host(self):
optional = [
item
for item in self.OPTIONAL_HOSTS
if item in self.config and self.config[item] != "none"
]
for item in list(self.HOSTS) + optional:
host = "HOST_" + item
address = item + "_ADDRESS"
self.config[address] = system.resolve_... | def resolve_host(self):
optional = [
item
for item in self.OPTIONAL_HOSTS
if item in self.config and self.config[item] != "none"
]
for item in list(self.HOSTS) + optional:
host = "HOST_" + item
self.config[host] = system.resolve_address(self.config[host])
| https://github.com/Mailu/Mailu/issues/884 | mailu_admin| [2019-01-25 14:15:37,610] ERROR in app: Exception on /internal/auth/email [GET]
mailu_admin| Traceback (most recent call last):
mailu_admin| File "/usr/lib/python3.6/site-packages/redis/connection.py", line 493, in connect
mailu_admin| sock = self._connect()
mailu_admin| File "/usr/lib/python3.6/si... | ConnectionError |
def init_app(self, app):
self.config.update(app.config)
# get environment variables
self.config.update(
{
key: self.__coerce_value(os.environ.get(key, value))
for key, value in DEFAULT_CONFIG.items()
}
)
self.resolve_host()
# automatically set the sqlalch... | def init_app(self, app):
self.config.update(app.config)
# get environment variables
self.config.update(
{
key: self.__coerce_value(os.environ.get(key, value))
for key, value in DEFAULT_CONFIG.items()
}
)
self.resolve_host()
# automatically set the sqlalch... | https://github.com/Mailu/Mailu/issues/884 | mailu_admin| [2019-01-25 14:15:37,610] ERROR in app: Exception on /internal/auth/email [GET]
mailu_admin| Traceback (most recent call last):
mailu_admin| File "/usr/lib/python3.6/site-packages/redis/connection.py", line 493, in connect
mailu_admin| sock = self._connect()
mailu_admin| File "/usr/lib/python3.6/si... | ConnectionError |
def get_server(protocol, authenticated=False):
if protocol == "imap":
hostname, port = extract_host_port(app.config["IMAP_ADDRESS"], 143)
elif protocol == "pop3":
hostname, port = extract_host_port(app.config["POP3_ADDRESS"], 110)
elif protocol == "smtp":
if authenticated:
... | def get_server(protocol, authenticated=False):
if protocol == "imap":
hostname, port = extract_host_port(app.config["HOST_IMAP"], 143)
elif protocol == "pop3":
hostname, port = extract_host_port(app.config["HOST_POP3"], 110)
elif protocol == "smtp":
if authenticated:
host... | https://github.com/Mailu/Mailu/issues/884 | mailu_admin| [2019-01-25 14:15:37,610] ERROR in app: Exception on /internal/auth/email [GET]
mailu_admin| Traceback (most recent call last):
mailu_admin| File "/usr/lib/python3.6/site-packages/redis/connection.py", line 493, in connect
mailu_admin| sock = self._connect()
mailu_admin| File "/usr/lib/python3.6/si... | ConnectionError |
def domain(domain_name, max_users=-1, max_aliases=-1, max_quota_bytes=0):
"""Create a domain"""
domain = models.Domain.query.get(domain_name)
if not domain:
domain = models.Domain(name=domain_name)
db.session.add(domain)
db.session.commit()
| def domain(domain_name, max_users=-1, max_aliases=-1, max_quota_bytes=0):
domain = models.Domain.query.get(domain_name)
if not domain:
domain = models.Domain(name=domain_name)
db.session.add(domain)
db.session.commit()
| https://github.com/Mailu/Mailu/issues/849 | Traceback (most recent call last):
File "manage.py", line 1, in <module>
from mailu import models
ModuleNotFoundError: No module named 'mailu' | ModuleNotFoundError |
def process_bind_param(self, value, dialect):
try:
localpart, domain_name = value.split("@")
return "{0}@{1}".format(
localpart,
idna.encode(domain_name).decode("ascii"),
)
except ValueError:
pass
| def process_bind_param(self, value, dialect):
localpart, domain_name = value.split("@")
return "{0}@{1}".format(
localpart,
idna.encode(domain_name).decode("ascii"),
)
| https://github.com/Mailu/Mailu/issues/585 | admin_1 | 2018-09-06T03:27:32.130634316Z File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 667, in _init_compiled
admin_1 | 2018-09-06T03:27:32.130647067Z param.append(processors[key](compiled_params[key]))
admin_1 | 2018-09-06T03:27:32.130651784Z File "/usr/local/l... | ValueError |
def calculateWhatChecker(self, length_text, key):
"""Calculates what threshold / checker to use
If the length of the text is over the maximum sentence length, use the last checker / threshold
Otherwise, traverse the keys backwards until we find a key range that does not fit.
So we traverse backwards an... | def calculateWhatChecker(self, length_text, key):
"""Calculates what threshold / checker to use
If the length of the text is over the maximum sentence length, use the last checker / threshold
Otherwise, traverse the keys backwards until we find a key range that does not fit.
So we traverse backwards an... | https://github.com/Ciphey/Ciphey/issues/248 | Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\lukas\AppData\Local\pypoetry\Cache\virtualenvs\ciphey-xvyT1_eU-py3.7\lib\site-packages\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "C:\Users\lukas\AppData\Local\pypoetry\Cache\virtualenvs\ciphey-xvyT1... | TypeError |
def run_script(script_path, cwd="."):
"""Execute a script from a working directory.
:param script_path: Absolute path to the script to run.
:param cwd: The directory to run the script from.
"""
run_thru_shell = sys.platform.startswith("win")
if script_path.endswith(".py"):
script_comman... | def run_script(script_path, cwd="."):
"""Execute a script from a working directory.
:param script_path: Absolute path to the script to run.
:param cwd: The directory to run the script from.
"""
run_thru_shell = sys.platform.startswith("win")
if script_path.endswith(".py"):
script_comman... | https://github.com/cookiecutter/cookiecutter/issues/632 | Traceback (most recent call last):
File "/usr/local/bin/cookiecutter", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 696, in main
rv = self.invok... | OSError |
def prompt_for_config(context, no_input=False):
"""
Prompts the user to enter new config, using context as a source for the
field names and sample values.
:param no_input: Prompt the user at command line for manual configuration?
"""
cookiecutter_dict = {}
env = Environment()
for key, ... | def prompt_for_config(context, no_input=False):
"""
Prompts the user to enter new config, using context as a source for the
field names and sample values.
:param no_input: Prompt the user at command line for manual configuration?
"""
cookiecutter_dict = {}
env = Environment()
for key, ... | https://github.com/cookiecutter/cookiecutter/issues/368 | Traceback (most recent call last):
File "/opt/boxen/homebrew/bin/cookiecutter", line 9, in <module>
load_entry_point('cookiecutter==0.9.0', 'console_scripts', 'cookiecutter')()
File "/opt/boxen/homebrew/lib/python2.7/site-packages/cookiecutter/main.py", line 169, in main
cookiecutter(args.input_dir, args.checkout, args... | AttributeError |
def get_likelihood_parameters(
self,
adata: Optional[AnnData] = None,
indices: Optional[Sequence[int]] = None,
n_samples: Optional[int] = 1,
give_mean: Optional[bool] = False,
batch_size: Optional[int] = None,
) -> Dict[str, np.ndarray]:
r"""
Estimates for the parameters of the likelihoo... | def get_likelihood_parameters(
self,
adata: Optional[AnnData] = None,
indices: Optional[Sequence[int]] = None,
n_samples: Optional[int] = 1,
give_mean: Optional[bool] = False,
batch_size: Optional[int] = None,
) -> Dict[str, np.ndarray]:
r"""
Estimates for the parameters of the likelihoo... | https://github.com/YosefLab/scvi-tools/issues/874 | 509 dropout = np.concatenate(dropout_list)
510 means = np.concatenate(mean_list)
--> 511 dispersions = np.concatenate(dispersion_list)
512 if give_mean and n_samples > 1:
513 dropout = dropout.mean(0)
<__array_function__ internals> in concatenate(*args, **kwargs)
ValueError... | ValueError |
def __init__(self, adata: Optional[AnnData] = None, use_cuda=False):
if adata is not None:
if "_scvi" not in adata.uns.keys():
raise ValueError(
"Please setup your AnnData with scvi.data.setup_anndata(adata) first"
)
self.adata = adata
self.scvi_setup_... | def __init__(self, adata: Optional[AnnData] = None, use_cuda=False):
if adata is not None:
if "_scvi" not in adata.uns.keys():
raise ValueError(
"Please setup your AnnData with scvi.data.setup_anndata(adata) first"
)
self.adata = adata
self.scvi_setup_... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def history(self):
"""Returns computed metrics during training."""
return self.history_
| def history(self):
"""Returns computed metrics during training."""
if self.is_trained_ is False:
return {}
return self.trainer.history
| https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def save(
self,
dir_path: str,
overwrite: bool = False,
save_anndata: bool = False,
**anndata_write_kwargs,
):
"""
Save the state of the model.
Neither the trainer optimizer state nor the trainer history are saved.
Model files are not expected to be reproducibly saved and loaded acr... | def save(self, dir_path: str, overwrite: bool = False):
"""
Save the state of the model.
Neither the trainer optimizer state nor the trainer history are saved.
Model files are not expected to be reproducibly saved and loaded across versions
until we reach version 1.0.
Parameters
----------... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def load(
cls,
dir_path: str,
adata: Optional[AnnData] = None,
use_cuda: bool = False,
):
"""
Instantiate a model from the saved output.
Parameters
----------
dir_path
Path to saved outputs.
adata
AnnData organized in the same way as data used to train model.
... | def load(cls, adata: AnnData, dir_path: str, use_cuda: bool = False):
"""
Instantiate a model from the saved output.
Parameters
----------
adata
AnnData organized in the same way as data used to train model.
It is not necessary to run :func:`~scvi.data.setup_anndata`,
as Ann... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def train(
self,
n_epochs: Optional[int] = None,
train_size: float = 0.9,
test_size: Optional[float] = None,
lr: float = 1e-3,
n_epochs_kl_warmup: int = 400,
n_iter_kl_warmup: Optional[int] = None,
frequency: Optional[int] = None,
train_fun_kwargs: dict = {},
**kwargs,
):
"""... | def train(
self,
n_epochs: Optional[int] = None,
train_size: float = 0.9,
test_size: Optional[float] = None,
lr: float = 1e-3,
n_epochs_kl_warmup: int = 400,
n_iter_kl_warmup: Optional[int] = None,
frequency: Optional[int] = None,
train_fun_kwargs: dict = {},
**kwargs,
):
"""... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def get_from_registry(adata: anndata.AnnData, key: str) -> np.ndarray:
"""
Returns the object in AnnData associated with the key in ``.uns['_scvi']['data_registry']``.
Parameters
----------
adata
anndata object already setup with `scvi.data.setup_anndata()`
key
key of object to ... | def get_from_registry(adata: anndata.AnnData, key: str) -> np.ndarray:
"""
Returns the object in AnnData associated with the key in ``.uns['_scvi']['data_registry']``.
Parameters
----------
adata
anndata object already setup with `scvi.data.setup_anndata()`
key
key of object to ... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def setup_anndata(
adata: anndata.AnnData,
batch_key: Optional[str] = None,
labels_key: Optional[str] = None,
layer: Optional[str] = None,
protein_expression_obsm_key: Optional[str] = None,
protein_names_uns_key: Optional[str] = None,
categorical_covariate_keys: Optional[List[str]] = None,
... | def setup_anndata(
adata: anndata.AnnData,
batch_key: Optional[str] = None,
labels_key: Optional[str] = None,
use_raw: bool = False,
layer: Optional[str] = None,
protein_expression_obsm_key: Optional[str] = None,
protein_names_uns_key: Optional[str] = None,
categorical_covariate_keys: Op... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def _set_data_in_registry(adata, data, key):
"""
Sets the data associated with key in adata.uns['_scvi']['data_registry'].keys() to data.
Note: This is a dangerous method and will change the underlying data of the user's anndata
Currently used to make the user's anndata C_CONTIGUOUS and csr if it is de... | def _set_data_in_registry(adata, data, key):
"""
Sets the data associated with key in adata.uns['_scvi']['data_registry'].keys() to data.
Note: This is a dangerous method and will change the underlying data of the user's anndata
Currently used to make the user's anndata C_CONTIGUOUS and csr if it is de... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def transfer_anndata_setup(
adata_source: Union[anndata.AnnData, dict], adata_target: anndata.AnnData
):
"""
Transfer anndata setup from a source object to a target object.
This handles encoding for categorical data and is useful in the case where an
anndata object has been subsetted and a category... | def transfer_anndata_setup(
adata_source: Union[anndata.AnnData, dict], adata_target: anndata.AnnData
):
"""
Transfer anndata setup from a source object to a target object.
This handles encoding for categorical data and is useful in the case where an
anndata object has been subsetted and a category... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def _setup_x(adata, layer):
if layer is not None:
assert layer in adata.layers.keys(), (
"{} is not a valid key in adata.layers".format(layer)
)
logger.info('Using data from adata.layers["{}"]'.format(layer))
x_loc = "layers"
x_key = layer
x = adata.layers... | def _setup_x(adata, layer, use_raw):
if use_raw and layer:
logging.warning("use_raw and layer were both passed in. Defaulting to use_raw.")
# checking layers
if use_raw:
if adata.raw is None:
raise ValueError("use_raw is True but adata.raw is None")
logger.info("Using da... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def _setup_library_size(adata, batch_key, layer):
# computes the library size per batch
logger.info("Computing library size prior per batch")
local_l_mean_key = "_scvi_local_l_mean"
local_l_var_key = "_scvi_local_l_var"
_compute_library_size_batch(
adata,
batch_key=batch_key,
... | def _setup_library_size(adata, batch_key, layer, use_raw):
# computes the library size per batch
logger.info("Computing library size prior per batch")
local_l_mean_key = "_scvi_local_l_mean"
local_l_var_key = "_scvi_local_l_var"
_compute_library_size_batch(
adata,
batch_key=batch_key... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def _setup_summary_stats(
adata,
batch_key,
labels_key,
protein_expression_obsm_key,
categorical_covariate_keys,
continuous_covariate_keys,
):
categorical_mappings = adata.uns["_scvi"]["categorical_mappings"]
n_batch = len(np.unique(categorical_mappings[batch_key]["mapping"]))
n_cell... | def _setup_summary_stats(
adata,
batch_key,
labels_key,
protein_expression_obsm_key,
categorical_covariate_keys,
continuous_covariate_keys,
):
categorical_mappings = adata.uns["_scvi"]["categorical_mappings"]
use_raw = adata.uns["_scvi"]["use_raw"]
n_batch = len(np.unique(categorica... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def _compute_library_size_batch(
adata,
batch_key: str,
local_l_mean_key: str = None,
local_l_var_key: str = None,
layer=None,
copy: bool = False,
):
"""
Computes the library size.
Parameters
----------
adata
anndata object containing counts
batch_key
key... | def _compute_library_size_batch(
adata,
batch_key: str,
local_l_mean_key: str = None,
local_l_var_key: str = None,
layer=None,
use_raw=False,
copy: bool = False,
):
"""
Computes the library size.
Parameters
----------
adata
anndata object containing counts
ba... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def _check_anndata_setup_equivalence(adata_source, adata_target):
"""Checks if target setup is equivalent to source."""
if isinstance(adata_source, anndata.AnnData):
_scvi_dict = adata_source.uns["_scvi"]
else:
_scvi_dict = adata_source
adata = adata_target
stats = _scvi_dict["summa... | def _check_anndata_setup_equivalence(adata_source, adata_target):
"""Checks if target setup is equivalent to source."""
if isinstance(adata_source, anndata.AnnData):
_scvi_dict = adata_source.uns["_scvi"]
else:
_scvi_dict = adata_source
adata = adata_target
stats = _scvi_dict["summa... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def _get_var_names_from_setup_anndata(adata):
"""Gets var names by checking if using raw."""
var_names = adata.var_names
return var_names
| def _get_var_names_from_setup_anndata(adata):
"""Gets var names by checking if using raw."""
var_names = (
adata.var_names
if adata.uns["_scvi"]["use_raw"] is False
else adata.raw.var_names
)
return var_names
| https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def __init__(
self,
adata_seq: AnnData,
adata_spatial: AnnData,
generative_distributions: List = ["zinb", "nb"],
model_library_size: List = [True, False],
n_latent: int = 10,
use_cuda: bool = True,
**model_kwargs,
):
super(GIMVI, self).__init__(use_cuda=use_cuda)
self.use_cuda = ... | def __init__(
self,
adata_seq: AnnData,
adata_spatial: AnnData,
generative_distributions: List = ["zinb", "nb"],
model_library_size: List = [True, False],
n_latent: int = 10,
use_cuda: bool = True,
**model_kwargs,
):
super(GIMVI, self).__init__(use_cuda=use_cuda)
self.use_cuda = ... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def train(
self,
n_epochs: Optional[int] = 200,
kappa: Optional[int] = 5,
discriminator: Optional[Classifier] = None,
train_size: float = 0.9,
frequency: int = 1,
n_epochs_kl_warmup: int = 400,
train_fun_kwargs: dict = {},
**kwargs,
):
"""
Train the model.
Parameters
... | def train(
self,
n_epochs: Optional[int] = 200,
kappa: Optional[int] = 5,
discriminator: Optional[Classifier] = None,
train_size: float = 0.9,
frequency: int = 1,
n_epochs_kl_warmup: int = 400,
train_fun_kwargs: dict = {},
**kwargs,
):
"""
Train the model.
Parameters
... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def load(
cls,
dir_path: str,
adata_seq: Optional[AnnData] = None,
adata_spatial: Optional[AnnData] = None,
use_cuda: bool = False,
):
"""
Instantiate a model from the saved output.
Parameters
----------
adata_seq
AnnData organized in the same way as data used to train m... | def load(
cls,
adata_seq: AnnData,
adata_spatial: AnnData,
dir_path: str,
use_cuda: bool = False,
):
"""
Instantiate a model from the saved output.
Parameters
----------
adata_seq
AnnData organized in the same way as data used to train model.
AnnData must be regi... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def __init__(
self,
adata: AnnData,
unlabeled_category: Union[str, int, float],
pretrained_model: Optional[SCVI] = None,
n_hidden: int = 128,
n_latent: int = 10,
n_layers: int = 1,
dropout_rate: float = 0.1,
dispersion: Literal["gene", "gene-batch", "gene-label", "gene-cell"] = "gene... | def __init__(
self,
adata: AnnData,
unlabeled_category: Union[str, int, float],
pretrained_model: Optional[SCVI] = None,
n_hidden: int = 128,
n_latent: int = 10,
n_layers: int = 1,
dropout_rate: float = 0.1,
dispersion: Literal["gene", "gene-batch", "gene-label", "gene-cell"] = "gene... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def history(self):
"""Returns computed metrics during training."""
return {
"unsupervised_trainer_history": self.unsupervised_history_,
"semisupervised_trainer_history": self.semisupervised_history_,
}
| def history(self):
"""Returns computed metrics during training."""
if self.is_trained_ is False:
return {}
else:
return {
"unsupervised_trainer_history": self._unsupervised_trainer.history,
"semisupervised_trainer_history": self.trainer.history,
}
| https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def train(
self,
n_epochs_unsupervised: Optional[int] = None,
n_epochs_semisupervised: Optional[int] = None,
train_size: float = 0.9,
test_size: float = None,
lr: float = 1e-3,
n_epochs_kl_warmup: int = 400,
n_iter_kl_warmup: Optional[int] = None,
frequency: Optional[int] = None,
... | def train(
self,
n_epochs_unsupervised: Optional[int] = None,
n_epochs_semisupervised: Optional[int] = None,
train_size: float = 0.9,
test_size: float = None,
lr: float = 1e-3,
n_epochs_kl_warmup: int = 400,
n_iter_kl_warmup: Optional[int] = None,
frequency: Optional[int] = None,
... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def train(
self,
n_epochs: int = 400,
train_size: float = 0.9,
test_size: Optional[float] = None,
lr: float = 4e-3,
n_epochs_kl_warmup: Optional[int] = None,
n_iter_kl_warmup: Union[Literal["auto"], int] = "auto",
batch_size: int = 256,
frequency: Optional[int] = None,
train_fun_... | def train(
self,
n_epochs: int = 400,
train_size: float = 0.9,
test_size: Optional[float] = None,
lr: float = 4e-3,
n_epochs_kl_warmup: Optional[int] = None,
n_iter_kl_warmup: Union[Literal["auto"], int] = "auto",
batch_size: int = 256,
frequency: Optional[int] = None,
train_fun_... | https://github.com/YosefLab/scvi-tools/issues/816 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-125-eb1e0fcfe1d1> in <module>
1 de = model.differential_expression(
----> 2 groupby="leiden",
3 )
4 de.head()
~/anaconda3/lib/python3.7/site-package... | AttributeError |
def _de_core(
adata,
model_fn,
groupby,
group1,
group2,
idx1,
idx2,
all_stats,
all_stats_fn,
col_names,
mode,
batchid1,
batchid2,
delta,
batch_correction,
fdr,
**kwargs,
):
"""Internal function for DE interface."""
if group1 is None and idx1 is... | def _de_core(
adata,
model_fn,
groupby,
group1,
group2,
idx1,
idx2,
all_stats,
all_stats_fn,
col_names,
mode,
batchid1,
batchid2,
delta,
batch_correction,
fdr,
**kwargs,
):
"""Internal function for DE interface."""
if group1 is None and idx1 is... | https://github.com/YosefLab/scvi-tools/issues/823 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-143-b1df721788f5> in <module>
2 for tissue in np.unique(adata.obs['tissue']):
3 sub_adata = adata[adata.obs['tissue']==tissue]
----> 4 de_celltyp... | ValueError |
def get_normalized_expression(
self,
adata: Optional[AnnData] = None,
indices: Optional[Sequence[int]] = None,
transform_batch: Optional[Sequence[Union[Number, str]]] = None,
gene_list: Optional[Sequence[str]] = None,
library_size: Union[float, Literal["latent"]] = 1,
n_samples: int = 1,
... | def get_normalized_expression(
self,
adata: Optional[AnnData] = None,
indices: Optional[Sequence[int]] = None,
transform_batch: Optional[Sequence[Union[Number, str]]] = None,
gene_list: Optional[Sequence[str]] = None,
library_size: Union[float, Literal["latent"]] = 1,
n_samples: int = 1,
... | https://github.com/YosefLab/scvi-tools/issues/823 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-143-b1df721788f5> in <module>
2 for tissue in np.unique(adata.obs['tissue']):
3 sub_adata = adata[adata.obs['tissue']==tissue]
----> 4 de_celltyp... | ValueError |
def get_feature_correlation_matrix(
self,
adata: Optional[AnnData] = None,
indices: Optional[Sequence[int]] = None,
n_samples: int = 10,
batch_size: int = 64,
rna_size_factor: int = 1000,
transform_batch: Optional[Sequence[Union[Number, str]]] = None,
correlation_type: Literal["spearman"... | def get_feature_correlation_matrix(
self,
adata: Optional[AnnData] = None,
indices: Optional[Sequence[int]] = None,
n_samples: int = 10,
batch_size: int = 64,
rna_size_factor: int = 1000,
transform_batch: Optional[Sequence[Union[Number, str]]] = None,
correlation_type: Literal["spearman"... | https://github.com/YosefLab/scvi-tools/issues/823 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-143-b1df721788f5> in <module>
2 for tissue in np.unique(adata.obs['tissue']):
3 sub_adata = adata[adata.obs['tissue']==tissue]
----> 4 de_celltyp... | ValueError |
def get_bayes_factors(
self,
idx1: Union[List[bool], np.ndarray],
idx2: Union[List[bool], np.ndarray],
mode: Literal["vanilla", "change"] = "vanilla",
batchid1: Optional[Sequence[Union[Number, str]]] = None,
batchid2: Optional[Sequence[Union[Number, str]]] = None,
use_observed_batches: Optio... | def get_bayes_factors(
self,
idx1: Union[List[bool], np.ndarray],
idx2: Union[List[bool], np.ndarray],
mode: Literal["vanilla", "change"] = "vanilla",
batchid1: Optional[Union[List[int], np.ndarray]] = None,
batchid2: Optional[Union[List[int], np.ndarray]] = None,
use_observed_batches: Optio... | https://github.com/YosefLab/scvi-tools/issues/823 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-143-b1df721788f5> in <module>
2 for tissue in np.unique(adata.obs['tissue']):
3 sub_adata = adata[adata.obs['tissue']==tissue]
----> 4 de_celltyp... | ValueError |
def scale_sampler(
self,
selection: Union[List[bool], np.ndarray],
n_samples: Optional[int] = 5000,
n_samples_per_cell: Optional[int] = None,
batchid: Optional[Sequence[Union[Number, str]]] = None,
use_observed_batches: Optional[bool] = False,
give_mean: Optional[bool] = False,
) -> dict:
... | def scale_sampler(
self,
selection: Union[List[bool], np.ndarray],
n_samples: Optional[int] = 5000,
n_samples_per_cell: Optional[int] = None,
batchid: Optional[Union[List[int], np.ndarray]] = None,
use_observed_batches: Optional[bool] = False,
give_mean: Optional[bool] = False,
) -> dict:
... | https://github.com/YosefLab/scvi-tools/issues/823 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-143-b1df721788f5> in <module>
2 for tissue in np.unique(adata.obs['tissue']):
3 sub_adata = adata[adata.obs['tissue']==tissue]
----> 4 de_celltyp... | ValueError |
def _generate_synthetic(
batch_size: int = 128,
n_genes: int = 100,
n_proteins: int = 100,
n_batches: int = 2,
n_labels: int = 3,
run_setup_anndata: bool = True,
) -> AnnData:
data = np.random.negative_binomial(5, 0.3, size=(batch_size * n_batches, n_genes))
mask = np.random.binomial(n=1... | def _generate_synthetic(
batch_size: int = 200,
n_genes: int = 100,
n_proteins: int = 100,
n_batches: int = 2,
n_labels: int = 3,
run_setup_anndata: bool = True,
) -> AnnData:
data = np.random.negative_binomial(5, 0.3, size=(batch_size * n_batches, n_genes))
mask = np.random.binomial(n=1... | https://github.com/YosefLab/scvi-tools/issues/823 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-143-b1df721788f5> in <module>
2 for tissue in np.unique(adata.obs['tissue']):
3 sub_adata = adata[adata.obs['tissue']==tissue]
----> 4 de_celltyp... | ValueError |
def _get_batch_code_from_category(
adata: anndata.AnnData, category: Sequence[Union[Number, str]]
):
if not isinstance(category, IterableClass) or isinstance(category, str):
category = [category]
categorical_mappings = adata.uns["_scvi"]["categorical_mappings"]
batch_mappings = categorical_mapp... | def _get_batch_code_from_category(
adata: anndata.AnnData, category: Sequence[Union[int, str]]
):
categorical_mappings = adata.uns["_scvi"]["categorical_mappings"]
batch_mappings = categorical_mappings["_scvi_batch"]["mapping"]
batch_code = []
for cat in category:
if cat is None:
... | https://github.com/YosefLab/scvi-tools/issues/823 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-143-b1df721788f5> in <module>
2 for tissue in np.unique(adata.obs['tissue']):
3 sub_adata = adata[adata.obs['tissue']==tissue]
----> 4 de_celltyp... | ValueError |
def _de_core(
adata,
model_fn,
groupby,
group1,
group2,
idx1,
idx2,
all_stats,
all_stats_fn,
col_names,
mode,
batchid1,
batchid2,
delta,
batch_correction,
**kwargs,
):
"""Internal function for DE interface."""
if group1 is None and idx1 is None:
... | def _de_core(
adata,
model_fn,
groupby,
group1,
group2,
idx1,
idx2,
all_stats,
all_stats_fn,
col_names,
mode,
batchid1,
batchid2,
delta,
batch_correction,
**kwargs,
):
"""Internal function for DE interface."""
if group1 is None and idx1 is None:
... | https://github.com/YosefLab/scvi-tools/issues/783 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-17-d7b37e40fc13> in <module>()
5 idx1=idx1,
6 idx2=idx2,
----> 7 mode='change',
8 )
7 frames
/usr/local/lib/python3.6/dist-packages/scvi/cor... | ValueError |
def _setup_extra_categorical_covs(
adata: anndata.AnnData,
categorical_covariate_keys: List[str],
category_dict: Dict[str, List[str]] = None,
):
"""
Setup obsm df for extra categorical covariates.
Parameters
----------
adata
AnnData to setup
categorical_covariate_keys
... | def _setup_extra_categorical_covs(
adata: anndata.AnnData,
categorical_covariate_keys: List[str],
category_dict: Dict[str, List[str]] = None,
):
"""
Setup obsm df for extra categorical covariates.
Parameters
----------
adata
AnnData to setup
categorical_covariate_keys
... | https://github.com/YosefLab/scvi-tools/issues/792 | NotImplementedError: Failed to write value for uns/_scvi/categorical_mappings/_scvi_batch/mapping, since a writer for type <class 'pandas.core.indexes.base.Index'> has not been implemented yet.
Above error raised while writing key 'uns/_scvi/categorical_mappings/_scvi_batch/mapping' of <class 'h5py._hl.files.File'> fr... | NotImplementedError |
def _make_obs_column_categorical(
adata, column_key, alternate_column_key, categorical_dtype=None
):
"""
Makes the data in column_key in obs all categorical.
If adata.obs[column_key] is not categorical, will categorize
and save to .obs[alternate_column_key]
"""
if categorical_dtype is None:... | def _make_obs_column_categorical(
adata, column_key, alternate_column_key, categorical_dtype=None
):
"""
Makes the data in column_key in obs all categorical.
If adata.obs[column_key] is not categorical, will categorize
and save to .obs[alternate_column_key]
"""
if categorical_dtype is None:... | https://github.com/YosefLab/scvi-tools/issues/792 | NotImplementedError: Failed to write value for uns/_scvi/categorical_mappings/_scvi_batch/mapping, since a writer for type <class 'pandas.core.indexes.base.Index'> has not been implemented yet.
Above error raised while writing key 'uns/_scvi/categorical_mappings/_scvi_batch/mapping' of <class 'h5py._hl.files.File'> fr... | NotImplementedError |
def _check_anndata_setup_equivalence(adata_source, adata_target):
"""Checks if target setup is equivalent to source."""
if isinstance(adata_source, anndata.AnnData):
_scvi_dict = adata_source.uns["_scvi"]
else:
_scvi_dict = adata_source
adata = adata_target
stats = _scvi_dict["summa... | def _check_anndata_setup_equivalence(adata_source, adata_target):
"""Checks if target setup is equivalent to source."""
if isinstance(adata_source, anndata.AnnData):
_scvi_dict = adata_source.uns["_scvi"]
else:
_scvi_dict = adata_source
adata = adata_target
stats = _scvi_dict["summa... | https://github.com/YosefLab/scvi-tools/issues/792 | NotImplementedError: Failed to write value for uns/_scvi/categorical_mappings/_scvi_batch/mapping, since a writer for type <class 'pandas.core.indexes.base.Index'> has not been implemented yet.
Above error raised while writing key 'uns/_scvi/categorical_mappings/_scvi_batch/mapping' of <class 'h5py._hl.files.File'> fr... | NotImplementedError |
def _download(url: str, save_path: str, filename: str):
"""Writes data from url to file."""
if os.path.exists(os.path.join(save_path, filename)):
logger.info("File %s already downloaded" % (os.path.join(save_path, filename)))
return
try:
r = urllib.request.urlopen(url)
except HTT... | def _download(url: str, save_path: str, filename: str):
"""Writes data from url to file."""
if os.path.exists(os.path.join(save_path, filename)):
logger.info("File %s already downloaded" % (os.path.join(save_path, filename)))
return
r = urllib.request.urlopen(url)
logger.info("Downloadi... | https://github.com/YosefLab/scvi-tools/issues/706 | ---------------------------------------------------------------------------
HTTPError Traceback (most recent call last)
<ipython-input-9-f56b0a5f9d5d> in <module>
2 get_ipython().run_line_magic('autoreload', '2')
3 from scvi.dataset import PbmcDataset
----> 4 d = PbmcDataset(save_path = ... | HTTPError |
def __init__(self):
# registers
self.dataset_versions = set()
self.gene_attribute_names = set()
self.cell_attribute_names = set()
self.cell_categorical_attribute_names = set()
self.attribute_mappings = defaultdict(list)
self.cell_measurements_col_mappings = dict()
# initialize attribute... | def __init__(self):
# registers
self.dataset_versions = set()
self.gene_attribute_names = set()
self.cell_attribute_names = set()
self.cell_categorical_attribute_names = set()
self.attribute_mappings = defaultdict(list)
self.cell_measurements_col_mappings = dict()
# initialize attribute... | https://github.com/YosefLab/scvi-tools/issues/704 | ---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-89-02337f1f2d24> in <module>
1 adata2.obs = adata2.obs[['n_genes']]
2 adata2.obs.columns = ['_X']
----> 3 scvi_data = AnnDatasetFromAnnData(adata2)
~/mi... | IndexError |
def __init__(
self,
filename_or_anndata: Union[str, anndata.AnnData],
save_path: str = "data/",
url: str = None,
new_n_genes: bool = False,
subset_genes: List[int] = None,
):
if type(filename_or_anndata) == str:
self.download_name = filename_or_anndata
self.save_path = save_p... | def __init__(
self,
filename_or_anndata,
save_path="data/",
url=None,
new_n_genes=False,
subset_genes=None,
):
""" """
if type(filename_or_anndata) == str:
self.download_name = filename_or_anndata
self.save_path = save_path
self.url = url
data, gene_name... | https://github.com/YosefLab/scvi-tools/issues/288 | ---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
<ipython-input-3-138de299bfb8> in <module>
1 # load
2 dataset = AnnDataset('data/dataset.h5ad',
----> 3 save_path=path)
~/anaconda3/envs/pyro/lib/... | MemoryError |
def extract_data_from_anndata(self, ad: anndata.AnnData):
data, gene_names, batch_indices, cell_types, labels = None, None, None, None, None
self.obs = (
ad.obs
) # provide access to observation annotations from the underlying AnnData object.
# treat all possible cases according to anndata doc... | def extract_data_from_anndata(self, ad: anndata.AnnData):
data, gene_names, batch_indices, cell_types, labels = None, None, None, None, None
self.obs = (
ad.obs
) # provide access to observation annotations from the underlying AnnData object.
if isinstance(ad.X, np.ndarray):
data = ad.... | https://github.com/YosefLab/scvi-tools/issues/288 | ---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
<ipython-input-3-138de299bfb8> in <module>
1 # load
2 dataset = AnnDataset('data/dataset.h5ad',
----> 3 save_path=path)
~/anaconda3/envs/pyro/lib/... | MemoryError |
def update_cells(self, subset_cells):
new_n_cells = (
len(subset_cells)
if subset_cells.dtype is not np.dtype("bool")
else subset_cells.sum()
)
print("Downsampling from %i to %i cells" % (len(self), new_n_cells))
for attr_name in [
"_X",
"labels",
"batch_i... | def update_cells(self, subset_cells):
new_n_cells = (
len(subset_cells)
if subset_cells.dtype is not np.dtype("bool")
else subset_cells.sum()
)
print("Downsampling from %i to %i cells" % (len(self), new_n_cells))
for attr_name in ["_X", "labels", "batch_indices", "local_means", "... | https://github.com/YosefLab/scvi-tools/issues/288 | ---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
<ipython-input-3-138de299bfb8> in <module>
1 # load
2 dataset = AnnDataset('data/dataset.h5ad',
----> 3 save_path=path)
~/anaconda3/envs/pyro/lib/... | MemoryError |
def get_attributes_from_matrix(X, batch_indices=0, labels=None):
ne_cells = X.sum(axis=1) > 0
to_keep = np.where(ne_cells)[0]
if not ne_cells.all():
X = X[to_keep]
removed_idx = np.where(~ne_cells)[0]
print(
"Cells with zero expression in all genes considered were removed... | def get_attributes_from_matrix(X, batch_indices=0, labels=None):
ne_cells = X.sum(axis=1) > 0
to_keep = np.where(ne_cells)
if not ne_cells.all():
X = X[to_keep]
removed_idx = np.where(~ne_cells)[0]
print(
"Cells with zero expression in all genes considered were removed, t... | https://github.com/YosefLab/scvi-tools/issues/288 | ---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
<ipython-input-3-138de299bfb8> in <module>
1 # load
2 dataset = AnnDataset('data/dataset.h5ad',
----> 3 save_path=path)
~/anaconda3/envs/pyro/lib/... | MemoryError |
def download(datapath):
model_name = "pretrained_transformers"
mdir = os.path.join(get_model_dir(datapath), model_name)
version = "v3.0"
if not built(mdir, version):
opt = {"datapath": datapath}
fnames = ["pretrained_transformers.tgz"]
download_models(opt, fnames, model_name, ver... | def download(datapath):
model_name = "pretrained_transformers"
mdir = os.path.join(get_model_dir(datapath), model_name)
version = "v2.0"
if not built(mdir, version):
opt = {"datapath": datapath}
fnames = ["pretrained_transformers.tgz"]
download_models(opt, fnames, model_name, ver... | https://github.com/facebookresearch/ParlAI/issues/1912 | model = torch.load('/Downloads/polyranker/model', map_location=lambda cpu, _: cpu)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/edinan/anaconda3/lib/python3.6/site-packages/torch/serialization.py", line 368, in load
return _load(f, map_location, pickle_module)
File "/Users/edinan/... | ModuleNotFoundError |
def main():
# Get command line arguments
argparser = ParlaiParser()
DictionaryAgent.add_cmdline_args(argparser)
ParsedRemoteAgent.add_cmdline_args(argparser)
argparser.add_argument("--num-examples", default=1000, type=int)
argparser.add_argument("--num-its", default=100, type=int)
argparser.... | def main():
# Get command line arguments
argparser = ParlaiParser()
DictionaryAgent.add_cmdline_args(argparser)
ParsedRemoteAgent.add_cmdline_args(argparser)
argparser.add_argument("--num-examples", default=1000, type=int)
argparser.add_argument("--num-its", default=100, type=int)
argparser.... | https://github.com/facebookresearch/ParlAI/issues/510 | [ training ]
lua thread bound to tcp://*:5557
lua thread bound to tcp://*:5558
lua thread bound to tcp://*:5559
lua thread bound to tcp://*:5560
lua thread bound to tcp://*:5561
lua thread bound to tcp://*:5562
lua thread bound to tcp://*:5563
[ exs: 1577 | time: 1s | mean_rank: 5.70 | resp_loss: 0.82 | rank_loss: 0.16... | AttributeError |
def get_delegated_roles_metadata_filenames(
metadata_directory, consistent_snapshot, storage_backend=None
):
"""
Return a dictionary containing all filenames in 'metadata_directory'
except the top-level roles.
If multiple versions of a file exist because of a consistent snapshot,
only the file w... | def get_delegated_roles_metadata_filenames(
metadata_directory, consistent_snapshot, storage_backend=None
):
"""
Return a dictionary containing all filenames in 'metadata_directory'
except the top-level roles.
If multiple versions of a file exist because of a consistent snapshot,
only the file w... | https://github.com/theupdateframework/tuf/issues/1069 | repository=load_repository("repository")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jku/src/tuf/tuf/repository_tool.py", line 3038, in load_repository
metadata_path = delegated_roles_filenames[rolename]
KeyError: '0' | KeyError |
def _download_file(url, required_length, STRICT_REQUIRED_LENGTH=True):
"""
<Purpose>
Given the url and length of the desired file, this function opens a
connection to 'url' and downloads the file while ensuring its length
matches 'required_length' if 'STRICT_REQUIRED_LENGH' is True (If False,
... | def _download_file(url, required_length, STRICT_REQUIRED_LENGTH=True):
"""
<Purpose>
Given the url and length of the desired file, this function opens a
connection to 'url' and downloads the file while ensuring its length
matches 'required_length' if 'STRICT_REQUIRED_LENGH' is True (If False,
... | https://github.com/theupdateframework/tuf/issues/1068 | <snip...>
http://127.0.0.1:80 "GET /tuf/2.bins.json HTTP/1.1" 200 None
ERROR: Could not get content length about <Response [200]> from server: int() can't convert non-string with explicit base
Traceback (most recent call last):
File "/home/jku/src/pip/venv/lib/python3.8/site-packages/tuf/download.py", line 432, in _get... | TypeError |
def _read(cls, path, engine, columns, **kwargs):
"""Load a parquet object from the file path, returning a Modin DataFrame.
Modin only supports pyarrow engine for now.
Parameters
----------
path: str
The filepath of the parquet file in local filesystem or hdfs.
engine: 'pyarrow'
... | def _read(cls, path, engine, columns, **kwargs):
"""Load a parquet object from the file path, returning a Modin DataFrame.
Modin only supports pyarrow engine for now.
Parameters
----------
path: str
The filepath of the parquet file in local filesystem or hdfs.
engine: 'pyarrow'
... | https://github.com/modin-project/modin/issues/1476 | Traceback (most recent call last):
File "modinTest.py", line 6, in <module>
modin_df = pd.read_parquet(path)
File "/home/srds/virtual_env/airflow_venv/lib/python3.6/site-packages/modin/pandas/io.py", line 42, in read_parquet
path=path, columns=columns, engine=engine, **kwargs
File "/home/srds/virtual_env/airflow_venv/l... | TypeError |
def _read(cls, filepath_or_buffer, **kwargs):
filepath_or_buffer = cls.get_path_or_buffer(filepath_or_buffer)
if isinstance(filepath_or_buffer, str):
if not cls.file_exists(filepath_or_buffer):
return cls.single_worker_read(filepath_or_buffer, **kwargs)
filepath_or_buffer = cls.get_p... | def _read(cls, filepath_or_buffer, **kwargs):
filepath_or_buffer = cls.get_path_or_buffer(filepath_or_buffer)
if isinstance(filepath_or_buffer, str):
if not cls.file_exists(filepath_or_buffer):
return cls.single_worker_read(filepath_or_buffer, **kwargs)
filepath_or_buffer = cls.get_p... | https://github.com/modin-project/modin/issues/2307 | TypeError Traceback (most recent call last)
<ipython-input-4-6eaf150bb793> in <module>()
----> 1 df = pd.read_csv('/tmp/tmp_csv.csv',usecols=column_selector)
2 df.head()
5 frames
/usr/local/lib/python3.6/dist-packages/modin/pandas/io.py in parser_func(filepath_or_buffer, sep, delimite... | TypeError |
def read_csv(
cls,
filepath_or_buffer,
sep=",",
delimiter=None,
header="infer",
names=None,
index_col=None,
usecols=None,
squeeze=False,
prefix=None,
mangle_dupe_cols=True,
dtype=None,
engine=None,
converters=None,
true_values=None,
false_values=None,
... | def read_csv(
cls,
filepath_or_buffer,
sep=",",
delimiter=None,
header="infer",
names=None,
index_col=None,
usecols=None,
squeeze=False,
prefix=None,
mangle_dupe_cols=True,
dtype=None,
engine=None,
converters=None,
true_values=None,
false_values=None,
... | https://github.com/modin-project/modin/issues/2737 | Traceback (most recent call last):
File "test.py", line 46, in <module>
df_equals(df_pandas, df_modin)
File "/modin/modin/pandas/test/utils.py", line 542, in df_equals
check_categorical=False,
File "/miniconda3/envs/modin_omnisci/lib/python3.7/site-packages/pandas/_testing.py", line 1704, in assert_frame_equal
atol=ato... | AssertionError |
def reindex(
self,
index=None,
columns=None,
copy=True,
**kwargs,
):
if (
kwargs.get("level") is not None
or (index is not None and self._query_compiler.has_multiindex())
or (columns is not None and self._query_compiler.has_multiindex(axis=1))
):
if index is n... | def reindex(
self,
labels=None,
index=None,
columns=None,
axis=None,
method=None,
copy=True,
level=None,
fill_value=np.nan,
limit=None,
tolerance=None,
):
axis = self._get_axis_number(axis)
if (columns is not None and self._query_compiler.has_multiindex(axis=1)) or (
... | https://github.com/modin-project/modin/issues/2735 | Traceback (most recent call last):
File "../rofl.py", line 5, in <module>
res = sr.reindex([1, 2, 3, 4, 5])
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/series.py", line 1040, in reindex
fill_value=fill_value,
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/base.py", line 1714, in reindex
tolerance=toler... | TypeError |
def _aggregate(self, func, *args, **kwargs):
_axis = kwargs.pop("_axis", 0)
kwargs.pop("_level", None)
if isinstance(func, str):
kwargs.pop("is_transform", None)
return self._string_function(func, *args, **kwargs)
# Dictionaries have complex behavior because they can be renamed here.
... | def _aggregate(self, arg, *args, **kwargs):
_axis = kwargs.pop("_axis", 0)
kwargs.pop("_level", None)
if isinstance(arg, str):
kwargs.pop("is_transform", None)
return self._string_function(arg, *args, **kwargs)
# Dictionaries have complex behavior because they can be renamed here.
... | https://github.com/modin-project/modin/issues/2305 | Traceback (most recent call last):
File "agg_test2.py", line 13, in <module>
df1 = df.agg(new_col=('col2', max))
File "/localdisk/gashiman/modin/modin/pandas/base.py", line 504, in aggregate
return self.apply(func, axis=axis, args=args, **kwargs)
File "/localdisk/gashiman/modin/modin/pandas/dataframe.py", line 289, in ... | TypeError |
def reindex(
self,
labels=None,
index=None,
columns=None,
axis=None,
method=None,
copy=True,
level=None,
fill_value=np.nan,
limit=None,
tolerance=None,
):
axis = self._get_axis_number(axis)
if (columns is not None and self._query_compiler.has_multiindex(axis=1)) or (
... | def reindex(
self,
labels=None,
index=None,
columns=None,
axis=None,
method=None,
copy=True,
level=None,
fill_value=np.nan,
limit=None,
tolerance=None,
):
axis = self._get_axis_number(axis)
if (
level is not None
or (
(columns is not None o... | https://github.com/modin-project/modin/issues/1806 | df = pandas.DataFrame({"foo": [1,2,3,4], "bar": ["a", "b", "c", "d"], "waldo": [11, 12, 13, 14]})
UserWarning: Distributing <class 'dict'> object. This may take some time.
df = df.set_index(["foo", "bar"])
df
waldo
foo bar
1 a 11
2 b 12
3 c 13
4 d 14
new_index = pandas.MultiIndex.from_pr... | TypeError |
def _copartition(self, axis, other, how, sort, force_repartition=False):
"""
Copartition two dataframes.
Perform aligning of partitions, index and partition blocks.
Parameters
----------
axis : 0 or 1
The axis to copartition along (0 - rows, 1 - columns).
other : BasePandasFrame
... | def _copartition(self, axis, other, how, sort, force_repartition=False):
"""
Copartition two dataframes.
Perform aligning of partitions, index and partition blocks.
Parameters
----------
axis : 0 or 1
The axis to copartition along (0 - rows, 1 - columns).
other : BasePandasFrame
... | https://github.com/modin-project/modin/issues/2709 | Traceback (most recent call last):
File "../rofl.py", line 10, in <module>
print(df) # Internal error
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/base.py", line 2741, in __str__
return repr(self)
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/dataframe.py", line 184, in __repr__
result = repr(self._bui... | Exception |
def _groupby_dict_reduce(
self, by, axis, agg_func, agg_args, agg_kwargs, groupby_kwargs, drop=False
):
map_dict = {}
reduce_dict = {}
rename_columns = any(
not isinstance(fn, str) and isinstance(fn, Iterable) for fn in agg_func.values()
)
for col, col_funcs in agg_func.items():
... | def _groupby_dict_reduce(
self, by, axis, agg_func, agg_args, agg_kwargs, groupby_kwargs, drop=False
):
map_dict = {}
reduce_dict = {}
rename_columns = any(
not isinstance(fn, str) and isinstance(fn, Iterable) for fn in agg_func.values()
)
for col, col_funcs in agg_func.items():
... | https://github.com/modin-project/modin/issues/2543 | Traceback (most recent call last):
File "../rofl.py", line 18, in <module>
df_equals(md_res, pd_res)
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/test/utils.py", line 527, in df_equals
check_categorical=False,
File "/localdisk/dchigare/miniconda3/envs/modin_tests/lib/python3.7/site-packages/pandas/_testing.py"... | AssertionError |
def aggregate(self, func=None, *args, **kwargs):
if self._axis != 0:
# This is not implemented in pandas,
# so we throw a different message
raise NotImplementedError("axis other than 0 is not supported")
if (
callable(func)
and isinstance(func, BuiltinFunctionType)
... | def aggregate(self, func=None, *args, **kwargs):
if self._axis != 0:
# This is not implemented in pandas,
# so we throw a different message
raise NotImplementedError("axis other than 0 is not supported")
if (
callable(func)
and isinstance(func, BuiltinFunctionType)
... | https://github.com/modin-project/modin/issues/2543 | Traceback (most recent call last):
File "../rofl.py", line 18, in <module>
df_equals(md_res, pd_res)
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/test/utils.py", line 527, in df_equals
check_categorical=False,
File "/localdisk/dchigare/miniconda3/envs/modin_tests/lib/python3.7/site-packages/pandas/_testing.py"... | AssertionError |
def unique(self):
return self.__constructor__(query_compiler=self._query_compiler.unique()).to_numpy()
| def unique(self):
return self._query_compiler.unique().to_numpy().squeeze()
| https://github.com/modin-project/modin/issues/2566 | ===PANDAS===
0 green
dtype: object
<class 'pandas.core.series.Series'>
['green']
<class 'numpy.ndarray'>
1
===MODIN===
0 green
dtype: object
<class 'modin.pandas.series.Series'>
green
<class 'numpy.ndarray'>
---------------------------------------------------------------------------
TypeError ... | TypeError |
def _broadcast_item(self, row_lookup, col_lookup, item, to_shape):
"""
Use numpy to broadcast or reshape item.
TODO: Add more details for this docstring template.
Parameters
----------
What arguments does this function have.
[
PARAMETER_NAME: PARAMETERS TYPES
Description.
]... | def _broadcast_item(self, row_lookup, col_lookup, item, to_shape):
"""
Use numpy to broadcast or reshape item.
TODO: Add more details for this docstring template.
Parameters
----------
What arguments does this function have.
[
PARAMETER_NAME: PARAMETERS TYPES
Description.
]... | https://github.com/modin-project/modin/issues/1620 | Traceback (most recent call last):
File "/home/yz/IdeaProjects/modin_test/test.py", line 10, in <module>
data.loc[:,['D','C']] = data.loc[:,['D','C']].astype('float')
File "/home/yz/anaconda3/lib/python3.7/site-packages/modin/pandas/indexing.py", line 275, in __setitem__
super(_LocIndexer, self).__setitem__(row_lookup... | ValueError |
def mean(self, axis, **kwargs):
if kwargs.get("level") is not None:
return self.default_to_pandas(pandas.DataFrame.mean, axis=axis, **kwargs)
skipna = kwargs.get("skipna", True)
# TODO-FIX: this function may work incorrectly with user-defined "numeric" values.
# Since `count(numeric_only=True)... | def mean(self, axis, **kwargs):
if kwargs.get("level") is not None:
return self.default_to_pandas(pandas.DataFrame.mean, axis=axis, **kwargs)
skipna = kwargs.get("skipna", True)
def map_apply_fn(ser, **kwargs):
try:
sum_result = ser.sum(skipna=skipna)
count_result =... | https://github.com/modin-project/modin/issues/2313 | Traceback (most recent call last):
File "../TESTS/t2.py", line 108, in <module>
df_equals(md_df.mean(axis=1), pd_df.mean(axis=1))
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/test/utils.py", line 520, in df_equals
assert_series_equal(df1, df2, check_dtype=False, check_series_type=False)
File "/localdisk/dchiga... | AssertionError |
def reduce_fn(df, **kwargs):
sum_cols = df["sum"] if axis else df.loc["sum"]
count_cols = df["count"] if axis else df.loc["count"]
if not isinstance(sum_cols, pandas.Series):
# If we got `NaN` as the result of the sum in any axis partition,
# then we must consider the whole sum as `NaN`, so... | def reduce_fn(df, **kwargs):
df.dropna(axis=1, inplace=True, how="any")
return build_applyier(reduce_apply_fn, axis=axis)(df)
| https://github.com/modin-project/modin/issues/2313 | Traceback (most recent call last):
File "../TESTS/t2.py", line 108, in <module>
df_equals(md_df.mean(axis=1), pd_df.mean(axis=1))
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/test/utils.py", line 520, in df_equals
assert_series_equal(df1, df2, check_dtype=False, check_series_type=False)
File "/localdisk/dchiga... | AssertionError |
def applyier(df, other):
concated = pandas.concat([df, other], axis=1, copy=False)
result = concated.pivot_table(
index=index,
values=values if len(values) > 0 else None,
columns=columns,
aggfunc=aggfunc,
fill_value=fill_value,
margins=margins,
dropna=drop... | def applyier(df, **kwargs):
result = df.apply(func, **applyier_kwargs)
return result.set_axis(df.axes[axis ^ 1], axis=0)
| https://github.com/modin-project/modin/issues/2313 | Traceback (most recent call last):
File "../TESTS/t2.py", line 108, in <module>
df_equals(md_df.mean(axis=1), pd_df.mean(axis=1))
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/test/utils.py", line 520, in df_equals
assert_series_equal(df1, df2, check_dtype=False, check_series_type=False)
File "/localdisk/dchiga... | AssertionError |
def _make_parser_func(sep):
"""
Create a parser function from the given sep.
Parameters
----------
sep: str
The separator default to use for the parser.
Returns
-------
A function object.
"""
def parser_func(
filepath_or_buffer: Union[str, pathlib.Path, IO[AnyS... | def _make_parser_func(sep):
"""
Create a parser function from the given sep.
Parameters
----------
sep: str
The separator default to use for the parser.
Returns
-------
A function object.
"""
def parser_func(
filepath_or_buffer: Union[str, pathlib.Path, IO[AnyS... | https://github.com/modin-project/modin/issues/2408 | Traceback (most recent call last):
File "/home/my_username/Documents/projects/profiling/main.py", line 13, in <module>
load_csv()
File "/home/my_username/anaconda3/envs/profiling/lib/python3.7/site-packages/memory_profiler.py", line 1142, in wrapper
val = prof(func)(*args, **kwargs)
File "/home/my_username/anaconda3/en... | TypeError |
def parser_func(
filepath_or_buffer: Union[str, pathlib.Path, IO[AnyStr]],
sep=sep,
delimiter=None,
header="infer",
names=None,
index_col=None,
usecols=None,
squeeze=False,
prefix=None,
mangle_dupe_cols=True,
dtype=None,
engine=None,
converters=None,
true_values=N... | def parser_func(
filepath_or_buffer: Union[str, pathlib.Path, IO[AnyStr]],
sep=sep,
delimiter=None,
header="infer",
names=None,
index_col=None,
usecols=None,
squeeze=False,
prefix=None,
mangle_dupe_cols=True,
dtype=None,
engine=None,
converters=None,
true_values=N... | https://github.com/modin-project/modin/issues/2408 | Traceback (most recent call last):
File "/home/my_username/Documents/projects/profiling/main.py", line 13, in <module>
load_csv()
File "/home/my_username/anaconda3/envs/profiling/lib/python3.7/site-packages/memory_profiler.py", line 1142, in wrapper
val = prof(func)(*args, **kwargs)
File "/home/my_username/anaconda3/en... | TypeError |
def _read(cls, io, **kwargs):
if kwargs.get("engine", None) is not None and kwargs.get("engine") != "openpyxl":
warnings.warn(
"Modin only implements parallel `read_excel` with `openpyxl` engine, "
'please specify `engine=None` or `engine="openpyxl"` to '
"use Modin's par... | def _read(cls, io, **kwargs):
if kwargs.get("engine", None) is not None and kwargs.get("engine") != "openpyxl":
warnings.warn(
"Modin only implements parallel `read_excel` with `openpyxl` engine, "
'please specify `engine=None` or `engine="openpyxl"` to '
"use Modin's par... | https://github.com/modin-project/modin/issues/2404 | pd.read_excel('test_emptyline.xlsx')
UserWarning: Parallel `read_excel` is a new feature! Please email bug_reports@modin.org if you run into any problems.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\foo\modin\pandas\dataframe.py", line 183, in __repr__
result = repr(self._build_repr_... | Exception |
def setitem(self, axis, key, value):
"""Set the column defined by `key` to the `value` provided.
Args:
key: The column name to set.
value: The value to set the column to.
Returns:
A new QueryCompiler
"""
return self._setitem(axis=axis, key=key, value=value, how=None)
| def setitem(self, axis, key, value):
"""Set the column defined by `key` to the `value` provided.
Args:
key: The column name to set.
value: The value to set the column to.
Returns:
A new QueryCompiler
"""
def setitem_builder(df, internal_indices=[]):
df = df.copy()... | https://github.com/modin-project/modin/issues/2442 | Traceback (most recent call last):
File "test_outer.py", line 13, in <module>
md_df["b"] = pd.Series(np.zeros(len(md_df))) # TypeError
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/dataframe.py", line 1978, in __setitem__
join="left",
File "/localdisk/dchigare/repos/modin_bp/modin/backends/pandas/query_compiler... | TypeError |
def _join_index_objects(axis, indexes, how, sort):
"""
Join the pair of index objects (columns or rows) by a given strategy.
Unlike Index.join() in Pandas, if axis is 1, the sort is
False, and how is "outer", the result will _not_ be sorted.
Parameters
----------
axis : 0 or 1
The ... | def _join_index_objects(axis, indexes, how, sort):
"""
Join the pair of index objects (columns or rows) by a given strategy.
Unlike Index.join() in Pandas, if axis is 1, the sort is
False, and how is "outer", the result will _not_ be sorted.
Parameters
----------
axis : 0 or 1
The ... | https://github.com/modin-project/modin/issues/2442 | Traceback (most recent call last):
File "test_outer.py", line 13, in <module>
md_df["b"] = pd.Series(np.zeros(len(md_df))) # TypeError
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/dataframe.py", line 1978, in __setitem__
join="left",
File "/localdisk/dchigare/repos/modin_bp/modin/backends/pandas/query_compiler... | TypeError |
def make_reindexer(do_reindex: bool, frame_idx: int):
# the order of the frames must match the order of the indexes
if not do_reindex:
return lambda df: df
if need_indexers:
assert indexers is not None
return lambda df: df._reindex_with_indexers(
{0: [joined_index, inde... | def make_reindexer(do_reindex: bool, frame_idx: int):
# the order of the frames must match the order of the indexes
if not do_reindex:
return lambda df: df
if is_duplicates:
assert indexers != []
return lambda df: df._reindex_with_indexers(
{0: [joined_index, indexers[f... | https://github.com/modin-project/modin/issues/2442 | Traceback (most recent call last):
File "test_outer.py", line 13, in <module>
md_df["b"] = pd.Series(np.zeros(len(md_df))) # TypeError
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/dataframe.py", line 1978, in __setitem__
join="left",
File "/localdisk/dchigare/repos/modin_bp/modin/backends/pandas/query_compiler... | TypeError |
def _copartition(self, axis, other, how, sort, force_repartition=False):
"""
Copartition two dataframes.
Perform aligning of partitions, index and partition blocks.
Parameters
----------
axis : 0 or 1
The axis to copartition along (0 - rows, 1 - columns).
other : BasePandasFrame
... | def _copartition(self, axis, other, how, sort, force_repartition=False):
"""
Copartition two dataframes.
Perform aligning of partitions, index and partition blocks.
Parameters
----------
axis : 0 or 1
The axis to copartition along (0 - rows, 1 - columns).
other : BasePandasFrame
... | https://github.com/modin-project/modin/issues/2442 | Traceback (most recent call last):
File "test_outer.py", line 13, in <module>
md_df["b"] = pd.Series(np.zeros(len(md_df))) # TypeError
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/dataframe.py", line 1978, in __setitem__
join="left",
File "/localdisk/dchigare/repos/modin_bp/modin/backends/pandas/query_compiler... | TypeError |
def concat(cls, axis, left_parts, right_parts):
"""Concatenate the blocks with another set of blocks.
Note: Assumes that the blocks are already the same shape on the
dimension being concatenated. A ValueError will be thrown if this
condition is not met.
Args:
axis: The axis to conc... | def concat(cls, axis, left_parts, right_parts):
"""Concatenate the blocks with another set of blocks.
Note: Assumes that the blocks are already the same shape on the
dimension being concatenated. A ValueError will be thrown if this
condition is not met.
Args:
axis: The axis to conc... | https://github.com/modin-project/modin/issues/2442 | Traceback (most recent call last):
File "test_outer.py", line 13, in <module>
md_df["b"] = pd.Series(np.zeros(len(md_df))) # TypeError
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/dataframe.py", line 1978, in __setitem__
join="left",
File "/localdisk/dchigare/repos/modin_bp/modin/backends/pandas/query_compiler... | TypeError |
def setitem(self, axis, key, value):
"""Set the column defined by `key` to the `value` provided.
Args:
key: The column name to set.
value: The value to set the column to.
Returns:
A new QueryCompiler
"""
if axis == 1 or not isinstance(value, type(self)):
return sup... | def setitem(self, axis, key, value):
"""Set the column defined by `key` to the `value` provided.
Args:
key: The column name to set.
value: The value to set the column to.
Returns:
A new QueryCompiler
"""
if axis == 1 or not isinstance(value, type(self)):
return sup... | https://github.com/modin-project/modin/issues/2442 | Traceback (most recent call last):
File "test_outer.py", line 13, in <module>
md_df["b"] = pd.Series(np.zeros(len(md_df))) # TypeError
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/dataframe.py", line 1978, in __setitem__
join="left",
File "/localdisk/dchigare/repos/modin_bp/modin/backends/pandas/query_compiler... | TypeError |
def insert(self, loc, column, value):
"""Insert new column data.
Args:
loc: Insertion index.
column: Column labels to insert.
value: Dtype object values to insert.
Returns:
A new DFAlgQueryCompiler with new data inserted.
"""
if isinstance(value, type(self)):
... | def insert(self, loc, column, value):
"""Insert new column data.
Args:
loc: Insertion index.
column: Column labels to insert.
value: Dtype object values to insert.
Returns:
A new DFAlgQueryCompiler with new data inserted.
"""
if is_list_like(value):
return s... | https://github.com/modin-project/modin/issues/2442 | Traceback (most recent call last):
File "test_outer.py", line 13, in <module>
md_df["b"] = pd.Series(np.zeros(len(md_df))) # TypeError
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/dataframe.py", line 1978, in __setitem__
join="left",
File "/localdisk/dchigare/repos/modin_bp/modin/backends/pandas/query_compiler... | TypeError |
def insert(self, loc, column, value, allow_duplicates=False):
if isinstance(value, (DataFrame, pandas.DataFrame)):
if len(value.columns) != 1:
raise ValueError("Wrong number of items passed 2, placement implies 1")
value = value.squeeze(axis=1)
if not self._query_compiler.lazy_execu... | def insert(self, loc, column, value, allow_duplicates=False):
if isinstance(value, (DataFrame, pandas.DataFrame)):
if len(value.columns) != 1:
raise ValueError("Wrong number of items passed 2, placement implies 1")
value = value.iloc[:, 0]
if isinstance(value, Series):
# TOD... | https://github.com/modin-project/modin/issues/2442 | Traceback (most recent call last):
File "test_outer.py", line 13, in <module>
md_df["b"] = pd.Series(np.zeros(len(md_df))) # TypeError
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/dataframe.py", line 1978, in __setitem__
join="left",
File "/localdisk/dchigare/repos/modin_bp/modin/backends/pandas/query_compiler... | TypeError |
def __setitem__(self, key, value):
if hashable(key) and key not in self.columns:
if isinstance(value, Series) and len(self.columns) == 0:
self._query_compiler = value._query_compiler.copy()
# Now that the data is appended, we need to update the column name for
# that colu... | def __setitem__(self, key, value):
if hashable(key) and key not in self.columns:
# Handle new column case first
if isinstance(value, Series):
if len(self.columns) == 0:
self._query_compiler = value._query_compiler.copy()
else:
self._create_or_u... | https://github.com/modin-project/modin/issues/2442 | Traceback (most recent call last):
File "test_outer.py", line 13, in <module>
md_df["b"] = pd.Series(np.zeros(len(md_df))) # TypeError
File "/localdisk/dchigare/repos/modin_bp/modin/pandas/dataframe.py", line 1978, in __setitem__
join="left",
File "/localdisk/dchigare/repos/modin_bp/modin/backends/pandas/query_compiler... | TypeError |
def aggregate(self, func=None, *args, **kwargs):
if self._axis != 0:
# This is not implemented in pandas,
# so we throw a different message
raise NotImplementedError("axis other than 0 is not supported")
if (
callable(func)
and isinstance(func, BuiltinFunctionType)
... | def aggregate(self, func=None, *args, **kwargs):
if self._axis != 0:
# This is not implemented in pandas,
# so we throw a different message
raise NotImplementedError("axis other than 0 is not supported")
relabeling_required = False
if isinstance(func, dict) or func is None:
... | https://github.com/modin-project/modin/issues/2463 | Traceback (most recent call last):
File "/localdisk/gashiman/modin/ci/benchmarks/test_benchmarks.py", line 206, in test_groupby_sum
result = benchmark.pedantic(
File "/nfs/site/home/gashiman/.local/lib/python3.8/site-packages/pytest_benchmark/fixture.py", line 139, in pedantic
return self._raw_pedantic(target, args=arg... | ray.exceptions.RayTaskError |
def call(cls, func, *call_args, **call_kwds):
def caller(query_compiler, other, *args, **kwargs):
axis = kwargs.get("axis", 0)
broadcast = kwargs.pop("broadcast", False)
join_type = call_kwds.get("join_type", "outer")
if isinstance(other, type(query_compiler)):
if broadca... | def call(cls, func, *call_args, **call_kwds):
def caller(query_compiler, other, *args, **kwargs):
axis = kwargs.get("axis", 0)
broadcast = kwargs.pop("broadcast", False)
if isinstance(other, type(query_compiler)):
if broadcast:
assert len(other.columns) == 1, (
... | https://github.com/modin-project/modin/issues/2133 | df = pd.DataFrame({"a":[1, 2 ,3]})
df.shift(-1).a / df.a
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-8-7cc3bcb4fa16> in <module>
1 df = pd.DataFrame({"a":[1, 2 ,3]})
----> 2 df.shift(-1).a / df.a
... | IndexError |
def caller(query_compiler, other, *args, **kwargs):
axis = kwargs.get("axis", 0)
broadcast = kwargs.pop("broadcast", False)
join_type = call_kwds.get("join_type", "outer")
if isinstance(other, type(query_compiler)):
if broadcast:
assert len(other.columns) == 1, (
"Inv... | def caller(query_compiler, other, *args, **kwargs):
axis = kwargs.get("axis", 0)
broadcast = kwargs.pop("broadcast", False)
if isinstance(other, type(query_compiler)):
if broadcast:
assert len(other.columns) == 1, (
"Invalid broadcast argument for `broadcast_apply`, too m... | https://github.com/modin-project/modin/issues/2133 | df = pd.DataFrame({"a":[1, 2 ,3]})
df.shift(-1).a / df.a
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-8-7cc3bcb4fa16> in <module>
1 df = pd.DataFrame({"a":[1, 2 ,3]})
----> 2 df.shift(-1).a / df.a
... | IndexError |
def broadcast_apply(
self, axis, func, other, join_type="left", preserve_labels=True, dtypes=None
):
"""
Broadcast partitions of other dataframe partitions and apply a function.
Parameters
----------
axis: int,
The axis to broadcast over.
func: callable,
The ... | def broadcast_apply(self, axis, func, other, preserve_labels=True, dtypes=None):
"""Broadcast partitions of other dataframe partitions and apply a function.
Args:
axis: The axis to broadcast over.
func: The function to apply.
other: The Modin DataFrame to broadcast.
preserve_lab... | https://github.com/modin-project/modin/issues/2133 | df = pd.DataFrame({"a":[1, 2 ,3]})
df.shift(-1).a / df.a
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-8-7cc3bcb4fa16> in <module>
1 df = pd.DataFrame({"a":[1, 2 ,3]})
----> 2 df.shift(-1).a / df.a
... | IndexError |
def _copartition(self, axis, other, how, sort, force_repartition=False):
"""
Copartition two dataframes.
Parameters
----------
axis : 0 or 1
The axis to copartition along (0 - rows, 1 - columns).
other : BasePandasFrame
The other dataframes(s) to copartition agai... | def _copartition(self, axis, other, how, sort, force_repartition=False):
"""
Copartition two dataframes.
Parameters
----------
axis : 0 or 1
The axis to copartition along (0 - rows, 1 - columns).
other : BasePandasFrame
The other dataframes(s) to copartition agai... | https://github.com/modin-project/modin/issues/2133 | df = pd.DataFrame({"a":[1, 2 ,3]})
df.shift(-1).a / df.a
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-8-7cc3bcb4fa16> in <module>
1 df = pd.DataFrame({"a":[1, 2 ,3]})
----> 2 df.shift(-1).a / df.a
... | IndexError |
def _binary_op(self, op, right_frame, join_type="outer"):
"""
Perform an operation that requires joining with another dataframe.
Parameters
----------
op : callable
The function to apply after the join.
right_frame : BasePandasFrame
The dataframe to join with.
... | def _binary_op(self, op, right_frame, join_type="outer"):
"""
Perform an operation that requires joining with another dataframe.
Parameters
----------
op : callable
The function to apply after the join.
right_frame : BasePandasFrame
The dataframe to join with.
... | https://github.com/modin-project/modin/issues/2133 | df = pd.DataFrame({"a":[1, 2 ,3]})
df.shift(-1).a / df.a
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-8-7cc3bcb4fa16> in <module>
1 df = pd.DataFrame({"a":[1, 2 ,3]})
----> 2 df.shift(-1).a / df.a
... | IndexError |
def _prepare_inter_op(self, other):
"""
Implement [METHOD_NAME].
TODO: Add more details for this docstring template.
Parameters
----------
What arguments does this function have.
[
PARAMETER_NAME: PARAMETERS TYPES
Description.
]
Returns
-------
What this return... | def _prepare_inter_op(self, other):
"""
Implement [METHOD_NAME].
TODO: Add more details for this docstring template.
Parameters
----------
What arguments does this function have.
[
PARAMETER_NAME: PARAMETERS TYPES
Description.
]
Returns
-------
What this return... | https://github.com/modin-project/modin/issues/2133 | df = pd.DataFrame({"a":[1, 2 ,3]})
df.shift(-1).a / df.a
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-8-7cc3bcb4fa16> in <module>
1 df = pd.DataFrame({"a":[1, 2 ,3]})
----> 2 df.shift(-1).a / df.a
... | IndexError |
def parse(fname, **kwargs):
num_splits = kwargs.pop("num_splits", None)
columns = kwargs.get("columns", None)
if fname.startswith("s3://"):
from botocore.exceptions import NoCredentialsError
import s3fs
try:
fs = s3fs.S3FileSystem()
fname = fs.open(fname)
... | def parse(fname, **kwargs):
num_splits = kwargs.pop("num_splits", None)
columns = kwargs.get("columns", None)
if num_splits is None:
return pandas.read_parquet(fname, **kwargs)
kwargs["use_pandas_metadata"] = True
df = pandas.read_parquet(fname, **kwargs)
if isinstance(df.index, pandas.R... | https://github.com/modin-project/modin/issues/1765 | ---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-14-814dc08ef229> in <module>
----> 1 df2 = mpd.read_parquet(path)
/opt/anaconda3/envs/myenv/lib/python3.7/site-packages/modin/pandas/io.py in read_parqu... | FileNotFoundError |
def _filter_empties(self):
"""Removes empty partitions to avoid triggering excess computation."""
if len(self.axes[0]) == 0 or len(self.axes[1]) == 0:
# This is the case for an empty frame. We don't want to completely remove
# all metadata and partitions so for the moment, we won't prune if the ... | def _filter_empties(self):
"""Removes empty partitions to avoid triggering excess computation."""
if len(self.axes[0]) == 0 or len(self.axes[1]) == 0:
# This is the case for an empty frame. We don't want to completely remove
# all metadata and partitions so for the moment, we won't prune if the ... | https://github.com/modin-project/modin/issues/1765 | ---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-14-814dc08ef229> in <module>
----> 1 df2 = mpd.read_parquet(path)
/opt/anaconda3/envs/myenv/lib/python3.7/site-packages/modin/pandas/io.py in read_parqu... | FileNotFoundError |
def _read(cls, path, engine, columns, **kwargs):
"""Load a parquet object from the file path, returning a Modin DataFrame.
Modin only supports pyarrow engine for now.
Parameters
----------
path: str
The filepath of the parquet file in local filesystem or hdfs.
engine: 'pyarrow'
... | def _read(cls, path, engine, columns, **kwargs):
"""Load a parquet object from the file path, returning a Modin DataFrame.
Modin only supports pyarrow engine for now.
Parameters
----------
path: str
The filepath of the parquet file in local filesystem or hdfs.
engine: 'pyarrow'
... | https://github.com/modin-project/modin/issues/1765 | ---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-14-814dc08ef229> in <module>
----> 1 df2 = mpd.read_parquet(path)
/opt/anaconda3/envs/myenv/lib/python3.7/site-packages/modin/pandas/io.py in read_parqu... | FileNotFoundError |
def value_counts(self, **kwargs):
"""
Return a QueryCompiler of Series containing counts of unique values.
Returns
-------
PandasQueryCompiler
"""
if kwargs.get("bins", None) is not None:
new_modin_frame = self._modin_frame._apply_full_axis(
0, lambda df: df.squeeze(axis... | def value_counts(self, **kwargs):
"""
Return a QueryCompiler of Series containing counts of unique values.
Returns
-------
PandasQueryCompiler
"""
if kwargs.get("bins", None) is not None:
new_modin_frame = self._modin_frame._apply_full_axis(
0, lambda df: df.squeeze(axis... | https://github.com/modin-project/modin/issues/1976 | Traceback (most recent call last):
File "test.py", line 15, in <module>
print(f"modin:\n{modin_df.sum(min_count=1)}")
File "modin\pandas\base.py", line 3512, in __str__
return repr(self)
File "modin\pandas\series.py", line 307, in __repr__
temp_df = self._build_repr_df(num_rows, num_cols)
File "modin\pandas\base.py", l... | Exception |
def map_func(df, *args, **kwargs):
return df.squeeze(axis=1).value_counts(**kwargs).to_frame()
| def map_func(df, *args, **kwargs):
return df.squeeze(axis=1).value_counts(**kwargs)
| https://github.com/modin-project/modin/issues/1976 | Traceback (most recent call last):
File "test.py", line 15, in <module>
print(f"modin:\n{modin_df.sum(min_count=1)}")
File "modin\pandas\base.py", line 3512, in __str__
return repr(self)
File "modin\pandas\series.py", line 307, in __repr__
temp_df = self._build_repr_df(num_rows, num_cols)
File "modin\pandas\base.py", l... | Exception |
def reduce_func(df, *args, **kwargs):
normalize = kwargs.get("normalize", False)
sort = kwargs.get("sort", True)
ascending = kwargs.get("ascending", False)
dropna = kwargs.get("dropna", True)
try:
result = df.squeeze(axis=1).groupby(df.index, sort=False).sum()
# This will happen with Ar... | def reduce_func(df, *args, **kwargs):
normalize = kwargs.get("normalize", False)
sort = kwargs.get("sort", True)
ascending = kwargs.get("ascending", False)
dropna = kwargs.get("dropna", True)
try:
result = df.squeeze(axis=1).groupby(df.index, sort=False).sum()
# This will happen with Ar... | https://github.com/modin-project/modin/issues/1976 | Traceback (most recent call last):
File "test.py", line 15, in <module>
print(f"modin:\n{modin_df.sum(min_count=1)}")
File "modin\pandas\base.py", line 3512, in __str__
return repr(self)
File "modin\pandas\series.py", line 307, in __repr__
temp_df = self._build_repr_df(num_rows, num_cols)
File "modin\pandas\base.py", l... | Exception |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.