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 cat(fname, fallback=_DEFAULT, binary=True):
"""Return file content.
fallback: the value returned in case the file does not exist or
cannot be read
binary: whether to open the file in binary or text mode.
"""
try:
with open_binary(fname) if binary else open_text(fname) as f:... | def cat(fname, fallback=_DEFAULT, binary=True):
"""Return file content.
fallback: the value returned in case the file does not exist or
cannot be read
binary: whether to open the file in binary or text mode.
"""
try:
with open_binary(fname) if binary else open_text(fname) as f:... | https://github.com/giampaolo/psutil/issues/1323 | Traceback (most recent call last):
File "/usr/lib/python-exec/python2.7/s-tui", line 11, in <module>
load_entry_point('s-tui==0.7.5', 'console_scripts', 's-tui')()
File "/usr/lib64/python2.7/site-packages/s_tui/s_tui.py", line 854, in main
graph_controller = GraphController(args)
File "/usr/lib64/python2.7/site-package... | ValueError |
def sensors_temperatures():
"""Return hardware (CPU and others) temperatures as a dict
including hardware name, label, current, max and critical
temperatures.
Implementation notes:
- /sys/class/hwmon looks like the most recent interface to
retrieve this info, and this implementation relies on... | def sensors_temperatures():
"""Return hardware (CPU and others) temperatures as a dict
including hardware name, label, current, max and critical
temperatures.
Implementation notes:
- /sys/class/hwmon looks like the most recent interface to
retrieve this info, and this implementation relies on... | https://github.com/giampaolo/psutil/issues/1323 | Traceback (most recent call last):
File "/usr/lib/python-exec/python2.7/s-tui", line 11, in <module>
load_entry_point('s-tui==0.7.5', 'console_scripts', 's-tui')()
File "/usr/lib64/python2.7/site-packages/s_tui/s_tui.py", line 854, in main
graph_controller = GraphController(args)
File "/usr/lib64/python2.7/site-package... | ValueError |
def _proc_cred(self):
@wrap_exceptions
def proc_cred(self):
return cext.proc_cred(self.pid, self._procfs_path)
return proc_cred(self)
| def _proc_cred(self):
return cext.proc_cred(self.pid, self._procfs_path)
| https://github.com/giampaolo/psutil/issues/1194 | p = psutil.Process(960)
p.name()
'xntpd'
p.nice()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/venv/lib/python3.5/site-packages/psutil/__init__.py", line 755, in nice
return self._proc.nice_get()
File "/path/to/venv/lib/python3.5/site-packages/psutil/_pssunos.py", line 346, in w... | OSError |
def nice_get(self):
# Note #1: getpriority(3) doesn't work for realtime processes.
# Psinfo is what ps uses, see:
# https://github.com/giampaolo/psutil/issues/1194
return self._proc_basic_info()[proc_info_map["nice"]]
| def nice_get(self):
# Note #1: for some reason getpriority(3) return ESRCH (no such
# process) for certain low-pid processes, no matter what (even
# as root).
# The process actually exists though, as it has a name,
# creation time, etc.
# The best thing we can do here appears to be raising AD.
... | https://github.com/giampaolo/psutil/issues/1194 | p = psutil.Process(960)
p.name()
'xntpd'
p.nice()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/venv/lib/python3.5/site-packages/psutil/__init__.py", line 755, in nice
return self._proc.nice_get()
File "/path/to/venv/lib/python3.5/site-packages/psutil/_pssunos.py", line 346, in w... | OSError |
def uids(self):
try:
real, effective, saved, _, _, _ = self._proc_cred()
except AccessDenied:
real = self._proc_basic_info()[proc_info_map["uid"]]
effective = self._proc_basic_info()[proc_info_map["euid"]]
saved = None
return _common.puids(real, effective, saved)
| def uids(self):
real, effective, saved, _, _, _ = self._proc_cred()
return _common.puids(real, effective, saved)
| https://github.com/giampaolo/psutil/issues/1194 | p = psutil.Process(960)
p.name()
'xntpd'
p.nice()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/venv/lib/python3.5/site-packages/psutil/__init__.py", line 755, in nice
return self._proc.nice_get()
File "/path/to/venv/lib/python3.5/site-packages/psutil/_pssunos.py", line 346, in w... | OSError |
def gids(self):
try:
_, _, _, real, effective, saved = self._proc_cred()
except AccessDenied:
real = self._proc_basic_info()[proc_info_map["gid"]]
effective = self._proc_basic_info()[proc_info_map["egid"]]
saved = None
return _common.puids(real, effective, saved)
| def gids(self):
_, _, _, real, effective, saved = self._proc_cred()
return _common.puids(real, effective, saved)
| https://github.com/giampaolo/psutil/issues/1194 | p = psutil.Process(960)
p.name()
'xntpd'
p.nice()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/venv/lib/python3.5/site-packages/psutil/__init__.py", line 755, in nice
return self._proc.nice_get()
File "/path/to/venv/lib/python3.5/site-packages/psutil/_pssunos.py", line 346, in w... | OSError |
def sensors_temperatures():
"""Return hardware (CPU and others) temperatures as a dict
including hardware name, label, current, max and critical
temperatures.
Implementation notes:
- /sys/class/hwmon looks like the most recent interface to
retrieve this info, and this implementation relies on... | def sensors_temperatures():
"""Return hardware (CPU and others) temperatures as a dict
including hardware name, label, current, max and critical
temperatures.
Implementation notes:
- /sys/class/hwmon looks like the most recent interface to
retrieve this info, and this implementation relies on... | https://github.com/giampaolo/psutil/issues/1245 | import psutil
psutil.sensors_temperatures()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/psutil/__init__.py", line 2195, in sensors_temperatures
rawdict = _psplatform.sensors_temperatures()
File "/usr/lib64/python2.7/site-packages/psutil/_pslinux.py", l... | IOError |
def wait(self, timeout=None):
if timeout is None:
cext_timeout = cext.INFINITE
else:
# WaitForSingleObject() expects time in milliseconds
cext_timeout = int(timeout * 1000)
while True:
ret = cext.proc_wait(self.pid, cext_timeout)
if ret == WAIT_TIMEOUT:
ra... | def wait(self, timeout=None):
if timeout is None:
cext_timeout = cext.INFINITE
else:
# WaitForSingleObject() expects time in milliseconds
cext_timeout = int(timeout * 1000)
ret = cext.proc_wait(self.pid, cext_timeout)
if ret == WAIT_TIMEOUT:
raise TimeoutExpired(timeout, ... | https://github.com/giampaolo/psutil/issues/1098 | Traceback (most recent call last):
File "c:\projects\psutil\psutil\tests\test_misc.py", line 923, in test_reap_children
reap_children()
File "c:\projects\psutil\psutil\tests\__init__.py", line 438, in reap_children
assert_gone(pid)
File "c:\projects\psutil\psutil\tests\__init__.py", line 388, in assert_gone
assert not ... | AssertionError |
def wait(self, timeout=None):
if timeout is None:
cext_timeout = cext.INFINITE
else:
# WaitForSingleObject() expects time in milliseconds
cext_timeout = int(timeout * 1000)
while True:
ret = cext.proc_wait(self.pid, cext_timeout)
if ret == WAIT_TIMEOUT:
ra... | def wait(self, timeout=None):
if timeout is None:
cext_timeout = cext.INFINITE
else:
# WaitForSingleObject() expects time in milliseconds
cext_timeout = int(timeout * 1000)
while True:
ret = cext.proc_wait(self.pid, cext_timeout)
if ret == WAIT_TIMEOUT:
ra... | https://github.com/giampaolo/psutil/issues/1098 | Traceback (most recent call last):
File "c:\projects\psutil\psutil\tests\test_misc.py", line 923, in test_reap_children
reap_children()
File "c:\projects\psutil\psutil\tests\__init__.py", line 438, in reap_children
assert_gone(pid)
File "c:\projects\psutil\psutil\tests\__init__.py", line 388, in assert_gone
assert not ... | AssertionError |
def nice_get(self):
# Note #1: for some reason getpriority(3) return ESRCH (no such
# process) for certain low-pid processes, no matter what (even
# as root).
# The process actually exists though, as it has a name,
# creation time, etc.
# The best thing we can do here appears to be raising AD.
... | def nice_get(self):
# For some reason getpriority(3) return ESRCH (no such process)
# for certain low-pid processes, no matter what (even as root).
# The process actually exists though, as it has a name,
# creation time, etc.
# The best thing we can do here appears to be raising AD.
# Note: test... | https://github.com/giampaolo/psutil/issues/1082 | ======================================================================
FAIL: psutil.tests.test_posix.TestProcess.test_nice
----------------------------------------------------------------------
Traceback (most recent call last):
File "psutil/tests/test_posix.py", line 208, in test_nice
self.assertEqual(ps_nice, psutil_... | AssertionError |
def sensors_battery():
"""Return battery info."""
try:
percent, minsleft, power_plugged = cext.sensors_battery()
except NotImplementedError:
# see: https://github.com/giampaolo/psutil/issues/1074
return None
power_plugged = power_plugged == 1
if power_plugged:
secslef... | def sensors_battery():
"""Return battery info."""
percent, minsleft, power_plugged = cext.sensors_battery()
power_plugged = power_plugged == 1
if power_plugged:
secsleft = _common.POWER_TIME_UNLIMITED
elif minsleft == -1:
secsleft = _common.POWER_TIME_UNKNOWN
else:
secsle... | https://github.com/giampaolo/psutil/issues/1074 | #PYTHONPATH=/usr/src/psutil python2 psutil/tests/test_connections.py
Traceback (most recent call last):
File "psutil/tests/test_connections.py", line 30, in <module>
from psutil.tests import AF_UNIX
File "/usr/src/psutil/psutil/tests/__init__.py", line 156, in <module>
HAS_BATTERY = HAS_SENSORS_BATTERY and psutil.sens... | OSError |
def pid_exists(pid):
"""Check for the existence of a unix PID."""
if not _psposix.pid_exists(pid):
return False
else:
# Linux's apparently does not distinguish between PIDs and TIDs
# (thread IDs).
# listdir("/proc") won't show any TID (only PIDs) but
# os.stat("/proc... | def pid_exists(pid):
"""Check For the existence of a unix pid."""
return _psposix.pid_exists(pid)
| https://github.com/giampaolo/psutil/issues/687 | Traceback (most recent call last):
File "/home/giampaolo/svn/psutil/test/test_psutil.py", line 738, in test_pid_exists_range
assert not os.path.exists('/proc/%s' % pid), pid
AssertionError: 947 | AssertionError |
def swap_memory():
"""System swap memory as (total, used, free, sin, sout) namedtuple."""
total, used, free, sin, sout = cext.swap_mem()
percent = usage_percent(used, total, _round=1)
return _common.sswap(total, used, free, percent, sin, sout)
| def swap_memory():
"""System swap memory as (total, used, free, sin, sout) namedtuple."""
pagesize = 1 if OPENBSD else PAGESIZE
total, used, free, sin, sout = [x * pagesize for x in cext.swap_mem()]
percent = usage_percent(used, total, _round=1)
return _common.sswap(total, used, free, percent, sin, ... | https://github.com/giampaolo/psutil/issues/918 | ======================================================================
FAIL: test_bsd.NetBSDSpecificTestCase.test_swapmem_free
----------------------------------------------------------------------
Traceback (most recent call last):
File "/vagrant/psutil/psutil/tests/test_bsd.py", line 401, in test_swapmem_free
psutil.... | AssertionError |
def cpu_affinity_set(self, cpus):
try:
cext.proc_cpu_affinity_set(self.pid, cpus)
except (OSError, ValueError) as err:
if isinstance(err, ValueError) or err.errno == errno.EINVAL:
allcpus = tuple(range(len(per_cpu_times())))
for cpu in cpus:
if cpu not in ... | def cpu_affinity_set(self, cpus):
try:
cext.proc_cpu_affinity_set(self.pid, cpus)
except OSError as err:
if err.errno == errno.EINVAL:
allcpus = tuple(range(len(per_cpu_times())))
for cpu in cpus:
if cpu not in allcpus:
raise ValueError... | https://github.com/giampaolo/psutil/issues/892 | ~/svn/psutil {master}$ python3 -c "import psutil; psutil.Process().cpu_affinity([-1])"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/giampaolo/svn/psutil/psutil/__init__.py", line 764, in cpu_affinity
self._proc.cpu_affinity_set(list(set(cpus)))
File "/home/giampaolo/svn/psutil/psu... | SystemError |
def process_unix(self, file, family, inodes, filter_pid=None):
"""Parse /proc/net/unix files."""
with open_text(file, buffering=BIGGER_FILE_BUFFERING) as f:
f.readline() # skip the first line
for line in f:
tokens = line.split()
try:
_, _, _, _, type_, _,... | def process_unix(self, file, family, inodes, filter_pid=None):
"""Parse /proc/net/unix files."""
with open_text(file, buffering=BIGGER_FILE_BUFFERING) as f:
f.readline() # skip the first line
for line in f:
tokens = line.split()
try:
_, _, _, _, type_, _,... | https://github.com/giampaolo/psutil/issues/766 | Could not find neovim socket error while parsing /proc/net/unix; malformed line '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0... | ValueError |
def process_inet(self, file, family, type_, inodes, filter_pid=None):
"""Parse /proc/net/tcp* and /proc/net/udp* files."""
if file.endswith("6") and not os.path.exists(file):
# IPv6 not supported
return
with open_text(file, buffering=BIGGER_FILE_BUFFERING) as f:
f.readline() # skip ... | def process_inet(self, file, family, type_, inodes, filter_pid=None):
"""Parse /proc/net/tcp* and /proc/net/udp* files."""
if file.endswith("6") and not os.path.exists(file):
# IPv6 not supported
return
with open_text(file, buffering=BIGGER_FILE_BUFFERING) as f:
f.readline() # skip ... | https://github.com/giampaolo/psutil/issues/766 | Could not find neovim socket error while parsing /proc/net/unix; malformed line '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0... | ValueError |
def memory_maps(self):
"""Return process's mapped memory regions as a list of named tuples.
Fields are explained in 'man proc'; here is an updated (Apr 2012)
version: http://goo.gl/fmebo
"""
with open_text(
"%s/%s/smaps" % (self._procfs_path, self.pid), buffering=BIGGER_FILE_BUFFERING
) ... | def memory_maps(self):
"""Return process's mapped memory regions as a list of named tuples.
Fields are explained in 'man proc'; here is an updated (Apr 2012)
version: http://goo.gl/fmebo
"""
with open_text(
"%s/%s/smaps" % (self._procfs_path, self.pid), buffering=BIGGER_FILE_BUFFERING
) ... | https://github.com/giampaolo/psutil/issues/759 | ======================================================================
FAIL: test_memory_maps (test_process.TestProcess)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/giampaolo/svn/psutil/psutil/tests/test_process.py", line 601, in test_memory_maps... | AssertionError |
def get_ethtool_macro():
# see: https://github.com/giampaolo/psutil/issues/659
from distutils.unixccompiler import UnixCCompiler
from distutils.errors import CompileError
with tempfile.NamedTemporaryFile(suffix=".c", delete=False, mode="wt") as f:
f.write("#include <linux/ethtool.h>")
@ate... | def get_ethtool_macro():
# see: https://github.com/giampaolo/psutil/issues/659
from distutils.unixccompiler import UnixCCompiler
from distutils.errors import CompileError
with tempfile.NamedTemporaryFile(suffix=".c", delete=False, mode="wt") as f:
f.write("#include <linux/ethtool.h>")
atexi... | https://github.com/giampaolo/psutil/issues/677 | root@ip-10-0-2-186:/home/ubuntu# easy_install psutil==3.2.0
Searching for psutil==3.2.0
Reading https://pypi.python.org/simple/psutil/
Best match: psutil 3.2.0
Downloading https://pypi.python.org/packages/source/p/psutil/psutil-3.2.0.tar.gz#md5=224c2bb432003d74d022ced4409df1bc
Processing psutil-3.2.0.tar.gz
Writing /tm... | TypeError |
def process_inet(self, file, family, type_, inodes, filter_pid=None):
"""Parse /proc/net/tcp* and /proc/net/udp* files."""
if file.endswith("6") and not os.path.exists(file):
# IPv6 not supported
return
kw = dict(encoding=DEFAULT_ENCODING) if PY3 else dict()
with open(file, "rt", **kw) a... | def process_inet(self, file, family, type_, inodes, filter_pid=None):
"""Parse /proc/net/tcp* and /proc/net/udp* files."""
if file.endswith("6") and not os.path.exists(file):
# IPv6 not supported
return
with open(file, "rt") as f:
f.readline() # skip the first line
for line ... | https://github.com/giampaolo/psutil/issues/675 | NVIM detected
Retreived terminal pid 13109, nvim should be one of its children
proc name rxvt-unicode with 5 children
child name & pid rxvt-unicode/13110
child name & pid zsh/13111
child name & pid nvim/13272
Could not find neovim socket 'utf-8' codec can't decode byte 0xd7 in position 469: invalid continua... | UnicodeDecodeError |
def process_unix(self, file, family, inodes, filter_pid=None):
"""Parse /proc/net/unix files."""
kw = dict(encoding=DEFAULT_ENCODING) if PY3 else dict()
with open(file, "rt", **kw) as f:
f.readline() # skip the first line
for line in f:
tokens = line.split()
try:
... | def process_unix(self, file, family, inodes, filter_pid=None):
"""Parse /proc/net/unix files."""
with open(file, "rt") as f:
f.readline() # skip the first line
for line in f:
tokens = line.split()
try:
_, _, _, _, type_, _, inode = tokens[0:7]
... | https://github.com/giampaolo/psutil/issues/675 | NVIM detected
Retreived terminal pid 13109, nvim should be one of its children
proc name rxvt-unicode with 5 children
child name & pid rxvt-unicode/13110
child name & pid zsh/13111
child name & pid nvim/13272
Could not find neovim socket 'utf-8' codec can't decode byte 0xd7 in position 469: invalid continua... | UnicodeDecodeError |
def process_unix(self, file, family, inodes, filter_pid=None):
"""Parse /proc/net/unix files."""
# see: https://github.com/giampaolo/psutil/issues/675
kw = dict(encoding=FS_ENCODING, errors="replace") if PY3 else dict()
with open(file, "rt", **kw) as f:
f.readline() # skip the first line
... | def process_unix(self, file, family, inodes, filter_pid=None):
"""Parse /proc/net/unix files."""
with open_text(file) as f:
f.readline() # skip the first line
for line in f:
tokens = line.split()
try:
_, _, _, _, type_, _, inode = tokens[0:7]
... | https://github.com/giampaolo/psutil/issues/675 | NVIM detected
Retreived terminal pid 13109, nvim should be one of its children
proc name rxvt-unicode with 5 children
child name & pid rxvt-unicode/13110
child name & pid zsh/13111
child name & pid nvim/13272
Could not find neovim socket 'utf-8' codec can't decode byte 0xd7 in position 469: invalid continua... | UnicodeDecodeError |
def poll(interval):
"""Calculate IO usage by comparing IO statics before and
after the interval.
Return a tuple including all currently running processes
sorted by IO activity and total disks I/O activity.
"""
# first get a list of all processes and disk io counters
procs = [p for p in psuti... | def poll(interval):
"""Calculate IO usage by comparing IO statics before and
after the interval.
Return a tuple including all currently running processes
sorted by IO activity and total disks I/O activity.
"""
# first get a list of all processes and disk io counters
procs = [p for p in psuti... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def run(pid):
ACCESS_DENIED = ""
try:
p = psutil.Process(pid)
pinfo = p.as_dict(ad_value=ACCESS_DENIED)
except psutil.NoSuchProcess as err:
sys.exit(str(err))
try:
parent = p.parent()
if parent:
parent = "(%s)" % parent.name()
else:
... | def run(pid):
ACCESS_DENIED = ""
try:
p = psutil.Process(pid)
pinfo = p.as_dict(ad_value=ACCESS_DENIED)
except psutil.NoSuchProcess as err:
sys.exit(str(err))
try:
parent = p.parent()
if parent:
parent = "(%s)" % parent.name()
else:
... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def main():
# construct a dict where 'values' are all the processes
# having 'key' as their parent
tree = collections.defaultdict(list)
for p in psutil.process_iter():
try:
tree[p.ppid()].append(p.pid)
except (psutil.NoSuchProcess, psutil.ZombieProcess):
pass
... | def main():
# construct a dict where 'values' are all the processes
# having 'key' as their parent
tree = collections.defaultdict(list)
for p in psutil.process_iter():
try:
tree[p.ppid()].append(p.pid)
except psutil.NoSuchProcess:
pass
# on systems supporting ... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def _init(self, pid, _ignore_nsp=False):
if pid is None:
pid = os.getpid()
else:
if not _PY3 and not isinstance(pid, (int, long)):
raise TypeError("pid must be an integer (got %r)" % pid)
if pid < 0:
raise ValueError("pid must be a positive integer (got %s)" % pid... | def _init(self, pid, _ignore_nsp=False):
if pid is None:
pid = os.getpid()
else:
if not _PY3 and not isinstance(pid, (int, long)):
raise TypeError("pid must be an integer (got %r)" % pid)
if pid < 0:
raise ValueError("pid must be a positive integer (got %s)" % pid... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def __str__(self):
try:
pid = self.pid
name = repr(self.name())
except ZombieProcess:
details = "(pid=%s (zombie))" % self.pid
except NoSuchProcess:
details = "(pid=%s (terminated))" % self.pid
except AccessDenied:
details = "(pid=%s)" % (self.pid)
else:
... | def __str__(self):
try:
pid = self.pid
name = repr(self.name())
except NoSuchProcess:
details = "(pid=%s (terminated))" % self.pid
except AccessDenied:
details = "(pid=%s)" % (self.pid)
else:
details = "(pid=%s, name=%s)" % (pid, name)
return "%s.%s%s" % (self... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def as_dict(self, attrs=None, ad_value=None):
"""Utility method returning process information as a
hashable dictionary.
If 'attrs' is specified it must be a list of strings
reflecting available Process class' attribute names
(e.g. ['cpu_times', 'name']) else all public (read
only) attributes ar... | def as_dict(self, attrs=None, ad_value=None):
"""Utility method returning process information as a
hashable dictionary.
If 'attrs' is specified it must be a list of strings
reflecting available Process class' attribute names
(e.g. ['cpu_times', 'name']) else all public (read
only) attributes ar... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def status(self):
"""The process current status as a STATUS_* constant."""
try:
return self._proc.status()
except ZombieProcess:
return STATUS_ZOMBIE
| def status(self):
"""The process current status as a STATUS_* constant."""
return self._proc.status()
| https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def children(self, recursive=False):
"""Return the children of this process as a list of Process
instances, pre-emptively checking whether PID has been reused.
If recursive is True return all the parent descendants.
Example (A == this process):
A ─┐
│
├─ B (child) ─┐
│ ... | def children(self, recursive=False):
"""Return the children of this process as a list of Process
instances, pre-emptively checking whether PID has been reused.
If recursive is True return all the parent descendants.
Example (A == this process):
A ─┐
│
├─ B (child) ─┐
│ ... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def wrap_exceptions(fun):
"""Decorator which translates bare OSError exceptions into
NoSuchProcess and AccessDenied.
"""
@functools.wraps(fun)
def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except OSError as err:
# support for priv... | def wrap_exceptions(fun):
"""Decorator which translates bare OSError exceptions into
NoSuchProcess and AccessDenied.
"""
@functools.wraps(fun)
def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except OSError as err:
# support for priv... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except OSError as err:
# support for private module import
if NoSuchProcess is None or AccessDenied is None or ZombieProcess is None:
raise
if err.errno == errno.ESRCH:
if not pid_e... | def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except OSError as err:
# support for private module import
if NoSuchProcess is None or AccessDenied is None:
raise
if err.errno == errno.ESRCH:
raise NoSuchProcess(self.pid, self._n... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def wrap_exceptions(fun):
"""Call callable into a try/except clause and translate ENOENT,
EACCES and EPERM in NoSuchProcess or AccessDenied exceptions.
"""
def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except EnvironmentError as err:
... | def wrap_exceptions(fun):
"""Call callable into a try/except clause and translate ENOENT,
EACCES and EPERM in NoSuchProcess or AccessDenied exceptions.
"""
def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except EnvironmentError as err:
... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except EnvironmentError as err:
# support for private module import
if NoSuchProcess is None or AccessDenied is None or ZombieProcess is None:
raise
# ENOENT (no such file or directory) gets ra... | def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except EnvironmentError as err:
# support for private module import
if NoSuchProcess is None or AccessDenied is None:
raise
# ENOENT (no such file or directory) gets raised on open().
#... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def __init__(self, pid, name=None, ppid=None, msg=None):
Error.__init__(self)
self.pid = pid
self.ppid = ppid
self.name = name
self.msg = msg
if msg is None:
if name and ppid:
details = "(pid=%s, name=%s, ppid=%s)" % (
self.pid,
repr(self.name)... | def __init__(self, pid, name=None, msg=None):
Error.__init__(self)
self.pid = pid
self.name = name
self.msg = msg
if msg is None:
if name:
details = "(pid=%s, name=%s)" % (self.pid, repr(self.name))
else:
details = "(pid=%s)" % self.pid
self.msg = "pro... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def ppid(self):
"""The process parent PID.
On Windows the return value is cached after first call.
"""
# On POSIX we don't want to cache the ppid as it may unexpectedly
# change to 1 (init) in case this process turns into a zombie:
# https://github.com/giampaolo/psutil/issues/321
# http://st... | def ppid(self):
"""The process parent PID.
On Windows the return value is cached after first call.
"""
# On POSIX we don't want to cache the ppid as it may unexpectedly
# change to 1 (init) in case this process turns into a zombie:
# https://github.com/giampaolo/psutil/issues/321
# http://st... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def wrap_exceptions(fun):
"""Decorator which translates bare OSError exceptions into
NoSuchProcess and AccessDenied.
"""
@functools.wraps(fun)
def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except OSError as err:
# support for priv... | def wrap_exceptions(fun):
"""Decorator which translates bare OSError exceptions into
NoSuchProcess and AccessDenied.
"""
@functools.wraps(fun)
def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except OSError as err:
# support for priv... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except OSError as err:
# support for private module import
if NoSuchProcess is None or AccessDenied is None or ZombieProcess is None:
raise
if err.errno == errno.ESRCH:
if not pid_e... | def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except OSError as err:
# support for private module import
if NoSuchProcess is None or AccessDenied is None or ZombieProcess is None:
raise
if err.errno == errno.ESRCH:
if not pid_e... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def __init__(self, pid):
self.pid = pid
self._name = None
self._ppid = None
| def __init__(self, pid):
self.pid = pid
self._name = None
| https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def wrap_exceptions_w_zombie(fun):
"""Same as above but also handles zombies."""
@functools.wraps(fun)
def wrapper(self, *args, **kwargs):
try:
return wrap_exceptions(fun)(self)
except NoSuchProcess:
if not pid_exists(self.pid):
raise
else... | def wrap_exceptions_w_zombie(fun):
"""Same as above but also handles zombies."""
@functools.wraps(fun)
def wrapper(self, *args, **kwargs):
try:
return wrap_exceptions(fun)(self)
except NoSuchProcess:
if not pid_exists(self.pid):
raise
else... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def wrapper(self, *args, **kwargs):
try:
return wrap_exceptions(fun)(self)
except NoSuchProcess:
if not pid_exists(self.pid):
raise
else:
raise ZombieProcess(self.pid, self._name, self._ppid)
| def wrapper(self, *args, **kwargs):
try:
return wrap_exceptions(fun)(self)
except NoSuchProcess:
if not pid_exists(self.pid):
raise
else:
raise ZombieProcess(self.pid, self._name)
| https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def exe(self):
try:
exe = os.readlink("/proc/%s/exe" % self.pid)
except (OSError, IOError) as err:
if err.errno in (errno.ENOENT, errno.ESRCH):
# no such file error; might be raised also if the
# path actually exists for system processes with
# low pids (about... | def exe(self):
try:
exe = os.readlink("/proc/%s/exe" % self.pid)
except (OSError, IOError) as err:
if err.errno in (errno.ENOENT, errno.ESRCH):
# no such file error; might be raised also if the
# path actually exists for system processes with
# low pids (about... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def rlimit(self, resource, limits=None):
# if pid is 0 prlimit() applies to the calling process and
# we don't want that
if self.pid == 0:
raise ValueError("can't use prlimit() against PID 0 process")
try:
if limits is None:
# get
return cext.linux_prlimit(self.pi... | def rlimit(self, resource, limits=None):
# if pid is 0 prlimit() applies to the calling process and
# we don't want that
if self.pid == 0:
raise ValueError("can't use prlimit() against PID 0 process")
try:
if limits is None:
# get
return cext.linux_prlimit(self.pi... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def wrap_exceptions(fun):
"""Call callable into a try/except clause and translate ENOENT,
EACCES and EPERM in NoSuchProcess or AccessDenied exceptions.
"""
def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except EnvironmentError as err:
... | def wrap_exceptions(fun):
"""Call callable into a try/except clause and translate ENOENT,
EACCES and EPERM in NoSuchProcess or AccessDenied exceptions.
"""
def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except EnvironmentError as err:
... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except EnvironmentError as err:
# support for private module import
if NoSuchProcess is None or AccessDenied is None or ZombieProcess is None:
raise
# ENOENT (no such file or directory) gets ra... | def wrapper(self, *args, **kwargs):
try:
return fun(self, *args, **kwargs)
except EnvironmentError as err:
# support for private module import
if NoSuchProcess is None or AccessDenied is None or ZombieProcess is None:
raise
# ENOENT (no such file or directory) gets ra... | https://github.com/giampaolo/psutil/issues/428 | How to reproduce:
1. start Photoshop CS6 on a Mountain Lion OSX
2. import psutil; [x.as_dict() for x in psutil.process_iter()] # (in .py file, ipython)
What is the expected output?
A long list of processes and related information
What do you see instead?
$ python test.py
Traceback (most recent call last):
File... | psutil._error.NoSuchProcess |
def cpu_affinity(self, cpus=None):
"""Get or set process CPU affinity.
If specified 'cpus' must be a list of CPUs for which you
want to set the affinity (e.g. [0, 1]).
(Windows, Linux and BSD only).
"""
if cpus is None:
return self._proc.cpu_affinity_get()
else:
self._proc.cp... | def cpu_affinity(self, cpus=None):
"""Get or set process CPU affinity.
If specified 'cpus' must be a list of CPUs for which you
want to set the affinity (e.g. [0, 1]).
"""
if cpus is None:
return self._proc.cpu_affinity_get()
else:
self._proc.cpu_affinity_set(cpus)
| https://github.com/giampaolo/psutil/issues/569 | ======================================================================
FAIL: test_cpu_count_physical (__main__.TestModuleFunctionsLeaks)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test/test_memory_leaks.py", line 340, in test_cpu_count_physical
self.e... | AssertionError |
def preprocess_and_wrap(
broadcast=None, wrap_like=None, match_unit=False, to_magnitude=False
):
"""Return decorator to wrap array calculations for type flexibility.
Assuming you have a calculation that works internally with `pint.Quantity` or
`numpy.ndarray`, this will wrap the function to be able to ... | def preprocess_and_wrap(
broadcast=None, wrap_like=None, match_unit=False, to_magnitude=False
):
"""Return decorator to wrap array calculations for type flexibility.
Assuming you have a calculation that works internally with `pint.Quantity` or
`numpy.ndarray`, this will wrap the function to be able to ... | https://github.com/Unidata/MetPy/issues/1603 | Traceback (most recent call last):
File "moist_4panel.py", line 168, in <module>
pw[x,y] = mpcalc.precipitable_water(ds['P'].isel(latitude=x,longitude=y),ds['TD'].isel(latitude=x,longitude=y),bottom=pbot,top=ptop).m
File "/d1/anaconda3/envs/era5/lib/python3.8/site-packages/metpy/xarray.py", line 1174, in wrapper
return... | ValueError |
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
# Auto-broadcast select xarray arguments, and update bound_args
if broadcast is not None:
arg_names_to_broadcast = tuple(
arg_name
... | def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
# Auto-broadcast select xarray arguments, and update bound_args
if broadcast is not None:
arg_names_to_broadcast = tuple(
arg_name
... | https://github.com/Unidata/MetPy/issues/1603 | Traceback (most recent call last):
File "moist_4panel.py", line 168, in <module>
pw[x,y] = mpcalc.precipitable_water(ds['P'].isel(latitude=x,longitude=y),ds['TD'].isel(latitude=x,longitude=y),bottom=pbot,top=ptop).m
File "/d1/anaconda3/envs/era5/lib/python3.8/site-packages/metpy/xarray.py", line 1174, in wrapper
return... | ValueError |
def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
# Auto-broadcast select xarray arguments, and update bound_args
if broadcast is not None:
arg_names_to_broadcast = tuple(
arg_name
for arg_name in broadcast
if arg_name in bound_args... | def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
# Auto-broadcast select xarray arguments, and update bound_args
if broadcast is not None:
arg_names_to_broadcast = tuple(
arg_name
for arg_name in broadcast
if arg_name in bound_args... | https://github.com/Unidata/MetPy/issues/1603 | Traceback (most recent call last):
File "moist_4panel.py", line 168, in <module>
pw[x,y] = mpcalc.precipitable_water(ds['P'].isel(latitude=x,longitude=y),ds['TD'].isel(latitude=x,longitude=y),bottom=pbot,top=ptop).m
File "/d1/anaconda3/envs/era5/lib/python3.8/site-packages/metpy/xarray.py", line 1174, in wrapper
return... | ValueError |
def add_grid_arguments_from_xarray(func):
"""Fill in optional arguments like dx/dy from DataArray arguments."""
@functools.wraps(func)
def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
bound_args.apply_defaults()
# Search for DataArray with valid lati... | def add_grid_arguments_from_xarray(func):
"""Fill in optional arguments like dx/dy from DataArray arguments."""
@functools.wraps(func)
def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
bound_args.apply_defaults()
# Search for DataArray with valid lati... | https://github.com/Unidata/MetPy/issues/1603 | Traceback (most recent call last):
File "moist_4panel.py", line 168, in <module>
pw[x,y] = mpcalc.precipitable_water(ds['P'].isel(latitude=x,longitude=y),ds['TD'].isel(latitude=x,longitude=y),bottom=pbot,top=ptop).m
File "/d1/anaconda3/envs/era5/lib/python3.8/site-packages/metpy/xarray.py", line 1174, in wrapper
return... | ValueError |
def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
bound_args.apply_defaults()
# Search for DataArray with valid latitude and longitude coordinates to find grid
# deltas and any other needed parameter
grid_prototype = None
for da in dataarray_arguments(bound_args):... | def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
bound_args.apply_defaults()
# Search for DataArray with valid latitude and longitude coordinates to find grid
# deltas and any other needed parameter
dataarray_arguments = [
value
for value in bound_arg... | https://github.com/Unidata/MetPy/issues/1603 | Traceback (most recent call last):
File "moist_4panel.py", line 168, in <module>
pw[x,y] = mpcalc.precipitable_water(ds['P'].isel(latitude=x,longitude=y),ds['TD'].isel(latitude=x,longitude=y),bottom=pbot,top=ptop).m
File "/d1/anaconda3/envs/era5/lib/python3.8/site-packages/metpy/xarray.py", line 1174, in wrapper
return... | ValueError |
def add_vertical_dim_from_xarray(func):
"""Fill in optional vertical_dim from DataArray argument."""
@functools.wraps(func)
def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
bound_args.apply_defaults()
# Fill in vertical_dim
if "vertical_dim" ... | def add_vertical_dim_from_xarray(func):
"""Fill in optional vertical_dim from DataArray argument."""
@functools.wraps(func)
def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
bound_args.apply_defaults()
# Search for DataArray in arguments
dataa... | https://github.com/Unidata/MetPy/issues/1603 | Traceback (most recent call last):
File "moist_4panel.py", line 168, in <module>
pw[x,y] = mpcalc.precipitable_water(ds['P'].isel(latitude=x,longitude=y),ds['TD'].isel(latitude=x,longitude=y),bottom=pbot,top=ptop).m
File "/d1/anaconda3/envs/era5/lib/python3.8/site-packages/metpy/xarray.py", line 1174, in wrapper
return... | ValueError |
def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
bound_args.apply_defaults()
# Fill in vertical_dim
if "vertical_dim" in bound_args.arguments:
a = next(dataarray_arguments(bound_args), None)
if a is not None:
try:
bound_args.ar... | def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
bound_args.apply_defaults()
# Search for DataArray in arguments
dataarray_arguments = [
value
for value in bound_args.arguments.values()
if isinstance(value, xr.DataArray)
]
# Fill in verti... | https://github.com/Unidata/MetPy/issues/1603 | Traceback (most recent call last):
File "moist_4panel.py", line 168, in <module>
pw[x,y] = mpcalc.precipitable_water(ds['P'].isel(latitude=x,longitude=y),ds['TD'].isel(latitude=x,longitude=y),bottom=pbot,top=ptop).m
File "/d1/anaconda3/envs/era5/lib/python3.8/site-packages/metpy/xarray.py", line 1174, in wrapper
return... | ValueError |
def moist_lapse(pressure, temperature, reference_pressure=None):
r"""Calculate the temperature at a level assuming liquid saturation processes.
This function lifts a parcel starting at `temperature`. The starting pressure can
be given by `reference_pressure`. Essentially, this function is calculating moist... | def moist_lapse(pressure, temperature, reference_pressure=None):
r"""Calculate the temperature at a level assuming liquid saturation processes.
This function lifts a parcel starting at `temperature`. The starting pressure can
be given by `reference_pressure`. Essentially, this function is calculating moist... | https://github.com/Unidata/MetPy/issues/1332 | Traceback (most recent call last):
File ".\MetPy_Sounding.py", line 42, in <module>
Tw = mpcalc.wet_bulb_temperature(p, T, Td).to('degC')
File "C:\ProgramData\Anaconda3\lib\site-packages\metpy\xarray.py", line 655, in wrapper
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\metpy\units.py",... | IndexError |
def wet_bulb_temperature(pressure, temperature, dewpoint):
"""Calculate the wet-bulb temperature using Normand's rule.
This function calculates the wet-bulb temperature using the Normand method. The LCL is
computed, and that parcel brought down to the starting pressure along a moist adiabat.
The Norman... | def wet_bulb_temperature(pressure, temperature, dewpoint):
"""Calculate the wet-bulb temperature using Normand's rule.
This function calculates the wet-bulb temperature using the Normand method. The LCL is
computed, and that parcel brought down to the starting pressure along a moist adiabat.
The Norman... | https://github.com/Unidata/MetPy/issues/1332 | Traceback (most recent call last):
File ".\MetPy_Sounding.py", line 42, in <module>
Tw = mpcalc.wet_bulb_temperature(p, T, Td).to('degC')
File "C:\ProgramData\Anaconda3\lib\site-packages\metpy\xarray.py", line 655, in wrapper
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\metpy\units.py",... | IndexError |
def _build(self):
"""Build the plot by calling needed plotting methods as necessary."""
lon, lat, data = self.plotdata
# Use the cartopy map projection to transform station locations to the map and
# then refine the number of stations plotted by setting a radius
if self.parent._proj_obj == ccrs.Pla... | def _build(self):
"""Build the plot by calling needed plotting methods as necessary."""
lon, lat, data = self.plotdata
# Use the cartopy map projection to transform station locations to the map and
# then refine the number of stations plotted by setting a radius
if self.parent._proj_obj == ccrs.Pla... | https://github.com/Unidata/MetPy/issues/1574 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-6-df2b7c9f2f48> in <module>
25 pc.panels = [panel]
26
---> 27 pc.show()
~/miniconda3/envs/new_main/lib/python3.7/site-packages/metpy/plots/declarative.p... | ValueError |
def _scalar_plotting_units(scalar_value, plotting_units):
"""Handle conversion to plotting units for non-vector quantities."""
if plotting_units:
if hasattr(scalar_value, "units"):
scalar_value = scalar_value.to(plotting_units)
else:
raise ValueError(
"To ... | def _scalar_plotting_units(scalar_value, plotting_units):
"""Handle conversion to plotting units for barbs and arrows."""
if plotting_units:
if hasattr(scalar_value, "units"):
scalar_value = scalar_value.to(plotting_units)
else:
raise ValueError(
"To conve... | https://github.com/Unidata/MetPy/issues/1574 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-6-df2b7c9f2f48> in <module>
25 pc.panels = [panel]
26
---> 27 pc.show()
~/miniconda3/envs/new_main/lib/python3.7/site-packages/metpy/plots/declarative.p... | ValueError |
def add_grid_arguments_from_xarray(func):
"""Fill in optional arguments like dx/dy from DataArray arguments."""
@functools.wraps(func)
def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
bound_args.apply_defaults()
# Search for DataArray with valid lati... | def add_grid_arguments_from_xarray(func):
"""Fill in optional arguments like dx/dy from DataArray arguments."""
@functools.wraps(func)
def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
bound_args.apply_defaults()
# Search for DataArray with valid lati... | https://github.com/Unidata/MetPy/issues/1548 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-8-5722b3ee1007> in <module>
3
4 # Compute the temperature advection at 850 hPa
----> 5 t_adv_850 = mpcalc.advection(smooth_tmpc, uwnd_850, vwnd_850)
~/m... | ValueError |
def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
bound_args.apply_defaults()
# Search for DataArray with valid latitude and longitude coordinates to find grid
# deltas and any other needed parameter
dataarray_arguments = [
value
for value in bound_arg... | def wrapper(*args, **kwargs):
bound_args = signature(func).bind(*args, **kwargs)
bound_args.apply_defaults()
# Search for DataArray with valid latitude and longitude coordinates to find grid
# deltas and any other needed parameter
dataarray_arguments = [
value
for value in bound_arg... | https://github.com/Unidata/MetPy/issues/1548 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-8-5722b3ee1007> in <module>
3
4 # Compute the temperature advection at 850 hPa
----> 5 t_adv_850 = mpcalc.advection(smooth_tmpc, uwnd_850, vwnd_850)
~/m... | ValueError |
def _insert_lcl_level(pressure, temperature, lcl_pressure):
"""Insert the LCL pressure into the profile."""
interp_temp = interpolate_1d(lcl_pressure, pressure, temperature)
# Pressure needs to be increasing for searchsorted, so flip it and then convert
# the index back to the original array
loc = ... | def _insert_lcl_level(pressure, temperature, lcl_pressure):
"""Insert the LCL pressure into the profile."""
interp_temp = interpolate_1d(lcl_pressure, pressure, temperature)
# Pressure needs to be increasing for searchsorted, so flip it and then convert
# the index back to the original array
loc = ... | https://github.com/Unidata/MetPy/issues/1496 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-8-d3bf39d73e06> in <module>
7 td = units.degC * np.ma.array([20, 10, -5])
8
----> 9 mpcalc.surface_based_cape_cin(pressure, t, td)
~/repos/metpy/src/met... | ValueError |
def _find_append_zero_crossings(x, y):
r"""
Find and interpolate zero crossings.
Estimate the zero crossings of an x,y series and add estimated crossings to series,
returning a sorted array with no duplicate values.
Parameters
----------
x : `pint.Quantity`
x values of data
y :... | def _find_append_zero_crossings(x, y):
r"""
Find and interpolate zero crossings.
Estimate the zero crossings of an x,y series and add estimated crossings to series,
returning a sorted array with no duplicate values.
Parameters
----------
x : `pint.Quantity`
x values of data
y :... | https://github.com/Unidata/MetPy/issues/1496 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-8-d3bf39d73e06> in <module>
7 td = units.degC * np.ma.array([20, 10, -5])
8
----> 9 mpcalc.surface_based_cape_cin(pressure, t, td)
~/repos/metpy/src/met... | ValueError |
def _get_bound_pressure_height(pressure, bound, heights=None, interpolate=True):
"""Calculate the bounding pressure and height in a layer.
Given pressure, optional heights, and a bound, return either the closest pressure/height
or interpolated pressure/height. If no heights are provided, a standard atmosph... | def _get_bound_pressure_height(pressure, bound, heights=None, interpolate=True):
"""Calculate the bounding pressure and height in a layer.
Given pressure, optional heights, and a bound, return either the closest pressure/height
or interpolated pressure/height. If no heights are provided, a standard atmosph... | https://github.com/Unidata/MetPy/issues/1211 | from metpy.calc import wind_direction
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/akrherz/projects/MetPy/src/metpy/calc/__init__.py", line 6, in <module>
from .basic import * # noqa: F403
File "/home/akrherz/projects/MetPy/src/metpy/calc/basic.py", line 21, in <module>
from .tool... | ImportError |
def lfc(
pressure,
temperature,
dewpt,
parcel_temperature_profile=None,
dewpt_start=None,
which="top",
):
r"""Calculate the level of free convection (LFC).
This works by finding the first intersection of the ideal parcel path and
the measured parcel temperature. If this intersection... | def lfc(
pressure,
temperature,
dewpt,
parcel_temperature_profile=None,
dewpt_start=None,
which="top",
):
r"""Calculate the level of free convection (LFC).
This works by finding the first intersection of the ideal parcel path and
the measured parcel temperature.
Parameters
... | https://github.com/Unidata/MetPy/issues/1190 | Traceback (most recent call last):
File "trouble_sounding.py", line 18, in <module>
filtered['dewpoint'].values * units.degC)
File "/opt/miniconda3/envs/prod/lib/python3.6/site-packages/metpy/xarray.py", line 571, in wrapper
return func(*args, **kwargs)
File "/opt/miniconda3/envs/prod/lib/python3.6/site-packages/metpy/... | ValueError |
def cape_cin(pressure, temperature, dewpt, parcel_profile):
r"""Calculate CAPE and CIN.
Calculate the convective available potential energy (CAPE) and convective inhibition (CIN)
of a given upper air profile and parcel path. CIN is integrated between the surface and
LFC, CAPE is integrated between the ... | def cape_cin(pressure, temperature, dewpt, parcel_profile):
r"""Calculate CAPE and CIN.
Calculate the convective available potential energy (CAPE) and convective inhibition (CIN)
of a given upper air profile and parcel path. CIN is integrated between the surface and
LFC, CAPE is integrated between the ... | https://github.com/Unidata/MetPy/issues/1190 | Traceback (most recent call last):
File "trouble_sounding.py", line 18, in <module>
filtered['dewpoint'].values * units.degC)
File "/opt/miniconda3/envs/prod/lib/python3.6/site-packages/metpy/xarray.py", line 571, in wrapper
return func(*args, **kwargs)
File "/opt/miniconda3/envs/prod/lib/python3.6/site-packages/metpy/... | ValueError |
def lcl(pressure, temperature, dewpt, max_iters=50, eps=1e-5):
r"""Calculate the lifted condensation level (LCL) using from the starting point.
The starting state for the parcel is defined by `temperature`, `dewpt`,
and `pressure`.
Parameters
----------
pressure : `pint.Quantity`
The s... | def lcl(pressure, temperature, dewpt, max_iters=50, eps=1e-5):
r"""Calculate the lifted condensation level (LCL) using from the starting point.
The starting state for the parcel is defined by `temperature`, `dewpt`,
and `pressure`.
Parameters
----------
pressure : `pint.Quantity`
The s... | https://github.com/Unidata/MetPy/issues/1187 | /opt/miniconda3/envs/prod/lib/python3.6/site-packages/metpy/interpolate/one_dimension.py:144: UserWarning: Interpolation point out of data bounds encountered
warnings.warn('Interpolation point out of data bounds encountered')
Traceback (most recent call last):
File "trouble_sounding.py", line 17, in <module>
filtered['... | RuntimeError |
def interpolate_1d(x, xp, *args, **kwargs):
r"""Interpolates data with any shape over a specified axis.
Interpolation over a specified axis for arrays of any shape.
Parameters
----------
x : array-like
1-D array of desired interpolated values.
xp : array-like
The x-coordinates... | def interpolate_1d(x, xp, *args, **kwargs):
r"""Interpolates data with any shape over a specified axis.
Interpolation over a specified axis for arrays of any shape.
Parameters
----------
x : array-like
1-D array of desired interpolated values.
xp : array-like
The x-coordinates... | https://github.com/Unidata/MetPy/issues/997 | /home/markmuetz/anaconda3/envs/metpy_v10.0_test_minimal/lib/python3.6/site-packages/pint/quantity.py:1377: UnitStrippedWarning: The unit of the quantity is stripped.
warnings.warn("The unit of the quantity is stripped.", UnitStrippedWarning)
Traceback (most recent call last):
File "cape_calc.py", line 92, in <module>
p... | TypeError |
def log_interpolate_1d(x, xp, *args, **kwargs):
r"""Interpolates data with logarithmic x-scale over a specified axis.
Interpolation on a logarithmic x-scale for interpolation values in pressure coordintates.
Parameters
----------
x : array-like
1-D array of desired interpolated values.
... | def log_interpolate_1d(x, xp, *args, **kwargs):
r"""Interpolates data with logarithmic x-scale over a specified axis.
Interpolation on a logarithmic x-scale for interpolation values in pressure coordintates.
Parameters
----------
x : array-like
1-D array of desired interpolated values.
... | https://github.com/Unidata/MetPy/issues/997 | /home/markmuetz/anaconda3/envs/metpy_v10.0_test_minimal/lib/python3.6/site-packages/pint/quantity.py:1377: UnitStrippedWarning: The unit of the quantity is stripped.
warnings.warn("The unit of the quantity is stripped.", UnitStrippedWarning)
Traceback (most recent call last):
File "cape_calc.py", line 92, in <module>
p... | TypeError |
def lfc(pressure, temperature, dewpt, parcel_temperature_profile=None):
r"""Calculate the level of free convection (LFC).
This works by finding the first intersection of the ideal parcel path and
the measured parcel temperature.
Parameters
----------
pressure : `pint.Quantity`
The atmo... | def lfc(pressure, temperature, dewpt, parcel_temperature_profile=None):
r"""Calculate the level of free convection (LFC).
This works by finding the first intersection of the ideal parcel path and
the measured parcel temperature.
Parameters
----------
pressure : `pint.Quantity`
The atmo... | https://github.com/Unidata/MetPy/issues/945 | 0.9.1+6.gb7f97991
1024.95703125 hectopascal 5.743482661750363 degC 2.08279974748133 degC
[278.89348266 278.24322133 277.35755297 276.22928809 274.81361678 273.52555096 272.08325952 270.57324142 269.10199475 267.56801846 265.96421247 263.5399307 260.21335861 256.7576317 253.17725629 249.48027885 245.67713199 241.78102... | IndexError |
def storm_relative_helicity(
u,
v,
heights,
depth,
bottom=0 * units.m,
storm_u=0 * units("m/s"),
storm_v=0 * units("m/s"),
):
# Partially adapted from similar SharpPy code
r"""Calculate storm relative helicity.
Calculates storm relatively helicity following [Markowski2010] 230-2... | def storm_relative_helicity(
u,
v,
heights,
depth,
bottom=0 * units.m,
storm_u=0 * units("m/s"),
storm_v=0 * units("m/s"),
):
# Partially adapted from similar SharpPy code
r"""Calculate storm relative helicity.
Calculates storm relatively helicity following [Markowski2010] 230-2... | https://github.com/Unidata/MetPy/issues/902 | Traceback (most recent call last):
File "cal_sounding_data.py", line 360, in <module>
newset_dic[k] = specStationSounding(k,dataset_dic)
File "cal_sounding_data.py", line 284, in specStationSounding
result_dic = soundingCalculation(num,p,t,td,ws,wd)
File "cal_sounding_data.py", line 170, in soundingCalculation
lfc_p, l... | IndexError |
def lfc(pressure, temperature, dewpt, parcel_temperature_profile=None):
r"""Calculate the level of free convection (LFC).
This works by finding the first intersection of the ideal parcel path and
the measured parcel temperature.
Parameters
----------
pressure : `pint.Quantity`
The atmo... | def lfc(pressure, temperature, dewpt, parcel_temperature_profile=None):
r"""Calculate the level of free convection (LFC).
This works by finding the first intersection of the ideal parcel path and
the measured parcel temperature.
Parameters
----------
pressure : `pint.Quantity`
The atmo... | https://github.com/Unidata/MetPy/issues/902 | Traceback (most recent call last):
File "cal_sounding_data.py", line 360, in <module>
newset_dic[k] = specStationSounding(k,dataset_dic)
File "cal_sounding_data.py", line 284, in specStationSounding
result_dic = soundingCalculation(num,p,t,td,ws,wd)
File "cal_sounding_data.py", line 170, in soundingCalculation
lfc_p, l... | IndexError |
def el(pressure, temperature, dewpt, parcel_temperature_profile=None):
r"""Calculate the equilibrium level.
This works by finding the last intersection of the ideal parcel path and
the measured environmental temperature. If there is one or fewer intersections, there is
no equilibrium level.
Parame... | def el(pressure, temperature, dewpt, parcel_temperature_profile=None):
r"""Calculate the equilibrium level.
This works by finding the last intersection of the ideal parcel path and
the measured environmental temperature. If there is one or fewer intersections, there is
no equilibrium level.
Parame... | https://github.com/Unidata/MetPy/issues/902 | Traceback (most recent call last):
File "cal_sounding_data.py", line 360, in <module>
newset_dic[k] = specStationSounding(k,dataset_dic)
File "cal_sounding_data.py", line 284, in specStationSounding
result_dic = soundingCalculation(num,p,t,td,ws,wd)
File "cal_sounding_data.py", line 170, in soundingCalculation
lfc_p, l... | IndexError |
def parcel_profile(pressure, temperature, dewpt):
r"""Calculate the profile a parcel takes through the atmosphere.
The parcel starts at `temperature`, and `dewpt`, lifted up
dry adiabatically to the LCL, and then moist adiabatically from there.
`pressure` specifies the pressure levels for the profile.
... | def parcel_profile(pressure, temperature, dewpt):
r"""Calculate the profile a parcel takes through the atmosphere.
The parcel starts at `temperature`, and `dewpt`, lifted up
dry adiabatically to the LCL, and then moist adiabatically from there.
`pressure` specifies the pressure levels for the profile.
... | https://github.com/Unidata/MetPy/issues/902 | Traceback (most recent call last):
File "cal_sounding_data.py", line 360, in <module>
newset_dic[k] = specStationSounding(k,dataset_dic)
File "cal_sounding_data.py", line 284, in specStationSounding
result_dic = soundingCalculation(num,p,t,td,ws,wd)
File "cal_sounding_data.py", line 170, in soundingCalculation
lfc_p, l... | IndexError |
def surface_based_cape_cin(pressure, temperature, dewpoint):
r"""Calculate surface-based CAPE and CIN.
Calculate the convective available potential energy (CAPE) and convective inhibition (CIN)
of a given upper air profile for a surface-based parcel. CIN is integrated
between the surface and LFC, CAPE ... | def surface_based_cape_cin(pressure, temperature, dewpoint):
r"""Calculate surface-based CAPE and CIN.
Calculate the convective available potential energy (CAPE) and convective inhibition (CIN)
of a given upper air profile for a surface-based parcel. CIN is integrated
between the surface and LFC, CAPE ... | https://github.com/Unidata/MetPy/issues/902 | Traceback (most recent call last):
File "cal_sounding_data.py", line 360, in <module>
newset_dic[k] = specStationSounding(k,dataset_dic)
File "cal_sounding_data.py", line 284, in specStationSounding
result_dic = soundingCalculation(num,p,t,td,ws,wd)
File "cal_sounding_data.py", line 170, in soundingCalculation
lfc_p, l... | IndexError |
def isentropic_interpolation(theta_levels, pressure, temperature, *args, **kwargs):
r"""Interpolate data in isobaric coordinates to isentropic coordinates.
Parameters
----------
theta_levels : array
One-dimensional array of desired theta surfaces
pressure : array
One-dimensional arr... | def isentropic_interpolation(theta_levels, pressure, temperature, *args, **kwargs):
r"""Interpolate data in isobaric coordinates to isentropic coordinates.
Parameters
----------
theta_levels : array
One-dimensional array of desired theta surfaces
pressure : array
One-dimensional arr... | https://github.com/Unidata/MetPy/issues/769 | ---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-5-859d6855c05e> in <module>()
----> 1 isent_anal = mcalc.isentropic_interpolation(isentlevs,lev,tmp,spech,uwnd,vwnd,hgt,tmpk_out=True)
/home/vgensini/.c... | IndexError |
def interp(x, xp, *args, **kwargs):
r"""Interpolates data with any shape over a specified axis.
Interpolation over a specified axis for arrays of any shape.
Parameters
----------
x : array-like
1-D array of desired interpolated values.
xp : array-like
The x-coordinates of the ... | def interp(x, xp, *args, **kwargs):
r"""Interpolates data with any shape over a specified axis.
Interpolation over a specified axis for arrays of any shape.
Parameters
----------
x : array-like
1-D array of desired interpolated values.
xp : array-like
The x-coordinates of the ... | https://github.com/Unidata/MetPy/issues/769 | ---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-5-859d6855c05e> in <module>()
----> 1 isent_anal = mcalc.isentropic_interpolation(isentlevs,lev,tmp,spech,uwnd,vwnd,hgt,tmpk_out=True)
/home/vgensini/.c... | IndexError |
def isentropic_interpolation(theta_levels, pressure, temperature, *args, **kwargs):
r"""Interpolate data in isobaric coordinates to isentropic coordinates.
Parameters
----------
theta_levels : array
One-dimensional array of desired theta surfaces
pressure : array
One-dimensional arr... | def isentropic_interpolation(theta_levels, pressure, temperature, *args, **kwargs):
r"""Interpolate data in isobaric coordinates to isentropic coordinates.
Parameters
----------
theta_levels : array
One-dimensional array of desired theta surfaces
pressure : array
One-dimensional arr... | https://github.com/Unidata/MetPy/issues/769 | ---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-5-859d6855c05e> in <module>()
----> 1 isent_anal = mcalc.isentropic_interpolation(isentlevs,lev,tmp,spech,uwnd,vwnd,hgt,tmpk_out=True)
/home/vgensini/.c... | IndexError |
def lcl(pressure, temperature, dewpt, max_iters=50, eps=1e-5):
r"""Calculate the lifted condensation level (LCL) using from the starting point.
The starting state for the parcel is defined by `temperature`, `dewpt`,
and `pressure`.
Parameters
----------
pressure : `pint.Quantity`
The s... | def lcl(pressure, temperature, dewpt, max_iters=50, eps=1e-5):
r"""Calculate the lifted condensation level (LCL) using from the starting point.
The starting state for the parcel is defined by `temperature`, `dewpt`,
and `pressure`.
Parameters
----------
pressure : `pint.Quantity`
The s... | https://github.com/Unidata/MetPy/issues/619 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~/miniconda3/envs/metpydev/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self, obj)
343 method = get_real_method(obj, self.print_method... | TypeError |
def supercell_composite(mucape, effective_storm_helicity, effective_shear):
r"""Calculate the supercell composite parameter.
The supercell composite parameter is designed to identify
environments favorable for the development of supercells,
and is calculated using the formula developed by
[Thompson... | def supercell_composite(mucape, effective_storm_helicity, effective_shear):
r"""Calculate the supercell composite parameter.
The supercell composite parameter is designed to identify
environments favorable for the development of supercells,
and is calculated using the formula developed by
[Thompson... | https://github.com/Unidata/MetPy/issues/608 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/usr/local/tools/anaconda3/lib/python3.6/site-packages/pint/quantity.py in __setitem__(self, key, value)
1306 '`... | TypeError |
def significant_tornado(
sbcape, surface_based_lcl_height, storm_helicity_1km, shear_6km
):
r"""Calculate the significant tornado parameter (fixed layer).
The significant tornado parameter is designed to identify
environments favorable for the production of significant
tornadoes contingent upon the... | def significant_tornado(sbcape, sblcl, storm_helicity_1km, shear_6km):
r"""Calculate the significant tornado parameter (fixed layer).
The significant tornado parameter is designed to identify
environments favorable for the production of significant
tornadoes contingent upon the development of supercell... | https://github.com/Unidata/MetPy/issues/608 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/usr/local/tools/anaconda3/lib/python3.6/site-packages/pint/quantity.py in __setitem__(self, key, value)
1306 '`... | TypeError |
def storm_relative_helicity(
u,
v,
heights,
depth,
bottom=0 * units.m,
storm_u=0 * units("m/s"),
storm_v=0 * units("m/s"),
):
# Partially adapted from similar SharpPy code
r"""Calculate storm relative helicity.
Calculates storm relatively helicity following [Markowski2010] 230-2... | def storm_relative_helicity(
u,
v,
p,
hgt,
top,
bottom=0 * units("meter"),
storm_u=0 * units("m/s"),
storm_v=0 * units("m/s"),
):
# Partially adapted from similar SharpPy code
r"""Calculate storm relative helicity.
Needs u and v wind components, heights and pressures,
an... | https://github.com/Unidata/MetPy/issues/576 | ---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-b6078272f411> in <module>()
11 hgt = dataset['height'].values * units(dataset.units['height'])
12
---> 13 sreh = mpcalc.storm_relative_helicity(u, v, p... | ValueError |
async def poll(self):
"""
Check if the pod is still running.
Uses the same interface as subprocess.Popen.poll(): if the pod is
still running, returns None. If the pod has exited, return the
exit code if we can determine it, or 1 if it has exited but we
don't know how. These are the return val... | async def poll(self):
"""
Check if the pod is still running.
Uses the same interface as subprocess.Popen.poll(): if the pod is
still running, returns None. If the pod has exited, return the
exit code if we can determine it, or 1 if it has exited but we
don't know how. These are the return val... | https://github.com/jupyterhub/kubespawner/issues/466 | Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/jupyterhub/app.py", line 2032, in check_spawner
status = await spawner.poll()
File "/usr/local/lib/python3.8/dist-packages/kubespawner/spawner.py", line 1610, in poll
await self.pod_reflector.first_load_future
TypeError: object Future can't... | TypeError |
def poll(self):
"""
Check if the pod is still running.
Uses the same interface as subprocess.Popen.poll(): if the pod is
still running, returns None. If the pod has exited, return the
exit code if we can determine it, or 1 if it has exited but we
don't know how. These are the return values Ju... | def poll(self):
"""
Check if the pod is still running.
Uses the same interface as subprocess.Popen.poll(): if the pod is
still running, returns None. If the pod has exited, return the
exit code if we can determine it, or 1 if it has exited but we
don't know how. These are the return values Ju... | https://github.com/jupyterhub/kubespawner/issues/440 | Sep 29 15:12:00hub-6788d79c4-mct9jhubERRORERROR 2020-09-29T20:12:00.742Z [JupyterHub user:645] Unhandled error starting 5f5118929d1395001a6aa4df's server: pod/jupyter-5f5118929d1395001a6aa4df did not start in 300 seconds!
Sep 29 15:12:00hub-6788d79c4-mct9jhubERRORERROR 2020-09-29T20:12:00.778Z [JupyterHub user:657] Fai... | KeyError |
def update_info(self, data, params=None, headers=None, **kwargs):
"""Update information about this object.
Send a PUT to the object's base endpoint to modify the provided
attributes.
:param data:
The updated information about this object.
Must be JSON serializable.
Update the o... | def update_info(self, data, params=None, headers=None, **kwargs):
"""Update information about this object.
Send a PUT to the object's base endpoint to modify the provided
attributes.
:param data:
The updated information about this object.
Must be JSON serializable.
Update the o... | https://github.com/box/box-python-sdk/issues/528 | Adding collab
Updated collab
Traceback (most recent call last):
File "./box_reorg_test.py", line 43, in <module>
main()
File "./box_reorg_test.py", line 33, in main
_ = src_collab.update_info(CollaborationRole.OWNER)
File "/Users/my_username/workspace/box-scripts/venv/lib/python3.7/site-packages/boxsdk/util/api_call_de... | boxsdk.exception.BoxAPIException |
def update_info(self, role=None, status=None):
"""Edit an existing collaboration on Box
:param role:
The new role for this collaboration or None to leave unchanged
:type role:
:class:`CollaborationRole`
:param status:
The new status for this collaboration or None to leave unchan... | def update_info(self, role=None, status=None):
"""Edit an existing collaboration on Box
:param role:
The new role for this collaboration or None to leave unchanged
:type role:
:class:`CollaborationRole`
:param status:
The new status for this collaboration or None to leave unchan... | https://github.com/box/box-python-sdk/issues/528 | Adding collab
Updated collab
Traceback (most recent call last):
File "./box_reorg_test.py", line 43, in <module>
main()
File "./box_reorg_test.py", line 33, in main
_ = src_collab.update_info(CollaborationRole.OWNER)
File "/Users/my_username/workspace/box-scripts/venv/lib/python3.7/site-packages/boxsdk/util/api_call_de... | boxsdk.exception.BoxAPIException |
def cluster_vectorspace(self, vectors, trace=False):
if self._means and self._repeats > 1:
print("Warning: means will be discarded for subsequent trials")
meanss = []
for trial in range(self._repeats):
if trace:
print("k-means trial", trial)
if not self._means or trial >... | def cluster_vectorspace(self, vectors, trace=False):
if self._means and self._repeats > 1:
print("Warning: means will be discarded for subsequent trials")
meanss = []
for trial in range(self._repeats):
if trace:
print("k-means trial", trial)
if not self._means or trial >... | https://github.com/nltk/nltk/issues/681 | Traceback (most recent call last):
...
File "D:\SourceCode\voc\nltk\cluster\util.py", line 65, in cluster
self.cluster_vectorspace(vectors, trace)
File "D:\SourceCode\voc\nltk\cluster\kmeans.py", line 84, in cluster_vectorspace
self._means = self._rng.sample(vectors, self._num_means)
File "C:\Python32-64\lib\random.py"... | TypeError |
def __init__(self, tree, sentence=None, highlight=()):
if sentence is None:
leaves = tree.leaves()
if (
leaves
and not any(len(a) == 0 for a in tree.subtrees())
and all(isinstance(a, int) for a in leaves)
):
sentence = [str(a) for a in leaves]
... | def __init__(self, tree, sentence=None, highlight=()):
if sentence is None:
leaves = tree.leaves()
if (
leaves
and not any(len(a) == 0 for a in tree.subtrees())
and all(isinstance(a, int) for a in leaves)
):
sentence = [str(a) for a in leaves]
... | https://github.com/nltk/nltk/issues/2102 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-32-306ca23c9095> in <module>()
7 NPChunker = nltk.RegexpParser(pattern)
8 result = NPChunker.parse(sentence)
----> 9 result.pretty_print()
/Library/Fram... | TypeError |
def __init__(self, tree, sentence=None, highlight=()):
if sentence is None:
leaves = tree.leaves()
if (
leaves
and not any(len(a) == 0 for a in tree.subtrees())
and all(isinstance(a, int) for a in leaves)
):
sentence = [str(a) for a in leaves]
... | def __init__(self, tree, sentence=None, highlight=()):
if sentence is None:
leaves = tree.leaves()
if (
leaves
and not any(len(a) == 0 for a in tree.subtrees())
and all(isinstance(a, int) for a in leaves)
):
sentence = [str(a) for a in leaves]
... | https://github.com/nltk/nltk/issues/2102 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-32-306ca23c9095> in <module>()
7 NPChunker = nltk.RegexpParser(pattern)
8 result = NPChunker.parse(sentence)
----> 9 result.pretty_print()
/Library/Fram... | TypeError |
def __init__(self, zipfile, entry=""):
"""
Create a new path pointer pointing at the specified entry
in the given zipfile.
:raise IOError: If the given zipfile does not exist, or if it
does not contain the specified entry.
"""
if isinstance(zipfile, string_types):
zipfile = OpenOnDe... | def __init__(self, zipfile, entry=""):
"""
Create a new path pointer pointing at the specified entry
in the given zipfile.
:raise IOError: If the given zipfile does not exist, or if it
does not contain the specified entry.
"""
if isinstance(zipfile, string_types):
zipfile = OpenOnDe... | https://github.com/nltk/nltk/issues/1986 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Apps\Tools\python\conda3\envs\nlp\lib\site-packages\nltk\corpus\reader\twitter.py", line 74, in __init__
CorpusReader.__init__(self, root, fileids, encoding)
File "C:\Apps\Tools\python\conda3\envs\nlp\lib\site-packages\nltk\corpus\reader\ap... | OSError |
def __init__(self, zipfile, entry=""):
"""
Create a new path pointer pointing at the specified entry
in the given zipfile.
:raise IOError: If the given zipfile does not exist, or if it
does not contain the specified entry.
"""
if isinstance(zipfile, string_types):
zipfile = OpenOnDe... | def __init__(self, zipfile, entry=""):
"""
Create a new path pointer pointing at the specified entry
in the given zipfile.
:raise IOError: If the given zipfile does not exist, or if it
does not contain the specified entry.
"""
if isinstance(zipfile, string_types):
zipfile = OpenOnDe... | https://github.com/nltk/nltk/issues/1986 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Apps\Tools\python\conda3\envs\nlp\lib\site-packages\nltk\corpus\reader\twitter.py", line 74, in __init__
CorpusReader.__init__(self, root, fileids, encoding)
File "C:\Apps\Tools\python\conda3\envs\nlp\lib\site-packages\nltk\corpus\reader\ap... | OSError |
def __Suffix_Verb_Step2a(self, token):
for suffix in self.__suffix_verb_step2a:
if token.endswith(suffix) and len(token) > 3:
if suffix == "\u062a" and len(token) >= 4:
token = token[:-1]
self.suffix_verb_step2a_success = True
break
if... | def __Suffix_Verb_Step2a(self, token):
for suffix in self.__suffix_verb_step2a:
if token.endswith(suffix):
if suffix == "\u062a" and len(token) >= 4:
token = token[:-1]
self.suffix_verb_step2a_success = True
break
if suffix in self.__c... | https://github.com/nltk/nltk/issues/1852 | (anaconda2-4.4.0) richard-balmer-macbook:~ richardbalmer$ pip freeze | grep nltk
nltk==3.2.5
(anaconda2-4.4.0) richard-balmer-macbook:~ richardbalmer$ ipython
Python 2.7.13 |Anaconda custom (x86_64)| (default, Dec 20 2016, 23:05:08)
Type "copyright", "credits" or "license" for more information.
IPython 5.3.0 -- An enh... | AttributeError |
def stem(self, word):
"""
Stem an Arabic word and return the stemmed form.
:param word: string
:return: string
"""
# set initial values
self.is_verb = True
self.is_noun = True
self.is_defined = False
self.suffix_verb_step2a_success = False
self.suffix_verb_step2b_success = ... | def stem(self, word):
"""
Stem an Arabic word and return the stemmed form.
:param word: string
:return: string
"""
# set initial values
self.is_verb = True
self.is_noun = True
self.is_defined = False
self.suffix_verb_step2a_success = False
self.suffix_verb_step2b_success = ... | https://github.com/nltk/nltk/issues/1852 | (anaconda2-4.4.0) richard-balmer-macbook:~ richardbalmer$ pip freeze | grep nltk
nltk==3.2.5
(anaconda2-4.4.0) richard-balmer-macbook:~ richardbalmer$ ipython
Python 2.7.13 |Anaconda custom (x86_64)| (default, Dec 20 2016, 23:05:08)
Type "copyright", "credits" or "license" for more information.
IPython 5.3.0 -- An enh... | AttributeError |
def stem(self, word):
"""
Stem an Arabic word and return the stemmed form.
:param word: string
:return: string
"""
# set initial values
self.is_verb = True
self.is_noun = True
self.is_defined = False
self.suffix_verb_step2a_success = False
self.suffix_verb_step2b_success = ... | def stem(self, word):
"""
Stem an Arabic word and return the stemmed form.
:param word: string
:return: string
"""
# set initial values
self.is_verb = True
self.is_noun = True
self.is_defined = False
self.suffix_verb_step2a_success = False
self.suffix_verb_step2b_success = ... | https://github.com/nltk/nltk/issues/1852 | (anaconda2-4.4.0) richard-balmer-macbook:~ richardbalmer$ pip freeze | grep nltk
nltk==3.2.5
(anaconda2-4.4.0) richard-balmer-macbook:~ richardbalmer$ ipython
Python 2.7.13 |Anaconda custom (x86_64)| (default, Dec 20 2016, 23:05:08)
Type "copyright", "credits" or "license" for more information.
IPython 5.3.0 -- An enh... | AttributeError |
def train(self, sentences, save_loc=None, nr_iter=5):
"""Train a model from sentences, and save it at ``save_loc``. ``nr_iter``
controls the number of Perceptron training iterations.
:param sentences: A list or iterator of sentences, where each sentence
is a list of (words, tags) tuples.
:param... | def train(self, sentences, save_loc=None, nr_iter=5):
"""Train a model from sentences, and save it at ``save_loc``. ``nr_iter``
controls the number of Perceptron training iterations.
:param sentences: A list of (words, tags) tuples.
:param save_loc: If not ``None``, saves a pickled model in this locati... | https://github.com/nltk/nltk/issues/1486 | from nltk.tag import PerceptronTagger
from nltk.corpus import alpino as alp
training_corpus = alp.tagged_sents()
tagger = PerceptronTagger(load=False)
tagger.train(training_corpus)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/nltk/tag/perceptron.py", lin... | TypeError |
def _make_tagdict(self, sentences):
"""
Make a tag dictionary for single-tag words.
:param sentences: A list of list of (word, tag) tuples.
"""
counts = defaultdict(lambda: defaultdict(int))
for sentence in sentences:
self._sentences.append(sentence)
for word, tag in sentence:
... | def _make_tagdict(self, sentences):
"""
Make a tag dictionary for single-tag words.
:param sentences: A list of list of (word, tag) tuples.
"""
counts = defaultdict(lambda: defaultdict(int))
for sentence in sentences:
for word, tag in sentence:
counts[word][tag] += 1
... | https://github.com/nltk/nltk/issues/1486 | from nltk.tag import PerceptronTagger
from nltk.corpus import alpino as alp
training_corpus = alp.tagged_sents()
tagger = PerceptronTagger(load=False)
tagger.train(training_corpus)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/nltk/tag/perceptron.py", lin... | TypeError |
def __init__(self, strings=None):
"""Builds a Trie object, which is built around a ``dict``
If ``strings`` is provided, it will add the ``strings``, which
consist of a ``list`` of ``strings``, to the Trie.
Otherwise, it'll construct an empty Trie.
:param strings: List of strings to insert into the... | def __init__(self, strings=None):
"""Builds a Trie object, which is built around a ``defaultdict``
If ``strings`` is provided, it will add the ``strings``, which
consist of a ``list`` of ``strings``, to the Trie.
Otherwise, it'll construct an empty Trie.
:param strings: List of strings to insert i... | https://github.com/nltk/nltk/issues/1761 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-47-205693e12b16> in <module>()
1 with open('tokenizer.pkl', 'rb') as f:
----> 2 t = pickle.load(f)
/usr/local/Cellar/python/2.7.11/Frameworks/Python... | TypeError |
def insert(self, string):
"""Inserts ``string`` into the Trie
:param string: String to insert into the trie
:type string: str
:Example:
>>> from nltk.collections import Trie
>>> trie = Trie(["abc", "def"])
>>> expected = {'a': {'b': {'c': {True: None}}}, \
... | def insert(self, string):
"""Inserts ``string`` into the Trie
:param string: String to insert into the trie
:type string: str
:Example:
>>> from nltk.collections import Trie
>>> trie = Trie(["ab"])
>>> trie
defaultdict(<class 'nltk.collections.Trie'>, {'a': defaultdict(<class 'nltk.co... | https://github.com/nltk/nltk/issues/1761 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-47-205693e12b16> in <module>()
1 with open('tokenizer.pkl', 'rb') as f:
----> 2 t = pickle.load(f)
/usr/local/Cellar/python/2.7.11/Frameworks/Python... | TypeError |
def __missing__(self, key):
self[key] = Trie()
return self[key]
| def __missing__(self, key):
if not self._default_factory and key not in self._keys:
raise KeyError()
return self._default_factory()
| https://github.com/nltk/nltk/issues/1761 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-47-205693e12b16> in <module>()
1 with open('tokenizer.pkl', 'rb') as f:
----> 2 t = pickle.load(f)
/usr/local/Cellar/python/2.7.11/Frameworks/Python... | TypeError |
def add_mwe(self, mwe):
"""Add a multi-word expression to the lexicon (stored as a word trie)
We use ``util.Trie`` to represent the trie. Its form is a dict of dicts.
The key True marks the end of a valid MWE.
:param mwe: The multi-word expression we're adding into the word trie
:type mwe: tuple(s... | def add_mwe(self, mwe):
"""Add a multi-word expression to the lexicon (stored as a word trie)
We use ``util.Trie`` to represent the trie. Its form is a dict of dicts.
The key True marks the end of a valid MWE.
:param mwe: The multi-word expression we're adding into the word trie
:type mwe: tuple(s... | https://github.com/nltk/nltk/issues/1761 | ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-47-205693e12b16> in <module>()
1 with open('tokenizer.pkl', 'rb') as f:
----> 2 t = pickle.load(f)
/usr/local/Cellar/python/2.7.11/Frameworks/Python... | TypeError |
def has_numeric_only(self, text):
return bool(re.search(r"(.*)[\s]+(\#NUMERIC_ONLY\#)", text))
| def has_numeric_only(self, text):
return bool(re.match(r"(.*)[\s]+(\#NUMERIC_ONLY\#)", 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 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 toknes 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 escape_xml(self, text):
for regexp, substitution in self.MOSES_ESCAPE_XML_REGEXES:
text = re.sub(regexp, substitution, text)
return text
| def escape_xml(self, text):
for regexp, subsitution in self.MOSES_ESCAPE_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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.