diff
stringlengths
139
3.65k
message
stringlengths
8
627
diff_languages
stringclasses
1 value
diff --git a/util.py b/util.py index <HASH>..<HASH> 100644 --- a/util.py +++ b/util.py @@ -144,11 +144,26 @@ def get_platform(): machine = 'fat' cflags = get_config_vars().get('CFLAGS') - if '-arch x86_64' in cflags: - if '-arch i386' in cflags: - machine = 'universal' - else: - machine = 'fat64' + archs = re.findall('-arch\s+(\S+)', cflags) + archs.sort() + archs = tuple(archs) + + if len(archs) == 1: + machine = archs[0] + elif archs == ('i386', 'ppc'): + machine = 'fat' + elif archs == ('i386', 'x86_64'): + machine = 'intel' + elif archs == ('i386', 'ppc', 'x86_64'): + machine = 'fat3' + elif archs == ('ppc64', 'x86_64'): + machine = 'fat64' + elif archs == ('i386', 'ppc', 'ppc64', 'x86_64'): + machine = 'universal' + else: + raise ValueError( + "Don't know machine value for archs=%r"%(archs,)) + elif machine in ('PowerPC', 'Power_Macintosh'): # Pick a sane name for the PPC architecture.
Finish support for --with-universal-archs=intel and --with-universal-archs=3-way (issue<I>)
py
diff --git a/peppy/sample.py b/peppy/sample.py index <HASH>..<HASH> 100644 --- a/peppy/sample.py +++ b/peppy/sample.py @@ -43,10 +43,8 @@ class Subsample(AttMap): """ def __init__(self, series, sample=None): data = OrderedDict(series) - _LOGGER.debug(data) + _LOGGER.debug("Subsample data:\n{}".format(data)) super(Subsample, self).__init__(entries=data) - - # lookback link self.sample = sample
for when not in debug mode, provide a bit of message context
py
diff --git a/openquake/engine/db/models.py b/openquake/engine/db/models.py index <HASH>..<HASH> 100644 --- a/openquake/engine/db/models.py +++ b/openquake/engine/db/models.py @@ -3675,6 +3675,14 @@ class Epsilon(djm.Model): """ Insert the epsilon matrix associated to the given SES collection for each asset_sites association. + + :param ses_coll: + a :class:`openquake.engine.db.models.SESCollection` instance + :param asset_sites: + a list of :class:`openquake.engine.db.models.AssetSite` instances + :param epsilon_matrix: + a numpy matrix with NxE elements, where `N` is the number of assets + and `E` the number of events for the given SESCollection """ assert len(asset_sites) == len(epsilon_matrix), ( len(asset_sites), len(epsilon_matrix))
Added a docstring Former-commit-id: 4a<I>cff0ddd2cb<I>aaed<I>a<I>b2fac<I>
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ with open('README.rst') as file_object: description = file_object.read() setup(name='travis-encrypt', - version='1.1.2', + version='1.2.0', author='Mandeep', author_email='[email protected]', url='https://github.com/mandeep/Travis-Encrypt',
Increase travis-encrypt version to <I>
py
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,6 +17,10 @@ sys.path.append(base_path) from ipaddresstools.ipaddresstools import __version__ as version +# -- Added for readthedocs.org ----------------------------------------------- + +master_doc = 'index' + # -- Project information ----------------------------------------------------- # The full version, including alpha/beta/rc tags
modified conf.py for readthedocs.org
py
diff --git a/pysat/instruments/pysat_testing2d_xarray.py b/pysat/instruments/pysat_testing2d_xarray.py index <HASH>..<HASH> 100644 --- a/pysat/instruments/pysat_testing2d_xarray.py +++ b/pysat/instruments/pysat_testing2d_xarray.py @@ -60,7 +60,7 @@ def load(fnames, tag=None, sat_id=None, malformed_index=False): """ # create an artifical satellite data set - uts, index, date = mm_test.generate_times(fnames, sat_id, freq='900S') + uts, index, date = mm_test.generate_times(fnames, sat_id, freq='100S') if malformed_index: index = index[:].tolist()
2d instruments use <I>s cadence
py
diff --git a/tcex/bin/package.py b/tcex/bin/package.py index <HASH>..<HASH> 100644 --- a/tcex/bin/package.py +++ b/tcex/bin/package.py @@ -188,6 +188,7 @@ class Package(Bin): 'tcex.json', self.args.outdir, '__pycache__', + '.cache', # local cache directory '.c9', # C9 IDE '.coverage', # coverage file '.coveragerc', # coverage configuration file file
+ update excludes for tcpackage.
py
diff --git a/abilian/web/forms/widgets.py b/abilian/web/forms/widgets.py index <HASH>..<HASH> 100644 --- a/abilian/web/forms/widgets.py +++ b/abilian/web/forms/widgets.py @@ -16,7 +16,7 @@ from collections import namedtuple import bleach import sqlalchemy as sa import werkzeug.datastructures -from flask import render_template, json, Markup, render_template_string +from flask import g, render_template, json, Markup, render_template_string from flask.ext.babel import format_date, format_datetime, get_locale import wtforms from wtforms.widgets import ( @@ -111,7 +111,8 @@ class BaseTableView(object): self.show_search = self.show_controls self.init_columns(columns) - self.name = id(self) + self.name = u'{}-{:d}'.format(self.__class__.__name__.lower(), + next(g.id_generator)) if options is not None: self.options = options self.show_controls = self.options.get('show_controls', self.show_controls)
widget basetableview: fix table id generation using id(self) could result in duplicated ids when python is reusing the same memory slot for new instances. This may happen when instances are created, rendered and destroyed one after another.
py
diff --git a/slave/buildslave/commands/vcs.py b/slave/buildslave/commands/vcs.py index <HASH>..<HASH> 100644 --- a/slave/buildslave/commands/vcs.py +++ b/slave/buildslave/commands/vcs.py @@ -229,6 +229,8 @@ class SourceBase(Command): # we are going to do a full checkout, so a clobber is # required first self.doClobber(d, self.workdir) + if self.srcdir: + self.doClobber(d, self.srcdir) d.addCallback(lambda res: self.doVCFull()) d.addBoth(self.maybeDoVCRetry) self._reactor.callLater(delay, d.callback, None)
vcs.py: delete srcdir before retrying git clone * This fixes ticket #<I>
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,15 +5,16 @@ See LICENSE at the top-level of this distribution for more information or write to [email protected] for more information. """ -from setuptools import setup, find_packages from os import path +from setuptools import setup, find_packages + def get_readme(): 'Get the long description from the README file' here = path.abspath(path.dirname(__file__)) - with open(path.join(here, 'README.md'), encoding='utf-8') as f: - result = f.read() + with open(path.join(here, 'README.md'), encoding='utf-8') as my_fd: + result = my_fd.read() return result setup( @@ -30,7 +31,7 @@ setup( 'Intended Audience :: Developers', 'Programming Language :: Python :: 3', ], - keywords='comment management', + keywords='comment management', # You can just specify the packages manually here if your project is # simple. Or you can use find_packages(). packages=find_packages(exclude=['contrib', 'docs', 'tests']),
Cleaned up pylint warnings
py
diff --git a/pyregion/mpl_helper.py b/pyregion/mpl_helper.py index <HASH>..<HASH> 100644 --- a/pyregion/mpl_helper.py +++ b/pyregion/mpl_helper.py @@ -97,6 +97,13 @@ def properties_func_default(shape, saved_attrs): kwargs["linestyle"] = "dashed" else: + # The default behavior of matplotlib edgecolor has changed, and it does + # not draw edges by default. To remdy this, simply use black edgecolor + # if None. + # https://matplotlib.org/stable/users/dflt_style_changes.html#patch-edges-and-color + + if color is None: + color = "k" kwargs = dict(edgecolor=color, linewidth=int(attr_dict.get("width", 1)), facecolor="none" @@ -343,11 +350,9 @@ def as_mpl_artists(shape_list, patches = [mpatches.FancyArrowPatch(posA=(x1, y1), posB=(x2, y2), arrowstyle=arrowstyle, - arrow_transmuter=None, connectionstyle="arc3", patchA=None, patchB=None, shrinkA=0, shrinkB=0, - connector=None, **kwargs)] else:
minor bug fixes. should resolve #<I>
py
diff --git a/isogeo_pysdk/models/metadata.py b/isogeo_pysdk/models/metadata.py index <HASH>..<HASH> 100644 --- a/isogeo_pysdk/models/metadata.py +++ b/isogeo_pysdk/models/metadata.py @@ -246,6 +246,7 @@ class Metadata(object): """ for k, v in cls.ATTR_MAP.items(): raw_object[k] = raw_object.pop(v, []) + return cls(**raw_object) # -- CLASS INSTANCIATION ----------------------------------------------------------- @@ -298,6 +299,7 @@ class Metadata(object): validFrom: str = None, validTo: str = None, validityComment: str = None, + **kwargs, ): """Metadata model.""" @@ -442,6 +444,15 @@ class Metadata(object): if validityComment is not None: self._validityComment = validityComment + # warn about unsupported attributes + if len(kwargs): + logger.warning( + "Folllowings fields were not expected and have been ignored. " + "Maybe consider adding them to the model: {}.".format( + " | ".join(kwargs.keys()) + ) + ) + # -- PROPERTIES -------------------------------------------------------------------- # abilities of the user related to the metadata @property
Ignore not expected field preventing crashes
py
diff --git a/tests/test_subcmd_02_index.py b/tests/test_subcmd_02_index.py index <HASH>..<HASH> 100644 --- a/tests/test_subcmd_02_index.py +++ b/tests/test_subcmd_02_index.py @@ -108,4 +108,4 @@ class TestIndexSubcommand(unittest.TestCase): def test_missing_index(self): """Test behaviour when an index file is missing""" with self.assertRaises(IOError): - pyani_files.get_fasta_and_hash_paths(self.indir / "nonexistant_hash.fna") + pyani_files.get_fasta_and_hash_paths(self.indir / "nonexistent_hash.txt")
Changed name of (extension) test input file
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -61,7 +61,7 @@ class TestCommand(TestCommandBase): def finalize_options(self): TestCommandBase.finalize_options(self) - self.test_suite = True + self.test_suite = False def run_tests(self): import pytest @@ -91,7 +91,7 @@ class LintCommand(TestCommandBase): def finalize_options(self): TestCommandBase.finalize_options(self) - self.test_suite = True + self.test_suite = False def run_tests(self): from pylint.lint import Run
changed test suite to fasle
py
diff --git a/tests/test_image.py b/tests/test_image.py index <HASH>..<HASH> 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -7,8 +7,8 @@ import unittest from sigal.image import Gallery from sigal.settings import read_settings -class TestSettings(unittest.TestCase): - "Read a settings file and check that the configuration is well done." +class TestGallery(unittest.TestCase): + "Test the Gallery class." def setUp(self): "Read the sample config file"
test_image - rename the class
py
diff --git a/tests/unit/pyobjects_test.py b/tests/unit/pyobjects_test.py index <HASH>..<HASH> 100644 --- a/tests/unit/pyobjects_test.py +++ b/tests/unit/pyobjects_test.py @@ -130,7 +130,7 @@ password = ''.join(random.SystemRandom().choice( string.ascii_letters + string.digits) for _ in range(20)) ''' -random_password_import_template = '''#!pyobjecs +random_password_import_template = '''#!pyobjects from salt://password.sls import password '''
Fix typo in pyobjects test
py
diff --git a/src/bidi/levelruns.py b/src/bidi/levelruns.py index <HASH>..<HASH> 100644 --- a/src/bidi/levelruns.py +++ b/src/bidi/levelruns.py @@ -145,6 +145,7 @@ class LevelRun(object): # (sor) and end-of-level-run (eor) are used at level run # boundaries. prev_bidi_type = _get_influence_type(ex_ch.prev_char.bidi_type) + if prev_bidi_type in ('AN', 'EN'): prev_bidi_type = 'R' next_bidi_type = _get_influence_type(ex_ch.next_char.bidi_type) if prev_bidi_type == next_bidi_type:
Resolve LevelRun neutral types (N1, N2)
py
diff --git a/werkzeug/testsuite/http.py b/werkzeug/testsuite/http.py index <HASH>..<HASH> 100644 --- a/werkzeug/testsuite/http.py +++ b/werkzeug/testsuite/http.py @@ -292,12 +292,13 @@ class HTTPUtilityTestCase(WerkzeugTestCase): 'b': u'\";' } ) - self.assert_strict_equal( - set(http.dump_cookie('foo', 'bar baz blub', 360, httponly=True, - sync_expires=False).split(u'; ')), - set([u'HttpOnly', u'Max-Age=360', u'Path=/', u'foo="bar baz blub"']) - ) - self.assert_strict_equal(dict(http.parse_cookie('fo234{=bar; blub=Blah')), + rv = http.dump_cookie('foo', 'bar baz blub', 360, httponly=True, + sync_expires=False) + assert type(rv) is str + assert set(rv.split('; ')) == set(['HttpOnly', 'Max-Age=360', + 'Path=/', 'foo="bar baz blub"']) + + strict_eq(dict(http.parse_cookie('fo234{=bar; blub=Blah')), {'fo234{': u'bar', 'blub': u'Blah'}) def test_cookie_quoting(self):
Fix wrong testcase Quoted from the dump_cookie docs: >On Python 3 the return value of this function will be a unicode >string, on Python 2 it will be a native string. So in both cases it's a native string. Also related: <URL>
py
diff --git a/raiden/network/rpc/client.py b/raiden/network/rpc/client.py index <HASH>..<HASH> 100644 --- a/raiden/network/rpc/client.py +++ b/raiden/network/rpc/client.py @@ -906,11 +906,11 @@ class JSONRPCClient: def __init__( self, web3: Web3, - privkey: Optional[PrivateKey], + privkey: PrivateKey, gas_price_strategy: Callable = rpc_gas_price_strategy, block_num_confirmations: int = 0, ) -> None: - if privkey is None or len(privkey) != 32: + if len(privkey) != 32: raise ValueError("Invalid private key") if block_num_confirmations < 0:
JSONRPCClient requires a privatekey. The signature allowed for `None` to be used, but that resulted in a runtime error. Instead of having an error at runtime this enforces the caller to provide a privatekey statically. The privatekey is required because transactions are signed locally.
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 from codecs import open -from tickets import __version__ -from setuptools import setup, find_packages +from iquery import __version__ +from setuptools import setup def read(f): @@ -10,15 +10,15 @@ def read(f): setup( - name='tickets', + name='iquery', version=__version__, - description='Train tickets query via command line.', + description='Various information query via command line.', long_description=read('README.rst') + '\n\n' + read('HISTORY.rst'), author='protream', author_email='[email protected]', - url='https://github.com/protream/tickets', + url='https://github.com/protream/iquery', packages=[ - 'tickets' + 'iquery' ], py_modules=['run'], include_package_data=True, @@ -29,7 +29,7 @@ setup( 'bs4', ], entry_points={ - 'console_scripts': ['tickets=run:cli'] + 'console_scripts': ['iquery=run:cli'] }, license='MIT', zip_safe=False,
Project rename: tickets -> iquery
py
diff --git a/internals/hsmm_states.py b/internals/hsmm_states.py index <HASH>..<HASH> 100644 --- a/internals/hsmm_states.py +++ b/internals/hsmm_states.py @@ -66,7 +66,7 @@ class HSMMStatesPython(_StatesBase): elif self.left_censoring: return [0] elif self.right_censoring: - return [1] + return [1] if len(self.stateseq_norep) > 1 else [0] else: return []
fix trunc_slice when there's only one segment
py
diff --git a/angr/sim_type.py b/angr/sim_type.py index <HASH>..<HASH> 100644 --- a/angr/sim_type.py +++ b/angr/sim_type.py @@ -1022,13 +1022,26 @@ def define_struct(defn): return struct -def register_types(mapping): +def register_types(types): """ - Pass in a mapping from name to SimType and they will be registered to the global type store + Pass in some types and they will be registered to the global type store. + + The argument may be either a mapping from name to SimType, or a plain SimType. + The plain SimType must be either a struct or union type with a name present. >>> register_types(parse_types("typedef int x; typedef float y;")) + >>> register_types(parse_type("struct abcd { int ab; float cd; }")) """ - ALL_TYPES.update(mapping) + if type(types) is SimStruct: + if types.name == '<anon>': + raise ValueError("Cannot register anonymous struct") + ALL_TYPES['struct ' + types.name] = types + elif type(types) is SimUnion: + if types.name == '<anon>': + raise ValueError("Cannot register anonymous union") + ALL_TYPES['union ' + types.name] = types + else: + ALL_TYPES.update(types) def do_preprocess(defn):
Allow register_types to take a single type, i.e. parse_type() results. see #<I>
py
diff --git a/GEOparse/__init__.py b/GEOparse/__init__.py index <HASH>..<HASH> 100755 --- a/GEOparse/__init__.py +++ b/GEOparse/__init__.py @@ -2,7 +2,7 @@ __author__ = 'Rafal Gumienny' __email__ = '[email protected]' -__version__ = '0.1.9' +__version__ = '0.1.10' from .GEOparse import get_GEO, get_GEO_file, parse_GPL, parse_GSE, parse_GSM from .GEOTypes import (DataIncompatibilityException,
fix: Preparation for <I> release
py
diff --git a/test/integration/001_simple_copy_test/test_simple_copy.py b/test/integration/001_simple_copy_test/test_simple_copy.py index <HASH>..<HASH> 100644 --- a/test/integration/001_simple_copy_test/test_simple_copy.py +++ b/test/integration/001_simple_copy_test/test_simple_copy.py @@ -509,7 +509,7 @@ class TestIncrementalMergeColumns(BaseTestSimpleCopy): }) self.seed_and_run() self.use_default_project({ - "data-paths": ["seeds-merge-cols-initial"], + "data-paths": ["seeds-merge-cols-update"], "seeds": { "quote_columns": False }
switch to correct data dir for second run
py
diff --git a/tests/commands/migrate_config_test.py b/tests/commands/migrate_config_test.py index <HASH>..<HASH> 100644 --- a/tests/commands/migrate_config_test.py +++ b/tests/commands/migrate_config_test.py @@ -148,6 +148,7 @@ def test_migrate_config_sha_to_rev(tmpdir): ' hooks: []\n' ) + @pytest.mark.parametrize('contents', ('', '\n')) def test_empty_configuration_file_user_error(tmpdir, contents): cfg = tmpdir.join(C.CONFIG_FILE)
Update migrate_config_test.py Added second blank line between test_migrate_config_sha_to_rev and test_empty_configuration_file_user_error
py
diff --git a/heron/statemgrs/src/python/statemanager.py b/heron/statemgrs/src/python/statemanager.py index <HASH>..<HASH> 100644 --- a/heron/statemgrs/src/python/statemanager.py +++ b/heron/statemgrs/src/python/statemanager.py @@ -109,7 +109,6 @@ class StateManager: self.tunnel.append(subprocess.Popen( ('ssh', self.tunnelhost, '-NL127.0.0.1:%d:%s:%d' % (localport, host, port)))) localportlist.append(('127.0.0.1', localport)) - print (localportlist) return localportlist def terminate_ssh_tunnel(self):
Remove print statement that was accidentally left in
py
diff --git a/angr/analyses/propagator/propagator.py b/angr/analyses/propagator/propagator.py index <HASH>..<HASH> 100644 --- a/angr/analyses/propagator/propagator.py +++ b/angr/analyses/propagator/propagator.py @@ -493,7 +493,7 @@ class PropagatorAILState(PropagatorState): if start == 0: return ailment.Expr.Convert(None, expr.bits, bits, False, expr) else: - a = ailment.Expr.BinaryOp(None, "Shr", (expr, bits), False) + a = ailment.Expr.BinaryOp(None, "Shr", (expr, ailment.Expr.Const(None, None, bits, expr.bits)), False) return ailment.Expr.Convert(None, a.bits, bits, False, a) @staticmethod
Fix incorrect ailment expression construction in propogator (#<I>)
py
diff --git a/spacy/pipeline/textcat.py b/spacy/pipeline/textcat.py index <HASH>..<HASH> 100644 --- a/spacy/pipeline/textcat.py +++ b/spacy/pipeline/textcat.py @@ -138,7 +138,10 @@ class TextCategorizer(TrainablePipe): @property def label_data(self) -> List[str]: - """RETURNS (List[str]): Information about the component's labels.""" + """RETURNS (List[str]): Information about the component's labels. + + DOCS: https://nightly.spacy.io/api/textcategorizer#label_data + """ return self.labels def pipe(self, stream: Iterable[Doc], *, batch_size: int = 128) -> Iterator[Doc]: @@ -176,7 +179,7 @@ class TextCategorizer(TrainablePipe): return scores def set_annotations(self, docs: Iterable[Doc], scores) -> None: - """Modify a batch of [`Doc`](/api/doc) objects, using pre-computed scores. + """Modify a batch of Doc objects, using pre-computed scores. docs (Iterable[Doc]): The documents to modify. scores: The scores to set, produced by TextCategorizer.predict. @@ -330,7 +333,7 @@ class TextCategorizer(TrainablePipe): nlp: Optional[Language] = None, labels: Optional[Dict] = None, positive_label: Optional[str] = None, - ): + ) -> None: """Initialize the pipe for training, using a representative set of data examples.
Update docstrings and types [ci skip]
py
diff --git a/openquake/baselib/parallel.py b/openquake/baselib/parallel.py index <HASH>..<HASH> 100644 --- a/openquake/baselib/parallel.py +++ b/openquake/baselib/parallel.py @@ -457,7 +457,7 @@ class IterResult(object): if self.received and not self.name.startswith('_'): tot = sum(self.received) max_per_output = max(self.received) - msg = ('Received %s from %d tasks, maximum per output %s') + msg = 'Received %s from %d outputs, maximum per output %s' logging.info(msg, humansize(tot), len(self.received), humansize(max_per_output))
Improved logging [skip CI] Former-commit-id: <I>f<I>bfd<I>ee<I>e1ff<I>c<I>d<I>aa2b8f
py
diff --git a/src/Interface.py b/src/Interface.py index <HASH>..<HASH> 100755 --- a/src/Interface.py +++ b/src/Interface.py @@ -34,8 +34,8 @@ def del_interface(ifname): def __return_ip_address_from_ifconfig_output(output): for line in output.split('\n'): - if 'inet addr:' in line: - ipAddress = re.compile('addr\:([^\s]+)\s').search(line).group(1) + if 'inet ' in line or 'IP Address' in line: + ipAddress = re.match(r'.*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})', line).group(1) print "ip address is:" + ipAddress return ipAddress return ''
Modified parsing of ip address so that osx ifconfig and w<I> ipconfig outputs are parsed as well
py
diff --git a/zipline/data/minute_bars.py b/zipline/data/minute_bars.py index <HASH>..<HASH> 100644 --- a/zipline/data/minute_bars.py +++ b/zipline/data/minute_bars.py @@ -856,7 +856,7 @@ class BcolzMinuteBarWriter(object): truncate_slice_end = self.data_len_for_day(date) glob_path = os.path.join(self._rootdir, "*", "*", "*.bcolz") - sid_paths = glob(glob_path) + sid_paths = sorted(glob(glob_path)) for sid_path in sid_paths: file_name = os.path.basename(sid_path)
ENH: Add sorted to sid list when truncating. For repeatable order of truncates between invocations.
py
diff --git a/phy/cluster/manual/tests/conftest.py b/phy/cluster/manual/tests/conftest.py index <HASH>..<HASH> 100644 --- a/phy/cluster/manual/tests/conftest.py +++ b/phy/cluster/manual/tests/conftest.py @@ -6,6 +6,7 @@ # Imports #------------------------------------------------------------------------------ +import numpy as np from pytest import yield_fixture from phy.electrode.mea import staggered_positions @@ -70,6 +71,12 @@ def model(): model.masks = artificial_masks(n_spikes, n_channels) model.traces = artificial_traces(n_samples_t, n_channels) model.features = artificial_features(n_spikes, n_channels, n_features) + + # features_masks array + f = model.features.reshape((n_spikes, -1)) + m = np.repeat(model.masks, n_features, axis=1) + model.features_masks = np.dstack((f, m)) + model.spikes_per_cluster = _spikes_per_cluster(model.spike_clusters) model.n_features_per_channel = n_features model.n_samples_waveforms = n_samples_w
Add features_masks array in mock model
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -93,7 +93,11 @@ CLASSIFIERS = [ #~~~~~~~# setup(name='quantecon', - packages=['quantecon', 'quantecon.models', "quantecon.tests"], + packages=['quantecon', + 'quantecon.models', + 'quantecon.models.solow', + 'quantecon.tests', + ], version=VERSION, description=DESCRIPTION, long_description=LONG_DESCRIPTION,
Adding solow subpackage for the installer
py
diff --git a/samples/call_compute_service.py b/samples/call_compute_service.py index <HASH>..<HASH> 100644 --- a/samples/call_compute_service.py +++ b/samples/call_compute_service.py @@ -1,5 +1,6 @@ # To be used to test GoogleCredentials.get_application_default() # from local machine and GCE. +# The GCE virtual machine needs to have the Compute API enabled. from googleapiclient.discovery import build from oauth2client.client import GoogleCredentials
GCE VM needs the Compute API enabled Added a comment emphasizing that the GCE VM needs to have the Compute API enabled.
py
diff --git a/salt/modules/eix.py b/salt/modules/eix.py index <HASH>..<HASH> 100644 --- a/salt/modules/eix.py +++ b/salt/modules/eix.py @@ -22,7 +22,7 @@ def sync(): salt '*' eix.sync ''' - cmd = 'eix-sync -q' + cmd = 'eix-sync -q -C "--ask" -C "n"' return __salt__['cmd.retcode'](cmd) == 0
added "--ask n" to eix-sync (see #<I>)
py
diff --git a/tensor2tensor/utils/trainer_lib.py b/tensor2tensor/utils/trainer_lib.py index <HASH>..<HASH> 100644 --- a/tensor2tensor/utils/trainer_lib.py +++ b/tensor2tensor/utils/trainer_lib.py @@ -314,8 +314,7 @@ def create_estimator(model_name, use_tpu=use_tpu, train_batch_size=batch_size, eval_batch_size=batch_size if "eval" in schedule else None, - predict_batch_size=predict_batch_size, - experimental_export_device_assignment=True) + predict_batch_size=predict_batch_size) else: estimator = tf.estimator.Estimator( model_fn=model_fn,
Remove experimental_export_device_assignment from TPUEstimator.export_savedmodel(), so as to remove rewrite_for_inference(). As a replacement, export_savedmodel() V2 API supports device_assignment where user call tpu.rewrite in model_fn and pass in device_assigment there. PiperOrigin-RevId: <I>
py
diff --git a/wikitextparser/_spans.py b/wikitextparser/_spans.py index <HASH>..<HASH> 100644 --- a/wikitextparser/_spans.py +++ b/wikitextparser/_spans.py @@ -155,10 +155,12 @@ ATTRS_PATTERN = ( # noqa rb'(?<attr>' rb'[' + SPACE_CHARS + rb']++' rb'(?>' - + ATTR_NAME + ATTR_VAL + rb'|[^>\s]++)' - rb')*+' - rb'(?<attr_insert>)' -) + + ATTR_NAME + ATTR_VAL + # Invalid attribute. Todo: could be removed? see + # https://stackoverflow.com/a/3558200/2705757 + + rb'|(?>[^<>\s/]++|/(?!\s*+>))++' + rb')' + rb')*+(?<attr_insert>)') ATTRS_MATCH = regex_compile( # Leading space is not required at the start of the attribute string. ATTRS_PATTERN.replace(b'++', b'*+', 1),
fix(_spans.py): do not treat self-closing mark as invalid attribute
py
diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/classical.py +++ b/openquake/calculators/classical.py @@ -424,11 +424,11 @@ class ClassicalCalculator(PSHACalculator): self.datastore.set_attrs('hcurves', nbytes=totbytes) self.datastore.flush() - with self.monitor('postprocessing', autoflush=True, measuremem=True): - nbytes = parallel.Starmap( + with self.monitor('sending pmaps', autoflush=True, measuremem=True): + ires = parallel.Starmap( self.core_task.__func__, self.gen_args() - ).reduce(self.save_hcurves) - return nbytes + ).submit_all() + return ires.reduce(self.save_hcurves) # nbytes def gen_args(self): """
Monitored sending pmaps
py
diff --git a/_data.py b/_data.py index <HASH>..<HASH> 100644 --- a/_data.py +++ b/_data.py @@ -1326,7 +1326,7 @@ class fitter(): This warning is suppressed if self._safe_settings['silent'] is True. """ - if self['silent'] is True: + if self._settings['silent'][0] is True: pass elif eydata is None: print "\nWARNING: Setting eydata=None (i.e. the default) results in a random guess for the error bars associated with ydata. This will allow you to fit, but results in meaningless fit errors. Please estimate your errors and supply an argument such as:\n"
'silent' setting is now functional for the eydata error message.
py
diff --git a/pysc2/env/sc2_env.py b/pysc2/env/sc2_env.py index <HASH>..<HASH> 100644 --- a/pysc2/env/sc2_env.py +++ b/pysc2/env/sc2_env.py @@ -173,6 +173,7 @@ class SC2Env(environment.Base): Raises: ValueError: if the agent_race, bot_race or difficulty are invalid. + ValueError: if too many players are requested for a map. ValueError: if the resolutions aren't specified correctly. DeprecationWarning: if screen_size_px or minimap_size_px are sent. DeprecationWarning: if agent_race, bot_race or difficulty are sent. @@ -235,6 +236,12 @@ class SC2Env(environment.Base): raise ValueError("Missing replay_dir") self._map = maps.get(map_name) + + if self._map.players and self._num_players > self._map.players: + raise ValueError( + "Map only supports %s players, but trying to join with %s" % ( + self._map.players, self._num_players)) + self._discount = discount self._step_mul = step_mul or self._map.step_mul self._save_replay_episodes = save_replay_episodes
Raise an error if more players are requested than the map supports. PiperOrigin-RevId: <I>
py
diff --git a/grimoire_elk/_version.py b/grimoire_elk/_version.py index <HASH>..<HASH> 100644 --- a/grimoire_elk/_version.py +++ b/grimoire_elk/_version.py @@ -1,2 +1,2 @@ # Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440 -__version__ = "0.50.0" +__version__ = "0.51.0"
Update version number to <I>
py
diff --git a/tests/test_bdist_dumb.py b/tests/test_bdist_dumb.py index <HASH>..<HASH> 100644 --- a/tests/test_bdist_dumb.py +++ b/tests/test_bdist_dumb.py @@ -71,6 +71,21 @@ class BuildDumbTestCase(support.TempdirManager, # now let's check what we have in the zip file # XXX to be done + def test_finalize_options(self): + pkg_dir, dist = self.create_dist() + os.chdir(pkg_dir) + cmd = bdist_dumb(dist) + self.assertEquals(cmd.bdist_dir, None) + cmd.finalize_options() + + # bdist_dir is initialized to bdist_base/dumb if not set + base = cmd.get_finalized_command('bdist').bdist_base + self.assertEquals(cmd.bdist_dir, os.path.join(base, 'dumb')) + + # the format is set to a default value depending on the os.name + default = cmd.default_format[os.name] + self.assertEquals(cmd.format, default) + def test_suite(): return unittest.makeSuite(BuildDumbTestCase)
raising bdist_dumb test coverage
py
diff --git a/demo_and_tests/model_filefields_example/urls.py b/demo_and_tests/model_filefields_example/urls.py index <HASH>..<HASH> 100644 --- a/demo_and_tests/model_filefields_example/urls.py +++ b/demo_and_tests/model_filefields_example/urls.py @@ -42,7 +42,7 @@ urlpatterns = [ r'^cds/delete/(?P<pk>\d+)/$', DeleteView.as_view( model=CD, - success_url=reverse_lazy('cd.list') + success_url=reverse_lazy('model_files:cd.list') ), name='cd.delete' ),
Fix redirect after deleting CDs in demo project
py
diff --git a/zake/tests/test_client.py b/zake/tests/test_client.py index <HASH>..<HASH> 100644 --- a/zake/tests/test_client.py +++ b/zake/tests/test_client.py @@ -77,7 +77,7 @@ class TestClient(test.Test): with start_close(self.client) as c: self.assertTrue(c.connected) self.assertEqual("imok", c.command(b'ruok')) - self.client.command('kill') + self.client.command(b'kill') self.assertFalse(c.connected) def test_command_version(self):
Ensure kill command is sent as byte string
py
diff --git a/zinnia/__init__.py b/zinnia/__init__.py index <HASH>..<HASH> 100644 --- a/zinnia/__init__.py +++ b/zinnia/__init__.py @@ -1,5 +1,5 @@ """Zinnia""" -__version__ = '0.13' +__version__ = '0.14.dev' __license__ = 'BSD License' __author__ = 'Fantomas42'
Bumping to version <I>.dev
py
diff --git a/fedmsg/meta/base.py b/fedmsg/meta/base.py index <HASH>..<HASH> 100644 --- a/fedmsg/meta/base.py +++ b/fedmsg/meta/base.py @@ -154,7 +154,7 @@ class BaseProcessor(object): return match.groups()[-1] or "" def title(self, msg, **config): - if msg['topic'][0].isalpha(): + if not msg['topic'].startswith('/topic/'): return '.'.join(msg['topic'].split('.')[3:]) return msg['topic']
Use something more clear than .isalpha.
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,5 +17,5 @@ setup( author='Luis y Anita', author_email='[email protected]', description='The trackmodels library is useful to set creation/update/delete dates on models and track by them', - install_requires=['Django>=1.7', 'python-dateutil>=2.6.1', 'python-cantrips>=7.5'] -) \ No newline at end of file + install_requires=['Django>=1.7', 'python-dateutil>=2.6.1', 'python-cantrips>=0.7.5'] +)
Web update of <I> A redeploy of package in version <I> must be done.
py
diff --git a/tests/unit/netapi/test_rest_tornado.py b/tests/unit/netapi/test_rest_tornado.py index <HASH>..<HASH> 100644 --- a/tests/unit/netapi/test_rest_tornado.py +++ b/tests/unit/netapi/test_rest_tornado.py @@ -130,6 +130,8 @@ class SaltnadoTestCase(TestCase, AdaptedConfigurationTestCaseMixin, AsyncHTTPTes del self._test_generator if hasattr(self, "application"): del self.application + if hasattr(self, "patched_environ"): + del self.patched_environ def build_tornado_app(self, urls): application = salt.ext.tornado.web.Application(urls, debug=True)
Address teardown warning in test_rest_tornado
py
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -97,8 +97,15 @@ from __future__ import print_function, division import dimod from dwave.embedding import * -from dwave.system import * +#from dwave.system import * + +from unittest.mock import Mock +from dwave.system.testing import MockDWaveSampler +import dwave.system +dwave.system.DWaveSampler = Mock() +dwave.system.DWaveSampler.side_effect = MockDWaveSampler +from dwave.system import * """
Update conf.py for mock DWaveSampler
py
diff --git a/examples/tutorial.py b/examples/tutorial.py index <HASH>..<HASH> 100644 --- a/examples/tutorial.py +++ b/examples/tutorial.py @@ -278,7 +278,7 @@ ref_cell.add( 'Created with gdspy ' + gdspy.__version__, (-7, -36), 'nw', layer=6)) # ------------------------------------------------------------------ # -# Translation +# TRANSLATION AND REFLECTION # ------------------------------------------------------------------ # trans_cell = gdspy.Cell('TRANS') @@ -313,6 +313,12 @@ trans_cell.add(text2) trans_cell.add(label1) trans_cell.add(label2) +# Reflection across a line defined by 2 points allows the mirroring of +# a polygon over an arbitrary axis: mirror(p1,p2) +rect4 = gdspy.Rectangle((80, 0), (81, 1), 3) +rect4.mirror((80, 2), (79, 0)) +trans_cell.add(rect4) + # ------------------------------------------------------------------ # # OUTPUT # ------------------------------------------------------------------ #
Update tutorial.py Reflection across a line defined by 2 points allows the mirroring of a polygon over an arbitrary axis.
py
diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index <HASH>..<HASH> 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -19,14 +19,18 @@ class install_lib(orig.install_lib): excluded for single_version_externally_managed installations. """ exclude = set() - pkg_path = lambda pkg: os.path.join(self.install_dir, *pkg.split('.')) + + def _exclude(pkg, exclusion_path): + parts = pkg.split('.') + [exclusion_path] + return os.path.join(self.install_dir, *parts) + all_packages = ( pkg for ns_pkg in self._get_SVEM_NSPs() for pkg in self._all_packages(ns_pkg) ) for pkg, f in product(all_packages, self._gen_exclude_names()): - exclude.add(os.path.join(pkg_path(pkg), f)) + exclude.add(_exclude(pkg, f)) return exclude @staticmethod
Incorporate the exclusion path in the _exclude function.
py
diff --git a/modules/CUAV/camera.py b/modules/CUAV/camera.py index <HASH>..<HASH> 100644 --- a/modules/CUAV/camera.py +++ b/modules/CUAV/camera.py @@ -512,6 +512,7 @@ def reload_mosaic(mosaic): try: composite = cv.LoadImage(last_joe.thumb_filename) thumbs = cuav_mosaic.ExtractThumbs(composite, len(regions)) + mosaic.set_brightness(state.settings.brightness) mosaic.add_regions(regions, thumbs, last_joe.image_filename, last_joe.pos) except Exception: pass @@ -522,6 +523,7 @@ def reload_mosaic(mosaic): try: composite = cv.LoadImage(last_joe.thumb_filename) thumbs = cuav_mosaic.ExtractThumbs(composite, len(regions)) + mosaic.set_brightness(state.settings.brightness) mosaic.add_regions(regions, thumbs, last_joe.image_filename, last_joe.pos) except Exception: pass @@ -625,6 +627,7 @@ def view_thread(): log_joe_position(pos, obj.frame_time, obj.regions, filename, thumb_filename) # update the mosaic and map + mosaic.set_brightness(state.settings.brightness) mosaic.add_regions(obj.regions, thumbs, filename, pos=pos) # update console display
camera: added set_brightness() call
py
diff --git a/moneyed/test_moneyed_classes.py b/moneyed/test_moneyed_classes.py index <HASH>..<HASH> 100644 --- a/moneyed/test_moneyed_classes.py +++ b/moneyed/test_moneyed_classes.py @@ -136,7 +136,7 @@ class TestMoney: one_million_pln = Money('1000000', 'PLN') # Two decimal places by default assert format_money(one_million_pln, locale='pl_PL') == '1 000 000,00 zł' - assert format_money(self.one_million_bucks, locale='pl_PL') == '1 000 000,00 USD' + assert format_money(self.one_million_bucks, locale='pl_PL') == 'US$1 000 000,00' # No decimal point without fractional part assert format_money(one_million_pln, locale='pl_PL', decimal_places=0) == '1 000 000 zł'
Change test to reflect intended functionality Tests were failing due to `pl_PL` now reverting to `DEFAULT` due to not having a sign definition set for USD.
py
diff --git a/gromacs/cbook.py b/gromacs/cbook.py index <HASH>..<HASH> 100644 --- a/gromacs/cbook.py +++ b/gromacs/cbook.py @@ -461,6 +461,19 @@ def grompp_qtot(*args, **kwargs): logger.info("system total charge qtot = %(qtot)r" % vars()) return qtot +def get_volume(f): + """Return the volume in nm^3 of structure file *f*. + + (Uses :func:`gromacs.editconf`; error handling is not good) + """ + fd, temp = tempfile.mkstemp('.gro') + try: + rc,out,err = gromacs.editconf(f=f, o=temp, stdout=False) + finally: + os.unlink(temp) + return [float(x.split()[1]) for x in out.splitlines() + if x.startswith('Volume:')][0] + # Editing textual input files # ---------------------------
simple function to get volume from pdb/gro file (uses CRYST or box --- or whatever editconf does)
py
diff --git a/hbmqtt/client.py b/hbmqtt/client.py index <HASH>..<HASH> 100644 --- a/hbmqtt/client.py +++ b/hbmqtt/client.py @@ -375,6 +375,8 @@ class MQTTClient: cadata=self.session.cadata) if 'certfile' in self.config and 'keyfile' in self.config: sc.load_cert_chain(self.config['certfile'], self.config['keyfile']) + if 'check_hostname' in self.config and isinstance(self.config['check_hostname'], bool): + sc.check_hostname = self.config['check_hostname'] kwargs['ssl'] = sc try:
disables verification of the server hostname in the server certificate
py
diff --git a/quark/db/models.py b/quark/db/models.py index <HASH>..<HASH> 100644 --- a/quark/db/models.py +++ b/quark/db/models.py @@ -30,6 +30,9 @@ from neutron.openstack.common import timeutils from quark.db import custom_types #NOTE(mdietz): This is the only way to actually create the quotas table, # regardless if we need it. This is how it's done upstream. +#NOTE(jhammond): If it isn't obvious quota_driver is unused and that's ok. +# DO NOT DELETE IT!!! +from quark import quota_driver # noqa HasId = models.HasId
Adding import for quotas again
py
diff --git a/pyOCD/debug/cache.py b/pyOCD/debug/cache.py index <HASH>..<HASH> 100644 --- a/pyOCD/debug/cache.py +++ b/pyOCD/debug/cache.py @@ -180,7 +180,10 @@ class RegisterCache(object): # Just remove all cached CFBP based register values. if writing_cfbp: for r in self.CFBP_REGS: - del self._cache[r] + try: + del self._cache[r] + except KeyError: + pass # Write new register values to target. self._context.writeCoreRegistersRaw(reg_list, data_list)
Ignore missing CFBP entries in register cache when updating a CFBP register.
py
diff --git a/pymatgen/transformations/tests/test_advanced_transformations.py b/pymatgen/transformations/tests/test_advanced_transformations.py index <HASH>..<HASH> 100644 --- a/pymatgen/transformations/tests/test_advanced_transformations.py +++ b/pymatgen/transformations/tests/test_advanced_transformations.py @@ -211,11 +211,12 @@ class EnumerateStructureTransformationTest(unittest.TestCase): def test_max_disordered_sites(self): l = Lattice.cubic(4) s_orig = Structure(l, [{"Li": 0.2, "Na": 0.2, "K": 0.6}, {"O": 1}], - [[0, 0, 0], [0.5, 0.5, 0.5]]) + [[0, 0, 0], [0.5, 0.5, 0.5]]) est = EnumerateStructureTransformation(max_cell_size=None, max_disordered_sites=5) - s = est.apply_transformation(s_orig) - self.assertEqual(len(s), 8) + dd = est.apply_transformation(s_orig, return_ranked_list=100) + for d in dd: + self.assertEqual(len(d["structure"]), 10) def test_to_from_dict(self): trans = EnumerateStructureTransformation()
Fix old bug in code. The funny thing is that it should have been caught last time. There is no way you can order a Li:<I>, Na<I>, K:<I> with a 5x supercell with only 8 atoms!!! It obviously must have <I> atoms! Whoever wrote this test really didn't think through it. Otherwise, the EnumlibAdaptor bug would have been caught earlier.
py
diff --git a/ns_api/ns_api.py b/ns_api/ns_api.py index <HASH>..<HASH> 100644 --- a/ns_api/ns_api.py +++ b/ns_api/ns_api.py @@ -11,7 +11,7 @@ def _parse_time_delay(time): delay = 0 delay_unit = '' if len(splitted) > 1: - delay = splitted[2] + delay = int(splitted[2]) delay_unit = splitted[3] return timestamp, delay, delay_unit @@ -173,6 +173,8 @@ def route(depart_station, to_station, via, date, time): if rowcounter == 4: if 'departure_delay' not in route_parts[partcounter]: route_parts[partcounter]['departure_delay'] = 0 + route_parts[partcounter]['departure_delay'] = int(route_parts[partcounter]['departure_delay']) + route_parts[partcounter]['arrival_delay'] = int(route_parts[partcounter]['arrival_delay']) rowcounter = 0 partcounter += 1 route_parts.append({})
Ensure that delays are ints, should fix #4
py
diff --git a/bokeh/tests/test_client_server.py b/bokeh/tests/test_client_server.py index <HASH>..<HASH> 100644 --- a/bokeh/tests/test_client_server.py +++ b/bokeh/tests/test_client_server.py @@ -288,7 +288,7 @@ class TestClientServer(unittest.TestCase): # Clean up global IO state reset_output() - def test_client_session_callback(self): + def test_session_periodic_callback(self): application = Application() with ManagedServerLoop(application) as server: doc = document.Document()
rename test as it's really testing periodic callbacks on both client and server sessions
py
diff --git a/python/segyio/segy.py b/python/segyio/segy.py index <HASH>..<HASH> 100644 --- a/python/segyio/segy.py +++ b/python/segyio/segy.py @@ -14,6 +14,7 @@ segyio which you can find in the examples directory or where your distribution installs example programs. """ import itertools +import warnings try: from future_builtins import zip range = xrange @@ -67,13 +68,20 @@ class SegyFile(object): self._tracecount = metrics['tracecount'] self._ext_headers = metrics['ext_headers'] - self._dtype = np.dtype({ - 1: np.float32, - 2: np.int32, - 3: np.int16, - 5: np.float32, - 8: np.int8, - }[self._fmt]) + try: + self._dtype = np.dtype({ + 1: np.float32, + 2: np.int32, + 3: np.int16, + 5: np.float32, + 8: np.int8, + }[self._fmt]) + except KeyError: + problem = 'Unknown trace value format {}'.format(self._fmt) + solution = 'falling back to ibm float' + warnings.warn(', '.join((problem, solution))) + self._fmt = 1 + self._dtype = np.dtype(np.float32) super(SegyFile, self).__init__()
Warn and fall back to ibm float if missing format
py
diff --git a/plenum/test/conftest.py b/plenum/test/conftest.py index <HASH>..<HASH> 100644 --- a/plenum/test/conftest.py +++ b/plenum/test/conftest.py @@ -91,14 +91,15 @@ def logcapture(request, whitelist): whiteListedExceptions = ['seconds to run once nicely', 'Executing %s took %.3f seconds', 'is already stopped', - 'Error while running coroutine'] + whitelist + 'Error while running coroutine', + "Beta discarding message INSTANCE_CHANGE(viewNo='BAD') because field viewNo has incorrect type: <class 'str'>" + ] + whitelist def tester(record): isBenign = record.levelno not in [logging.ERROR, logging.CRITICAL] # TODO is this sufficient to test if a log is from test or not? isTest = os.path.sep + 'test' in record.pathname - isWhiteListed = bool([w for w in whiteListedExceptions - if w in record.msg]) + isWhiteListed = bool([w for w in whiteListedExceptions if w in record.msg]) assert isBenign or isTest or isWhiteListed ch = TestingHandler(tester)
update conftest so that it ignores logging of message discarding with reason of incorrect type
py
diff --git a/pytradfri/api/aiocoap_api.py b/pytradfri/api/aiocoap_api.py index <HASH>..<HASH> 100644 --- a/pytradfri/api/aiocoap_api.py +++ b/pytradfri/api/aiocoap_api.py @@ -99,6 +99,9 @@ class APIFactory: except Error as e: yield from self._reset_protocol(e) raise ServerError("There was an error with the request.", e) + except asyncio.CancelledError as e: + yield from self._reset_protocol(e) + raise e @asyncio.coroutine def _execute(self, api_command):
Clean up on asyncio.CancelledError (#<I>)
py
diff --git a/tests/conftest.py b/tests/conftest.py index <HASH>..<HASH> 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -108,6 +108,7 @@ _pytest.logging._LiveLoggingStreamHandler = LiveLoggingStreamHandler # Reset logging root handlers for handler in logging.root.handlers[:]: logging.root.removeHandler(handler) + handler.close() # Reset the root logger to its default level(because salt changed it)
Explicitly close the removed handlers
py
diff --git a/mordred.py b/mordred.py index <HASH>..<HASH> 100755 --- a/mordred.py +++ b/mordred.py @@ -62,7 +62,8 @@ logger = logging.getLogger(__name__) class Task(): """ Basic class shared by all tasks """ - ES_INDEX_FIELDS = ['enriched_index', 'raw_index'] + # filter-raw is used to filter the raw index to do partial enrichment + ES_INDEX_FIELDS = ['enriched_index', 'raw_index', 'filter-raw'] def __init__(self, conf): self.conf = conf @@ -627,6 +628,9 @@ class TaskEnrich(Task): github_token = None if 'github' in self.conf and 'backend_token' in self.conf['github']: github_token = self.conf['github']['backend_token'] + filter_raw = None + if 'filter-raw' in cfg[self.backend_name]: + filter_raw = cfg[self.backend_name]['filter-raw'] only_studies = False only_identities=False for r in self.repos: @@ -651,7 +655,10 @@ class TaskEnrich(Task): cfg['sh_password'], cfg['sh_host'], None, #args.refresh_projects, - None) #args.refresh_identities) + None, #args.refresh_identities, + author_id=None, + author_uuid=None, + filter_raw=filter_raw) except KeyError as e: logger.exception(e)
[filter-raw] Add filter-raw support to mordred so it can done particial enrichment from filtered raw items
py
diff --git a/experimental/m2m/motra.py b/experimental/m2m/motra.py index <HASH>..<HASH> 100644 --- a/experimental/m2m/motra.py +++ b/experimental/m2m/motra.py @@ -174,7 +174,7 @@ class Transformation(object): def when_inner(*args, **kwargs): if when(*args, **kwargs): return inner(*args, **kwargs) - return when_inner + return when_inner cached_fun = functools.lru_cache()(inner) f.cache = cached_fun return cached_fun
Fix mapping cache issue for motra mappings
py
diff --git a/tests/web_client_test.py b/tests/web_client_test.py index <HASH>..<HASH> 100644 --- a/tests/web_client_test.py +++ b/tests/web_client_test.py @@ -146,8 +146,7 @@ class WebClientTestCase(base.TestCase): cmd = ( os.path.join( - ROOT_DIR, 'node_modules', 'phantomjs-prebuilt', 'lib', 'phantom', - 'bin', 'phantomjs'), + ROOT_DIR, 'node_modules', '.bin', 'phantomjs'), '--web-security=%s' % self.webSecurity, os.path.join(ROOT_DIR, 'clients', 'web', 'test', 'specRunner.js'), 'http://localhost:%s%s' % (os.environ['GIRDER_PORT'], baseUrl),
Fix path to phantomjs binary
py
diff --git a/python/thunder/factorization/pca.py b/python/thunder/factorization/pca.py index <HASH>..<HASH> 100755 --- a/python/thunder/factorization/pca.py +++ b/python/thunder/factorization/pca.py @@ -11,7 +11,7 @@ import sys import os from thunder.util.dataio import parse, saveout -from thunder.factorization.util import svd1 +from thunder.factorization.util import svd1, svd3 from pyspark import SparkContext argsIn = sys.argv[1:] @@ -33,7 +33,7 @@ lines = sc.textFile(dataFile) data = parse(lines, "raw").cache() # do pca -comps, latent, scores = svd1(data, k) +comps, latent, scores = svd3(data, k, 0) saveout(comps, outputDir, "comps", "matlab") saveout(latent, outputDir, "latent", "matlab") saveout(scores, outputDir, "scores", "matlab", k)
Added svd3 option
py
diff --git a/climlab/__init__.py b/climlab/__init__.py index <HASH>..<HASH> 100644 --- a/climlab/__init__.py +++ b/climlab/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.2.12' +__version__ = '0.2.13' # This list defines all the modules that will be loaded if a user invokes # from climLab import *
Increment version number to <I> Merged Moritz's new process modules.
py
diff --git a/salt/cloud/clouds/ec2.py b/salt/cloud/clouds/ec2.py index <HASH>..<HASH> 100644 --- a/salt/cloud/clouds/ec2.py +++ b/salt/cloud/clouds/ec2.py @@ -2583,6 +2583,10 @@ def create(vm_=None, call=None): transport=__opts__['transport'] ) + # Ensure that the latest node data is returned + node = _get_node(instance_id=vm_['instance_id']) + ret.update(node) + return ret
Ensure that the latest node data is returned
py
diff --git a/lib/ansibleinventorygrapher/inventory.py b/lib/ansibleinventorygrapher/inventory.py index <HASH>..<HASH> 100755 --- a/lib/ansibleinventorygrapher/inventory.py +++ b/lib/ansibleinventorygrapher/inventory.py @@ -95,8 +95,9 @@ class Inventory20(Inventory): class Inventory24(Inventory): def ask_vault_password(self): - from ansible.parsing.vault import PromptVaultPass - return PromptVaultPass.ask_vault_passwords()[0] + from ansible.parsing.vault import PromptVaultSecret + prompt_vault_secret = PromptVaultSecret() + return prompt_vault_secret.ask_vault_passwords()[0] def __init__(self, inventory, ask_vault_pass, vault_password_file): from ansible.parsing.vault import FileVaultSecret
Fix broken ask_vault_password for Ansible <I> Ensure asking for a vault password actually works Fixes #<I> Fixes #<I>
py
diff --git a/cirq/ops/wait_gate.py b/cirq/ops/wait_gate.py index <HASH>..<HASH> 100644 --- a/cirq/ops/wait_gate.py +++ b/cirq/ops/wait_gate.py @@ -138,9 +138,9 @@ def wait( *target: The qubits that should wait. value: Wait duration (see Duration). picos: Picoseconds to wait (see Duration). - nanos: Picoseconds to wait (see Duration). - micros: Picoseconds to wait (see Duration). - millis: Picoseconds to wait (see Duration). + nanos: Nanoseconds to wait (see Duration). + micros: Microseconds to wait (see Duration). + millis: Milliseconds to wait (see Duration). """ return WaitGate( duration=value.Duration(
Fix docstring for wait helper function (#<I>) Fixes #<I>
py
diff --git a/test/test_autopep8.py b/test/test_autopep8.py index <HASH>..<HASH> 100755 --- a/test/test_autopep8.py +++ b/test/test_autopep8.py @@ -380,6 +380,11 @@ sys.maxint self.assertFalse(autopep8.match_file(os.devnull, exclude=[])) + with temporary_file_context('', suffix='.py', prefix='') as filename: + self.assertTrue(autopep8.match_file(filename, exclude=[]), + msg=filename) + + class SystemTests(unittest.TestCase):
Add test for positive case of match_file()
py
diff --git a/tests/sqlcoverage/SQLCoverageReport.py b/tests/sqlcoverage/SQLCoverageReport.py index <HASH>..<HASH> 100755 --- a/tests/sqlcoverage/SQLCoverageReport.py +++ b/tests/sqlcoverage/SQLCoverageReport.py @@ -356,7 +356,7 @@ def is_different(x, cntonly, within_minutes): # in that case, do not fail the test. This will be caught later # as a 'cmpdb_excep' - an exception in the comparison DB - and # reported as such in the 'SQL Coverage Test Summary', but without - # a test failure (see ENG-19845 & ENG-19702) + # a test failure (see ENG-19845 & ENG-19702) if (int(jni["Status"]) > 0 and int(cmp["Status"]) < 0 and any(nfet in str(cmp) for nfet in NonfatalExceptionTypes)): return False
Removed one trailing space, to fix licensecheck test
py
diff --git a/src/transformers/models/marian/modeling_flax_marian.py b/src/transformers/models/marian/modeling_flax_marian.py index <HASH>..<HASH> 100644 --- a/src/transformers/models/marian/modeling_flax_marian.py +++ b/src/transformers/models/marian/modeling_flax_marian.py @@ -986,7 +986,7 @@ class FlaxMarianPreTrainedModel(FlaxPreTrainedModel): ```python >>> from transformers import MarianTokenizer, FlaxMarianMTModel - >>> tokenizer = MarianTokenizer.from_pretrained("facebook/marian-large-cnn") + >>> tokenizer = MarianTokenizer.from_pretrained("Helsinki-NLP/opus-mt-en-de") >>> model = FlaxMarianMTModel.from_pretrained("Helsinki-NLP/opus-mt-en-de") >>> text = "My friends are cool but they eat too many carbs." @@ -1054,7 +1054,7 @@ class FlaxMarianPreTrainedModel(FlaxPreTrainedModel): >>> import jax.numpy as jnp >>> from transformers import MarianTokenizer, FlaxMarianMTModel - >>> tokenizer = MarianTokenizer.from_pretrained("facebook/marian-large-cnn") + >>> tokenizer = MarianTokenizer.from_pretrained("Helsinki-NLP/opus-mt-en-de") >>> model = FlaxMarianMTModel.from_pretrained("Helsinki-NLP/opus-mt-en-de") >>> text = "My friends are cool but they eat too many carbs."
fix wrong tokenizer checkpoint name in flax marian (#<I>)
py
diff --git a/jsmin/test.py b/jsmin/test.py index <HASH>..<HASH> 100644 --- a/jsmin/test.py +++ b/jsmin/test.py @@ -325,5 +325,12 @@ var foo = "hey"; original = '/a (a)/.test("a")' self.assertMinified(original, original) + def test_angular_1(self): + original = '''var /** holds major version number for IE or NaN for real browsers */ + msie, + jqLite, // delay binding since jQuery could be loaded after us.''' + minified = jsmin.jsmin(original) + self.assertIn('var msie', minified) + if __name__ == '__main__': unittest.main()
Failing test from issue #<I> --HG-- branch : stable
py
diff --git a/wpull/ftp/client.py b/wpull/ftp/client.py index <HASH>..<HASH> 100644 --- a/wpull/ftp/client.py +++ b/wpull/ftp/client.py @@ -171,6 +171,7 @@ class Session(BaseSession): ''' # TODO: the recorder needs to fit inside here data_connection = None + data_stream = None @trollius.coroutine def connection_factory(address): @@ -184,12 +185,22 @@ class Session(BaseSession): connection_factory )) + if self._recorder_session: + def data_callback(action, data): + if action == 'read': + self._recorder_session.response_data(data) + + data_stream.data_observer.add(data_callback) + reply = yield From(self._commander.read_stream( command, file, data_stream )) raise Return(reply) finally: + if data_stream: + data_stream.data_observer.clear() + if data_connection: data_connection.close() self._connection_pool.check_in(data_connection)
ftp.client: Implement recorder on data stream read
py
diff --git a/libaio/__init__.py b/libaio/__init__.py index <HASH>..<HASH> 100644 --- a/libaio/__init__.py +++ b/libaio/__init__.py @@ -341,8 +341,8 @@ class AIOContext(object): Cancel all submitted IO blocks. Blocks until all submitted transfers have been finalised. - Submitting more transfers while this method is running produces - undefined behaviour. + Submitting more transfers or processing completion events while this + method is running produces undefined behaviour. Returns the list of values returned by individual cancellations. See "cancel" documentation. """
libaio: Handling events while cancelAll is running is also undefined.
py
diff --git a/pftree/pftree.py b/pftree/pftree.py index <HASH>..<HASH> 100755 --- a/pftree/pftree.py +++ b/pftree/pftree.py @@ -124,7 +124,6 @@ class pftree(object): f_percent = index/total*100 str_num = "[%3d/%3d: %6.2f%%] " % (index, total, f_percent) str_bar = "*" * int(f_percent) - pudb.set_trace() self.dp.qprint("%s%s%s" % (str_pretext, str_num, str_bar), stackDepth = 2) def tree_probe(self, **kwargs): @@ -201,7 +200,7 @@ class pftree(object): for l_series in l_files: str_path = os.path.dirname(l_series[0]) l_series = [ os.path.basename(i) for i in l_series] - self.simpleProgress_show(index, total, 'tree_construct') + self.simpleProgress_show(index, total) self.d_inputTree[str_path] = l_series if fn_constructCallback: kwargs['path'] = str_path
Improve simpleProgress_show reporting.
py
diff --git a/odl/operator/solvers.py b/odl/operator/solvers.py index <HASH>..<HASH> 100644 --- a/odl/operator/solvers.py +++ b/odl/operator/solvers.py @@ -290,10 +290,36 @@ class BacktrackingLineSearch(object): return alpha class ConstantLineSearch(object): + """A 'linear search' object that returns a constant step length. """ + def __init__(self, constant): + """ + Parameters + ---------- + constant : float + The constant step length that the 'line search' object should + return. + """ self.constant = constant def __call__(self, x, direction, gradf): + """ + Parameters + ---------- + (Can in theory be skipped since a constant step length will be returned + no matter their values) + x : domain element + The current point. + direction : domain element + The search direction in which the line search should be computed. + dir_derivative : float + The directional derivative along the direction 'direction'. + + Returns + ------- + alpha : float + The step length. + """ return self.constant def quasi_newton_bfgs(op, x, line_search, niter=1, partial=None):
Added doc about inputs and outputs for the constant 'line search' method.
py
diff --git a/LiSE/setup.py b/LiSE/setup.py index <HASH>..<HASH> 100644 --- a/LiSE/setup.py +++ b/LiSE/setup.py @@ -35,7 +35,8 @@ setup( packages=[ "LiSE", "LiSE.server", - "LiSE.examples" + "LiSE.examples", + "LiSE.allegedb" ], package_data={ 'LiSE': ['sqlite.json']
Add allegedb in setup.py
py
diff --git a/jaraco/util/itertools.py b/jaraco/util/itertools.py index <HASH>..<HASH> 100644 --- a/jaraco/util/itertools.py +++ b/jaraco/util/itertools.py @@ -317,6 +317,10 @@ def grouper_nofill(n, iterable): >>> c = grouper_nofill(3, range(11)) + c should be an iterator + >>> hasattr(c, 'next') + True + >>> tuple(c) ((0, 1, 2), (3, 4, 5), (6, 7, 8), (9, 10)) """
Add an important test to ensure result is an iterator.
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ except (IOError, ImportError, RuntimeError): long_description = 'Tools for manipulating and parsing vcf files' setup(name='vcftoolbox', - version='1.0', + version='1.1', description='Tools for manipulating and parsing vcf files', author = 'Mans Magnusson', author_email = '[email protected]',
Bumped version to <I>
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,13 @@ from setuptools import setup, Extension from setuptools import find_packages -import numpy +import sys + +try: + import numpy +except ImportError: + print 'numpy is required to install numina' + sys.exit(1) numpy_include = numpy.get_include() cext = Extension('numina.array._combine',
check if numpy is installed and faill gracefully if not
py
diff --git a/pymatbridge/__init__.py b/pymatbridge/__init__.py index <HASH>..<HASH> 100644 --- a/pymatbridge/__init__.py +++ b/pymatbridge/__init__.py @@ -1,5 +1,5 @@ from pymatbridge import * - +from publish import * try: from matlab_magic import * except ImportError:
Modified __init__.py so that publish is now importable
py
diff --git a/germanet.py b/germanet.py index <HASH>..<HASH> 100644 --- a/germanet.py +++ b/germanet.py @@ -499,7 +499,7 @@ class Synset(object): ic1 = -math.log(ic1) ic2 = -math.log(ic2) ic_lcs = self.sim_res(other) - return 1. / (ic1 + ic2 - 2. * ic_lcs) + return ic1 + ic2 - 2. * ic_lcs def sim_lin(self, other): '''
germanet: fix typo to Synset.dist_jcn
py
diff --git a/tests/test_prepare.py b/tests/test_prepare.py index <HASH>..<HASH> 100644 --- a/tests/test_prepare.py +++ b/tests/test_prepare.py @@ -360,7 +360,7 @@ class TestPrepare(tb.ConnectedTestCase): async def test_prepare_19_concurrent_calls(self): st = self.loop.create_task(self.con.fetchval( - 'SELECT ROW(pg_sleep(0.03), 1)')) + 'SELECT ROW(pg_sleep(0.1), 1)')) # Wait for some time to make sure the first query is fully # prepared (!) and is now awaiting the results (!!).
tests: Increase another timeout to make travis happy.
py
diff --git a/plop/collector.py b/plop/collector.py index <HASH>..<HASH> 100644 --- a/plop/collector.py +++ b/plop/collector.py @@ -17,6 +17,11 @@ class Collector(object): self.interval = interval self.mode = mode assert mode in Collector.MODES + timer, sig = Collector.MODES[self.mode] + signal.signal(sig, self.handler) + self.reset() + + def reset(self): # defaultdict instead of counter for pre-2.7 compatibility self.stack_counts = collections.defaultdict(int) self.samples_remaining = 0 @@ -31,7 +36,6 @@ class Collector(object): self.stopped = False self.samples_remaining = int(duration / self.interval) timer, sig = Collector.MODES[self.mode] - signal.signal(sig, self.handler) platform.setitimer(timer, self.interval, self.interval) def stop(self):
Move signal handler setting to __init__ (for threading reasons), add reset()
py
diff --git a/tests/upgrade_integration/upgrade_test.py b/tests/upgrade_integration/upgrade_test.py index <HASH>..<HASH> 100644 --- a/tests/upgrade_integration/upgrade_test.py +++ b/tests/upgrade_integration/upgrade_test.py @@ -52,7 +52,7 @@ class TestUpgrade(DustyIntegrationTestCase): shutil.copy('dist/dusty', 'dist/python') self.run_daemon_binary(path='./dist/python') with self.assertRaises(self.CommandError): - self.run_command('upgrade') + self.run_command('upgrade 0.2.2') self.assertBinaryVersionUnchanged() def assertBinaryVersionUnchanged(self):
This test fails when constants.VERSION is also the most recent released version
py
diff --git a/tests/utils.py b/tests/utils.py index <HASH>..<HASH> 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,6 +1,7 @@ import pytest from rest_framework.exceptions import ValidationError + def dedent(blocktext): return '\n'.join([line[12:] for line in blocktext.splitlines()[1:-1]])
Double indent for linter.
py
diff --git a/normandy/recipes/fields.py b/normandy/recipes/fields.py index <HASH>..<HASH> 100644 --- a/normandy/recipes/fields.py +++ b/normandy/recipes/fields.py @@ -3,19 +3,12 @@ import hashlib from django.core.validators import MinValueValidator, MaxValueValidator from django.db import models -from product_details import product_details - class LocaleField(models.CharField): """Legacy field leftover to make earlier migrations work.""" - CHOICES = { - code: names['English'] - for code, names in product_details.languages.items() - } - def __init__(self, *args, **kwargs): kwargs.setdefault('max_length', 255) - kwargs.setdefault('choices', self.CHOICES.items()) + kwargs.setdefault('choices', {}) return super().__init__(*args, **kwargs)
Remove choices on LocaleField. Having LocaleField load it's choices caused product_details to attempt to load data from the database before the migrations were run during tests. Since we're not using the field anymore, empty choices is fine.
py
diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py index <HASH>..<HASH> 100644 --- a/python/ccxt/base/exchange.py +++ b/python/ccxt/base/exchange.py @@ -358,7 +358,7 @@ class Exchange(object): for name in dir(self): if name[0] != '_' and name[-1] != '_' and '_' in name: parts = name.split('_') - # watch_ohlcv → watchOHLCV (not watchOhlcv!) + # fetch_ohlcv → fetchOHLCV (not fetchOhlcv!) exceptions = {'ohlcv': 'OHLCV'} camelcase = parts[0] + ''.join(exceptions.get(i, self.capitalize(i)) for i in parts[1:]) attr = getattr(self, name)
exchange.py camelcase exceptions
py
diff --git a/wikitextparser/wikitext.py b/wikitextparser/wikitext.py index <HASH>..<HASH> 100644 --- a/wikitextparser/wikitext.py +++ b/wikitextparser/wikitext.py @@ -4,7 +4,7 @@ import re from copy import deepcopy from typing import ( - MutableSequence, Dict, List, Tuple, Union, Callable, Iterable + MutableSequence, Dict, List, Tuple, Union, Callable, Generator ) from wcwidth import wcswidth @@ -947,7 +947,9 @@ class SubWikiText(WikiText): self._type_to_spans[_type] ) - 1 if _index is None else _index - def _gen_subspan_indices(self, _type: str=None) -> Iterable[int]: + def _gen_subspan_indices( + self, _type: str=None + ) -> Generator[int, None, None]: """Yield all the subspan indices excluding self._span.""" s, e = self._span for i, (ss, ee) in enumerate(self._type_to_spans[_type]):
_gen_subspan_indices: Use Generator[int, None, None] as return type
py
diff --git a/sark/code/instruction.py b/sark/code/instruction.py index <HASH>..<HASH> 100644 --- a/sark/code/instruction.py +++ b/sark/code/instruction.py @@ -95,6 +95,10 @@ class Instruction(object): def feature(self): return self._inst.get_canon_feature() + @property + def mnem(self): + return self._inst.get_canon_mnem() + def has_reg(self, reg_name): return any(operand.has_reg(reg_name) for operand in self.operands)
Added mnemonic to instruction class.
py
diff --git a/allegedb/allegedb/graph.py b/allegedb/allegedb/graph.py index <HASH>..<HASH> 100644 --- a/allegedb/allegedb/graph.py +++ b/allegedb/allegedb/graph.py @@ -975,6 +975,8 @@ class MultiGraphSuccessorsMapping(GraphSuccessorsMapping): self._multedge = {} def _order_nodes(self, dest): + if isinstance(self.graph, MultiDiGraph): + return (self.orig, dest) if dest < self.orig: return(dest, self.orig) else:
Hack around an error ordering edges in MultiDiGraph Terribly inelegant, I just don't care very much
py
diff --git a/tests/test_mission_data.py b/tests/test_mission_data.py index <HASH>..<HASH> 100644 --- a/tests/test_mission_data.py +++ b/tests/test_mission_data.py @@ -1,15 +1,17 @@ - import os from planetaryimage.pds3image import PDS3Image import json +import pytest DATA_DIR = os.path.join(os.path.dirname(__file__), 'mission_data/') -with open(os.path.join(DATA_DIR, 'data.json'), 'r') as r: - data = json.load(r) [email protected](not(os.path.exists(os.path.join(DATA_DIR, 'data.json'))), + reason="data.json is not present, use get_mission_data") def test_mission_data(): + with open(os.path.join(DATA_DIR, 'data.json'), 'r') as r: + data = json.load(r) for file_name in data.keys(): image_path = os.path.join(DATA_DIR, file_name) try:
Added @pytest.mark.skipif
py
diff --git a/branca/element.py b/branca/element.py index <HASH>..<HASH> 100644 --- a/branca/element.py +++ b/branca/element.py @@ -14,6 +14,7 @@ from collections import OrderedDict from urllib.request import urlopen from binascii import hexlify from os import urandom +from pathlib import Path from jinja2 import Environment, PackageLoader, Template @@ -159,7 +160,7 @@ class Element(object): close_file : bool, default True Whether the file has to be closed after write. """ - if isinstance(outfile, str) or isinstance(outfile, bytes): + if isinstance(outfile, (str, bytes, Path)): fid = open(outfile, 'wb') else: fid = outfile
support for pathlib object when saving Element (#<I>) * support for pathlib object * Path is the parent for Windows Path and non-Windows Path objects
py
diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index <HASH>..<HASH> 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -84,7 +84,8 @@ from .tl.types import ( InputMessageEntityMentionName, DocumentAttributeVideo, UpdateEditMessage, UpdateEditChannelMessage, UpdateShort, Updates, MessageMediaWebPage, ChannelParticipantsSearch, PhotoSize, PhotoCachedSize, - PhotoSizeEmpty, MessageService, ChatParticipants + PhotoSizeEmpty, MessageService, ChatParticipants, + ChannelParticipantsBanned, ChannelParticipantsKicked ) from .tl.types.messages import DialogsSlice from .tl.types.account import PasswordInputSettings, NoPassword @@ -1211,7 +1212,12 @@ class TelegramClient(TelegramBareClient): or :tl:`ChatParticipants` for normal chats. """ if isinstance(filter, type): - filter = filter() + if filter in (ChannelParticipantsBanned, ChannelParticipantsKicked, + ChannelParticipantsSearch): + # These require a `q` parameter (support types for convenience) + filter = filter('') + else: + filter = filter() entity = self.get_input_entity(entity) if search and (filter or not isinstance(entity, InputPeerChannel)):
Support more filter types for convenience (#<I>)
py
diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py b/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py index <HASH>..<HASH> 100644 --- a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py +++ b/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py @@ -379,7 +379,9 @@ class StreamingPullManager(object): # Any ack IDs that are under lease management need to have their # deadline extended immediately. if self._leaser is not None: - lease_ids = self._leaser.ack_ids + # Explicitly copy the list, as it could be modified by another + # thread. + lease_ids = list(self._leaser.ack_ids) else: lease_ids = []
Fix race condition where pending Ack IDs can be modified by another thread. (#<I>)
py
diff --git a/uni_form/tests/tests.py b/uni_form/tests/tests.py index <HASH>..<HASH> 100644 --- a/uni_form/tests/tests.py +++ b/uni_form/tests/tests.py @@ -51,7 +51,7 @@ class TestBasicFunctionalityTags(TestCase): html = template.render(c) # Just look for file names because locations and names can change. - self.assertTrue('uni-form-generic.css' in html) + self.assertTrue('default.uni-form.css' in html) self.assertTrue('uni-form.css' in html) self.assertTrue('uni-form.jquery.js' in html)
Fix to account for change in what uni_form_setup provides to the screen
py