diff
stringlengths
139
3.65k
message
stringlengths
8
627
diff_languages
stringclasses
1 value
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ version = "0.4.1" readme = open('README.rst').read() setup(name='jicbioimage.core', - packages=['jicbioimage.core', 'jicbioimage.core.util'], + packages=['jicbioimage', 'jicbioimage.core', 'jicbioimage.core.util'], version=version, description='Python package designed to make it easy to work with microscopy images.', long_description=readme,
Included namespace package in setup.py.
py
diff --git a/py/selenium/webdriver/chrome/options.py b/py/selenium/webdriver/chrome/options.py index <HASH>..<HASH> 100644 --- a/py/selenium/webdriver/chrome/options.py +++ b/py/selenium/webdriver/chrome/options.py @@ -17,7 +17,6 @@ import base64 import os -import platform from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.webdriver.common.options import ArgOptions
[py] Deleting unused import
py
diff --git a/vncdotool/rfb.py b/vncdotool/rfb.py index <HASH>..<HASH> 100644 --- a/vncdotool/rfb.py +++ b/vncdotool/rfb.py @@ -11,6 +11,7 @@ http://www.realvnc.com/docs/rfbproto.pdf MIT License """ +# flake8: noqa import sys import math
rfb: flake8 ignore, externally sourced file
py
diff --git a/keepkeylib/transport_hid.py b/keepkeylib/transport_hid.py index <HASH>..<HASH> 100644 --- a/keepkeylib/transport_hid.py +++ b/keepkeylib/transport_hid.py @@ -4,6 +4,7 @@ from hashlib import sha256 import time, json, base64, struct from .transport import Transport, ConnectionError import binascii +import platform import hid @@ -34,10 +35,11 @@ def is_normal_link(device): if device['interface_number'] == 0: return True - # MacOS reports -1 as the interface_number for everything, inspect based on - # the path instead - if device['interface_number'] == -1: - return device['path'].endswith(b'0') + # MacOS reports -1 as the interface_number for everything, + # inspect based on the path instead. + if platform.system() == 'Darwin': + if device['interface_number'] == -1: + return device['path'].endswith(b'0') return False @@ -48,10 +50,11 @@ def is_debug_link(device): if device['interface_number'] == 1: return True - # MacOS reports -1 as the interface_number for everything, inspect based on - # the path instead - if device['interface_number'] == -1: - return device['path'].endswith(b'1') + # MacOS reports -1 as the interface_number for everything, + # inspect based on the path instead. + if platform.system() == 'Darwin': + if device['interface_number'] == -1: + return device['path'].endswith(b'1') return False
Be more picky about when we use path detection
py
diff --git a/pyes/utils.py b/pyes/utils.py index <HASH>..<HASH> 100644 --- a/pyes/utils.py +++ b/pyes/utils.py @@ -133,8 +133,7 @@ class ResultSet(object): del hl[key] def __getattr__(self, name): - if name in self._results: - return self._results[name] + return self._results['hits'][name] def keys_to_string(data): """
Clean and simple fix for access to attributes of the _results['hits'][name] - the lookup was pointing just at the top level dict, and thus not returning a value for max_score, and causing tests/utils.py to fail in test_TermQuery
py
diff --git a/niworkflows/interfaces/cifti.py b/niworkflows/interfaces/cifti.py index <HASH>..<HASH> 100644 --- a/niworkflows/interfaces/cifti.py +++ b/niworkflows/interfaces/cifti.py @@ -318,7 +318,9 @@ def _create_cifti_image(bold_file, label_file, bold_surfs, annotation_files, tr, warnings.warn("Resampling bold volume to match label dimensions") bold_img = resample_to_img(bold_img, label_img) - bold_img = _reorient_image(bold_img, target_img=label_img) + # ensure images match HCP orientation (LAS) + bold_img = _reorient_image(bold_img, orientation='LAS') + label_img = _reorient_image(label_img, orientation='LAS') bold_data = bold_img.get_fdata(dtype='float32') timepoints = bold_img.shape[3]
ENH: Ensure subcortical CIFTI is in LAS orientation
py
diff --git a/nodeconductor/billing/backend/whmcs.py b/nodeconductor/billing/backend/whmcs.py index <HASH>..<HASH> 100644 --- a/nodeconductor/billing/backend/whmcs.py +++ b/nodeconductor/billing/backend/whmcs.py @@ -324,6 +324,8 @@ class WHMCSAPI(object): configoptions=urlsafe_base64_encode(php_dumps(options)), billingcycle='monthly', paymentmethod='banktransfer', + noinvoice=True, + noemail=True, ) logger.info('WHMCS order was added with id %s', data['orderid']) return data['orderid'], data['productids'], product.backend_product_id
Disable immediate invoice creation on adding order - NC-<I>
py
diff --git a/arboretum/core.py b/arboretum/core.py index <HASH>..<HASH> 100644 --- a/arboretum/core.py +++ b/arboretum/core.py @@ -312,13 +312,15 @@ class EarlyStopMonitor: """ self.window_length = window_length - def __call__(self, i, regressor, args): + def __call__(self, current_round, regressor, args): """ Implementation of the GradientBoostingRegressor monitor function API. - :param i: the current boosting round. + :param current_round: the current boosting round. :param regressor: the regressor. - :param args: + :param args: ignored. :return: True if the regressor should stop early, else False. """ - return np.mean(regressor.oob_improvement_[max(0, i - self.window_length + 1):i + 1]) < 0 + + return current_round >= self.window_length and \ + np.mean(regressor.oob_improvement_[max(0, current_round - self.window_length + 1):current_round + 1]) < 0
minimum nr of rounds = window length
py
diff --git a/src/ossos-pipeline/ossos/downloads/cutouts/source.py b/src/ossos-pipeline/ossos/downloads/cutouts/source.py index <HASH>..<HASH> 100644 --- a/src/ossos-pipeline/ossos/downloads/cutouts/source.py +++ b/src/ossos-pipeline/ossos/downloads/cutouts/source.py @@ -145,7 +145,7 @@ class SourceCutout(object): def _update_ra_dec(self): fits_header = self.get_fits_header() - self._ra, self._dec = wcs.xy2sky(self.observed_x, self.observed_y, + self._ra, self._dec = wcs.xy2sky(self.pixel_x, self.pixel_y, float(fits_header[astrom.CRPIX1]), float(fits_header[astrom.CRPIX2]), float(fits_header[astrom.CRVAL1]),
Updating the RA/DEC for a source cutout now calls xy2sky with the pixel coordinates in the cutout since the FITS header values of CRPIX1 and CRPIX2 are adjusted when the cutout is retrieved.
py
diff --git a/pyontutils/ontutils.py b/pyontutils/ontutils.py index <HASH>..<HASH> 100755 --- a/pyontutils/ontutils.py +++ b/pyontutils/ontutils.py @@ -42,7 +42,7 @@ from joblib import Parallel, delayed from git.repo import Repo from pyontutils.core import makeGraph, createOntology from pyontutils.utils import noneMembers, anyMembers, Async, deferred, TermColors as tc -from pyontutils.ontload import loadall, locate_config_file, getCuries +from pyontutils.ontload import loadall, getCuries from pyontutils.namespaces import makePrefixes, definition from pyontutils.closed_namespaces import rdf, rdfs, owl, skos from IPython import embed @@ -751,7 +751,6 @@ def main(): epoch = args['--epoch'] curies_location = args['--curies'] - #curies_location = locate_config_file(curies_location, git_local) curies, curie_prefixes = getCuries(curies_location) filenames = args['<file>']
ontutils removed deprected locate_config_file
py
diff --git a/pygsp/filters/filter.py b/pygsp/filters/filter.py index <HASH>..<HASH> 100644 --- a/pygsp/filters/filter.py +++ b/pygsp/filters/filter.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from __future__ import division + from math import log from copy import deepcopy
filters: float division for python 2
py
diff --git a/zipline/transforms/vwap.py b/zipline/transforms/vwap.py index <HASH>..<HASH> 100644 --- a/zipline/transforms/vwap.py +++ b/zipline/transforms/vwap.py @@ -73,6 +73,7 @@ class VWAPEventWindow(EventWindow): """ def __init__(self, market_aware=True, window_length=None, delta=None): EventWindow.__init__(self, market_aware, window_length, delta) + self.fields = ('price', 'volume') self.flux = 0.0 self.totalvolume = 0.0 @@ -100,7 +101,8 @@ class VWAPEventWindow(EventWindow): # We need numerical price and volume to calculate a vwap. def assert_required_fields(self, event): - if 'price' not in event or 'volume' not in event: - raise WrongDataForTransform( - transform="VWAPEventWindow", - fields=self.fields) + for field in self.fields: + if field not in event: + raise WrongDataForTransform( + transform="VWAPEventWindow", + fields=self.fields)
BUG: Prevent crash in vwap transform due to non-existent member. The WrongDataForTransform was referencing a `self.fields` member, which did not exist. Add a self.fields member set to `price` and `volume` and use it to iterate over during the check.
py
diff --git a/cli/sawtooth_cli/rest_client.py b/cli/sawtooth_cli/rest_client.py index <HASH>..<HASH> 100644 --- a/cli/sawtooth_cli/rest_client.py +++ b/cli/sawtooth_cli/rest_client.py @@ -82,7 +82,7 @@ class RestClient(object): self._base_url + path + self._format_queries(queries)) # concat any additional pages of data - while 'next' in json_result.get('paging', {}): + while code == 200 and 'next' in json_result.get('paging', {}): previous_data = json_result.get('data', []) code, json_result = self._submit_request( json_result['paging']['next'])
Fix CLI failing unexpectedly when getting a string from Rest Api
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -58,11 +58,23 @@ setup(name='html5lib', 'six', ], extras_require={ + # A empty extra that only has a conditional marker will be + # unconditonally installed when the condition matches. ":python_version == '2.6'": ["ordereddict"], + + # A conditional extra will only install these items when the extra is + # requested and the condition matches. "lxml:python_implementation == 'CPython'": ["lxml"], + + # Standard extras, will be installed when the extra is requested. "genshi": ["genshi"], "datrie": ["datrie"], "charade": ["charade"], + + # The all extra combines a standard extra which will be used anytime + # the all extra is requested, and it extends it with a conditional + # extra that will be installed whenever the condition matches and the + # all extra is requested. "all": ["genshi", "datrie", "charade"], "all:python_implementation == 'CPython'": ["lxml"], },
Comment the extras syntax to make it clearer what is going on
py
diff --git a/orb/core/collection.py b/orb/core/collection.py index <HASH>..<HASH> 100644 --- a/orb/core/collection.py +++ b/orb/core/collection.py @@ -741,7 +741,10 @@ class Collection(object): if isinstance(field, orb.ReferenceColumn): ref_model = field.referenceModel() ref_id = record[field.field()] - record_values.append(ref_model(ref_id, **orig_context)) + if ref_id is not None: + record_values.append(ref_model(ref_id, **orig_context)) + else: + record_values.append(None) else: record_values.append(record[field.field()])
ensuring reference value exists before trying to inflate it
py
diff --git a/mimesis/providers/internet.py b/mimesis/providers/internet.py index <HASH>..<HASH> 100755 --- a/mimesis/providers/internet.py +++ b/mimesis/providers/internet.py @@ -207,7 +207,7 @@ class Internet(BaseDataProvider): def home_page(self, tld_type: Optional[TLDType] = None) -> str: """Generate a random home page. - :param str tld_type: TLD type. + :param tld_type: TLD type. :return: Random home page. :Example: @@ -235,8 +235,8 @@ class Internet(BaseDataProvider): full_url: bool = False) -> str: """Get a random subreddit from the list. - :param bool nsfw: NSFW subreddit. - :param bool full_url: Full URL address. + :param nsfw: NSFW subreddit. + :param full_url: Full URL address. :return: Subreddit or URL to subreddit. :Example:
Removed types from docstrings
py
diff --git a/salt/modules/aptpkg.py b/salt/modules/aptpkg.py index <HASH>..<HASH> 100644 --- a/salt/modules/aptpkg.py +++ b/salt/modules/aptpkg.py @@ -99,7 +99,7 @@ def __virtual__(): ''' Confirm this module is on a Debian based system ''' - if __grains__.get('os_family') in ('Kali', 'Debian', 'neon'): + if __grains__.get('os_family') in ('Kali', 'Debian', 'neon', 'Deepin'): return __virtualname__ elif __grains__.get('os_family', False) == 'Cumulus': return __virtualname__
Make aptpkg work with Deepin Linux Simple change, but it bugs me having to add this every time I update. Also I never contribute so proposing this change here is probably the wrong place to do it. Sue me if you want I'm super broke.
py
diff --git a/pyeapi/client.py b/pyeapi/client.py index <HASH>..<HASH> 100644 --- a/pyeapi/client.py +++ b/pyeapi/client.py @@ -637,6 +637,14 @@ class Node(object): """ commands = make_iterable(commands) + # Some commands are multiline commands. These are banner commands and SSL commands. So with this two lines we + # can support those by passing commands by doing: + # banner login MULTILINE: This is my banner.\nAnd I even support multiple lines. + # Why this? To be able to read a configuration from a file, split it into lines and pass it as it is + # to pyeapi without caring about multiline commands. + commands = [{'cmd': c.split('MULTILINE:')[0], 'input': c.split('MULTILINE:')[1]} + if 'MULTILINE:' in c else c for c in commands] + if self._enablepwd: commands.insert(0, {'cmd': 'enable', 'input': self._enablepwd}) else:
Added support for multiline commands without having to pass them as a dictionary
py
diff --git a/tests/output_hazard_test.py b/tests/output_hazard_test.py index <HASH>..<HASH> 100644 --- a/tests/output_hazard_test.py +++ b/tests/output_hazard_test.py @@ -459,7 +459,7 @@ class GmfDBWriterTestCase(GmfDBBaseTestCase): # After calling the function under test we see the expected map data. output = self.job.output_set.get() - self.assertEqual(0, len(output.hazardcurve_set.all())) + self.assertFalse(output.hazardcurve_id) self.assertEqual(0, len(output.lossmap_set.all())) self.assertEqual(4, len(output.gmfdata_set.all()))
updated test as we have changed the relation between output and hazard curve to 1-1 Former-commit-id: a<I>a5d4a<I>f<I>b6ac0dcec8eccefbeb9a<I>
py
diff --git a/termdown.py b/termdown.py index <HASH>..<HASH> 100755 --- a/termdown.py +++ b/termdown.py @@ -279,6 +279,7 @@ def countdown( try: while seconds_left > 0 or blink or text: + figlet.width = stdscr.getmaxyx()[1] if alt_format: countdown_text = format_seconds_alt( seconds_left, seconds_total, hide_seconds=no_seconds)
Update figlet width before each re-render By doing this, Figlet will happily wrap when the text is bigger than the screen size. Fixes trehn/termdown#<I>
py
diff --git a/jax/numpy/linalg.py b/jax/numpy/linalg.py index <HASH>..<HASH> 100644 --- a/jax/numpy/linalg.py +++ b/jax/numpy/linalg.py @@ -68,6 +68,7 @@ def _jvp_slogdet(g, ans, x): @_wraps(onp.linalg.slogdet) @custom_transforms +@jit def slogdet(a): a = _promote_arg_dtypes(np.asarray(a)) dtype = lax.dtype(a)
Added jit to slogdet This resolves the prior merge conflict
py
diff --git a/python/ray/tune/integration/wandb.py b/python/ray/tune/integration/wandb.py index <HASH>..<HASH> 100644 --- a/python/ray/tune/integration/wandb.py +++ b/python/ray/tune/integration/wandb.py @@ -221,9 +221,10 @@ class _WandbLoggingProcess(Process): self._trial_name = self.kwargs.get("name", "unknown") def run(self): - wandb.require("service") + # Since we're running in a separate process already, use threads. + os.environ["WANDB_START_METHOD"] = "thread" wandb.init(*self.args, **self.kwargs) - wandb.setup() + while True: item_type, item_content = self.queue.get() if item_type == _QueueItem.END: @@ -613,6 +614,6 @@ class WandbTrainableMixin: self.wandb = self._wandb.init(**wandb_init_kwargs) def stop(self): - self._wandb.join() + self._wandb.finish() if hasattr(super(), "stop"): super().stop()
[tune] rolling back wandb service. replacing deprecated wandb methods (#<I>) Follow up: #<I> Briefly, wandb service is still in experimental stage, and is not ready to be released as an integration without extensive testing. Hence, we are interested in rolling back the update to the integration we made recently, until this feature is ready to be shipped.
py
diff --git a/salt/utils/schedule.py b/salt/utils/schedule.py index <HASH>..<HASH> 100644 --- a/salt/utils/schedule.py +++ b/salt/utils/schedule.py @@ -498,6 +498,11 @@ class Schedule(object): jobcount = 0 for basefilename in os.listdir(salt.minion.get_proc_dir(self.opts['cachedir'])): fn_ = os.path.join(salt.minion.get_proc_dir(self.opts['cachedir']), basefilename) + if not os.path.exists(fn_): + log.debug('schedule.handle_func: {0} was processed ' + 'in another thread, skipping.'.format( + basefilename)) + continue with salt.utils.fopen(fn_, 'r') as fp_: job = salt.payload.Serial(self.opts).load(fp_) if job: @@ -592,6 +597,7 @@ class Schedule(object): # where the thread will die silently, which is worse. finally: try: + log.debug('schedule.handle_func: Removing {0}'.format(proc_fn)) os.unlink(proc_fn) except OSError as exc: if exc.errno == errno.EEXIST or exc.errno == errno.ENOENT:
Fixing a bug that pops up randomly if you have multiple jobs with multiple threads, jobs would be processed in one thread but an attempt to process in another thread would be attempted. The cache file would be removed after the other thread had gotten the list of cache file. Adding some code to bypass the processing if the file is already gone.
py
diff --git a/luigi/hadoop.py b/luigi/hadoop.py index <HASH>..<HASH> 100644 --- a/luigi/hadoop.py +++ b/luigi/hadoop.py @@ -707,14 +707,22 @@ class JobTask(BaseHadoopJobTask): def _setup_links(self): if hasattr(self, '_links'): + missing = [] for src, dst in self._links: d = os.path.dirname(dst) if d and not os.path.exists(d): os.makedirs(d) + if not os.path.exists(src): + missing.append(src) + continue if not os.path.exists(dst): # If the combiner runs, the file might already exist, # so no reason to create the link again os.link(src, dst) + if missing: + raise HadoopJobError( + 'Missing files for distributed cache: ' + + ', '.join(missing)) def _dump(self, dir=''): """Dump instance to file."""
Check for missing files in distributed cache setup
py
diff --git a/test/test_rpc.py b/test/test_rpc.py index <HASH>..<HASH> 100644 --- a/test/test_rpc.py +++ b/test/test_rpc.py @@ -95,7 +95,7 @@ def test_rpc_queue_and_connection_creation(container_factory, rabbit_config, rpc_queue = rabbit_manager.get_queue(vhost, "rpc-exampleservice") assert len(rpc_queue['consumer_details']) == 1 evt_queue = rabbit_manager.get_queue( - vhost, "evt-srcservice-eventtype-exampleservice") + vhost, "evt-srcservice-eventtype--exampleservice.async_task") assert len(evt_queue['consumer_details']) == 1 # and both share a single connection
Updated test for change in parent branch
py
diff --git a/pythran/dist.py b/pythran/dist.py index <HASH>..<HASH> 100644 --- a/pythran/dist.py +++ b/pythran/dist.py @@ -5,7 +5,11 @@ This modules contains a distutils extension mechanism for Pythran import pythran.config as cfg -from collections import defaultdict, Iterable +from collections import defaultdict +try: + from collections.abc import Iterable +except ImportError: + from collections import Iterable import os.path import os
Iterable imported from collections.abc
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -18,11 +18,14 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. - +import os.path from setuptools import setup, find_packages -with open('README.rst') as f: - long_description = f.read() +if os.path.exists('README.rst'): + with open('README.rst') as f: + long_description = f.read() +else: + long_description = "" setup( name = 'ifaddr',
Avoid installation problems if documentation file is not found.
py
diff --git a/openquake/hazardlib/gsim/__init__.py b/openquake/hazardlib/gsim/__init__.py index <HASH>..<HASH> 100644 --- a/openquake/hazardlib/gsim/__init__.py +++ b/openquake/hazardlib/gsim/__init__.py @@ -51,6 +51,6 @@ def get_portable_gsims(): ''' portable = {} for cls in registry.values(): - if 'get_mean_and_stddevs' in cls.__dict__: + if 'ctx' not in cls.compute.__annotations__: portable[cls.__name__] = cls return portable
Changed portable_gsims to show the non-vectorized GMPEs [ci skip]
py
diff --git a/twython/twython.py b/twython/twython.py index <HASH>..<HASH> 100644 --- a/twython/twython.py +++ b/twython/twython.py @@ -402,6 +402,22 @@ class Twython(object): return urllib2.urlopen(r).read() except HTTPError, e: raise TwythonError("updateProfileImage() failed with a %d error code." % e.code, e.code) + + def getProfileImageUrl(self, username, size=None, version=1): + url = "http://api.twitter.com/%s/users/profile_image/%s.json" % (version, username) + if size: + url = self.constructApiURL(url, {'size':size}) + + try: + client = httplib2.Http() + client.follow_redirects = False + resp = client.request(url, 'HEAD')[0] + if resp['status'] not in ('301', '302', '303', '307'): + raise TwythonError("getProfileImageUrl() failed to get redirect.") + return resp['location'] + + except HTTPError, e: + raise TwythonError("getProfileImageUrl() failed with a %d error code." % e.code, e.code) @staticmethod def encode_multipart_formdata(fields, files):
Added getProfileImageUrl() to handle "users/profile_image" api call
py
diff --git a/openquake/commonlib/readinput.py b/openquake/commonlib/readinput.py index <HASH>..<HASH> 100644 --- a/openquake/commonlib/readinput.py +++ b/openquake/commonlib/readinput.py @@ -733,7 +733,8 @@ class Exposure(object): @classmethod def read(cls, fname, calculation_mode='', insured_losses=False, - region_constraint='', all_cost_types=(), ignore_missing_costs=()): + region_constraint='', all_cost_types=(), ignore_missing_costs=(), + nodes=False): param = {'calculation_mode': calculation_mode} param['out_of_region'] = 0 param['insured_losses'] = insured_losses @@ -750,6 +751,8 @@ class Exposure(object): param['fname'], param['all_cost_types']) nodes = assets if assets else exposure._read_csv( ~assets, os.path.dirname(param['fname'])) + if nodes: # this is useful for Paul Henshaw + return nodes exposure._populate_from(nodes, param) if param['region'] and param['out_of_region']: logging.info('Discarded %d assets outside the region',
Added a way to read the nodes [skip CI] Former-commit-id: b5ed<I>f0cf7addfc8fb<I>e<I>ed<I>f<I>ee6b
py
diff --git a/authorization_django/middleware.py b/authorization_django/middleware.py index <HASH>..<HASH> 100644 --- a/authorization_django/middleware.py +++ b/authorization_django/middleware.py @@ -115,8 +115,9 @@ def authorization_middleware(get_response): # For now support old tokens for HR with only AUTHZ LEVEL_EMPLOYEE if not result and len(args) == 0 and arg0 == 'HR/R': result = levels.is_authorized(level, levels.LEVEL_EMPLOYEE) - if result: - msg = log_msg.format(list(needed_scopes), 'level', level, token_signature) + if result: + msg = log_msg.format(list(needed_scopes), 'level', level, token_signature) + # end remove when levels are obsolete else: raise TypeError("String or Integer expected")
Only log exception for HR when there is a exception
py
diff --git a/stitches/connection.py b/stitches/connection.py index <HASH>..<HASH> 100644 --- a/stitches/connection.py +++ b/stitches/connection.py @@ -229,19 +229,24 @@ t.start() Close the connection """ if hasattr(self, '_lazy_sftp'): - self.sftp.close() + if self.sftp is not None: + self.sftp.close() delattr(self, '_lazy_sftp') if hasattr(self, '_lazy_channel'): - self.channel.close() + if self.channel is not None: + self.channel.close() delattr(self, '_lazy_channel') if hasattr(self, '_lazy_cli'): - self.cli.close() + if self.cli is not None: + self.cli.close() delattr(self, '_lazy_cli') if hasattr(self, '_lazy_pbm'): - self.pbm.close() + if self.pbm is not None: + self.pbm.close() delattr(self, '_lazy_pbm') if hasattr(self, '_lazy_rpyc'): - self.rpyc.close() + if self.rpyc is not None: + self.rpyc.close() delattr(self, '_lazy_rpyc') def exec_command(self, command, bufsize=-1, get_pty=False):
fix cases were attr exists but is None
py
diff --git a/jobs/config_test.py b/jobs/config_test.py index <HASH>..<HASH> 100755 --- a/jobs/config_test.py +++ b/jobs/config_test.py @@ -789,6 +789,13 @@ class JobTest(unittest.TestCase): 'ci-kubernetes-node-kubelet-conformance': 'ci-kubernetes-node-kubelet-*', 'ci-kubernetes-node-kubelet-benchmark': 'ci-kubernetes-node-kubelet-*', 'ci-kubernetes-node-kubelet': 'ci-kubernetes-node-kubelet-*', + + # The mlkube projects intentionally share projects, + # We map each test name to the same value so that below when we check for number of tests + # using this project there will just be one entry. + 'mlkube-build-presubmit': 'mlkube-*', + 'mlkube-build-postsubmit': 'mlkube-*', + 'ci-kubernetes-e2e-mlkube-gke': 'mlkube-*', } for soak_prefix in [ 'ci-kubernetes-soak-gce-1.5',
Fix the test. * Need to add to allowed list so that we can use the same project for multiple tests.
py
diff --git a/pycbc/vetoes/chisq.py b/pycbc/vetoes/chisq.py index <HASH>..<HASH> 100644 --- a/pycbc/vetoes/chisq.py +++ b/pycbc/vetoes/chisq.py @@ -319,7 +319,7 @@ class SingleDetPowerChisq(object): @staticmethod def parse_option(row, arg): - safe_dict = {} + safe_dict = {'max': max, 'min': min} safe_dict.update(row.__dict__) safe_dict.update(math.__dict__) safe_dict.update(pycbc.pnutils.__dict__)
allow min/max in chisq bin calculation (#<I>)
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 @@ -381,8 +381,7 @@ class OqJob(djm.Model): # ordering no ruptures are generated and the test # qa_tests/hazard/disagg/case_1/test.py fails with a bad # error message - coords = sorted( - set((asset.site.x, asset.site.y) for asset in assets)) + coords = sorted(set(get_lon_lat(asset) for asset in assets)) lons, lats = zip(*coords) mesh = geo.Mesh(numpy.array(lons), numpy.array(lats)) else: @@ -395,6 +394,14 @@ class OqJob(djm.Model): self.id, self.job_type) +def get_lon_lat(asset): + """ + :param asset: an ExposureData instance + :returns: (lon, lat) truncated to 5 digits + """ + return valid.longitude(asset.site.x), valid.latitude(asset.site.y) + + def oqparam(job_id): """ :param job_id: ID of :class:`openquake.engine.db.models.OqJob`
lon and lat are now truncated to 5 digits Former-commit-id: e<I>c<I>fb<I>a<I>dffe5c<I>b5f7fb6f2f<I>e
py
diff --git a/src/infi/projector/plugins/builtins/version/__init__.py b/src/infi/projector/plugins/builtins/version/__init__.py index <HASH>..<HASH> 100644 --- a/src/infi/projector/plugins/builtins/version/__init__.py +++ b/src/infi/projector/plugins/builtins/version/__init__.py @@ -126,7 +126,7 @@ class VersionPlugin(CommandPlugin): git_checkout(version_tag_with_v) DevEnvPlugin().create_setup_py() setup_cmd = "setup . register -r {pypi} {distribution} upload -r {pypi} {universal_flag}" - universal_flag = '--universal' if distribution == 'bdist_wheel' and has_c_extensions + universal_flag = '--universal' if distribution == 'bdist_wheel' and has_c_extensions else '' setup_cmd = setup_cmd.format(pypi=pypi, distribution=distribution, universal_flag=universal_flag).strip() execute_with_buildout(setup_cmd, env=dict(LC_ALL="C")) git_checkout("develop")
HOSTDEV-<I> fixing previous commit
py
diff --git a/test/test_solver.py b/test/test_solver.py index <HASH>..<HASH> 100644 --- a/test/test_solver.py +++ b/test/test_solver.py @@ -77,6 +77,17 @@ class Submission(_QueryTest): """Submit some sample problems.""" @unittest.skipIf(skip_live, "No live server available.") + def test_result_structure(self): + client = Client(config_url, config_token) + solver = client.get_solver(config_solver) + computation = solver.sample_ising({}, {}) + result = computation.result() + self.assertIn('samples', result) + self.assertIn('energies', result) + self.assertIn('occurrences', result) + self.assertIn('timing', result) + + @unittest.skipIf(skip_live, "No live server available.") def test_submit_extra_qubit(self): """Submit a defective problem with an unsupported variable.""" # Connect
Add tests for Future.result() structure, including aliases
py
diff --git a/app.py b/app.py index <HASH>..<HASH> 100644 --- a/app.py +++ b/app.py @@ -8,7 +8,8 @@ client = Client(host=os.environ.get('HOST'), headers=headers ) headers = {'X-Mock': 200} -response = client.api_keys.get(headers=headers) +params = {'limit': 100} +response = client.api_keys.get(params=params, headers=headers) print "\nGET Mocked Example" print response.headers print response.status_code
Added example with query params
py
diff --git a/examples/targets.py b/examples/targets.py index <HASH>..<HASH> 100644 --- a/examples/targets.py +++ b/examples/targets.py @@ -49,6 +49,7 @@ class Bullet(MoverMixin, ppb.BaseSprite): def on_update(self, update, signal): super().on_update(update, signal) # Execute movement + scene = update.scene if self.position.y > scene.main_camera.frame_top: @@ -81,5 +82,5 @@ class GameScene(ppb.BaseScene): if __name__ == "__main__": ppb.run( starting_scene=GameScene, - log_level=logging.ERROR, + log_level=logging.DEBUG, )
Revert minor changes made during fix.
py
diff --git a/d1_mn_generic/src/service/mn/urls.py b/d1_mn_generic/src/service/mn/urls.py index <HASH>..<HASH> 100644 --- a/d1_mn_generic/src/service/mn/urls.py +++ b/d1_mn_generic/src/service/mn/urls.py @@ -69,7 +69,7 @@ urlpatterns = patterns( # MNAuthorization.isAuthorized() - GET /isAuthorized/{pid} url(r'^v1/isAuthorized/(.+)/?$', 'get_is_authorized_pid'), # MNStorage.systemMetadataChanged() - POST /refreshSystemMetadata/{pid} - url(r'^v1/refreshSystemMetadata/?$', 'post_refresh_system_metadata'), + url(r'^v1/dirtySystemMetadata/?$', 'post_refresh_system_metadata'), # Tier 3: Storage API (MNStorage) # MNStorage.create() - POST /object
- Fixed API endpoint for MNStorage.systemMetadataChanged(). Bug introduced by search/replace in previous version.
py
diff --git a/trezorlib/client.py b/trezorlib/client.py index <HASH>..<HASH> 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -180,8 +180,11 @@ class ProtocolMixin(object): raise exceptions.TrezorException("Unexpected initial response") else: self.features = resp - if str(self.features.vendor) not in self.VENDORS: + if self.features.vendor not in self.VENDORS: raise RuntimeError("Unsupported device") + # A side-effect of this is a sanity check for broken protobuf definitions. + # If the `vendor` field doesn't exist, you probably have a mismatched + # checkout of trezor-common. @staticmethod def expand_path(n):
client: do not coerce self.features.vendor to string There is no good reason to do that and it hides situations when the field mistakenly doesn't exist. Added comment explains that missing "vendor" field might by caused by trezor-common mismatch, which fixes #<I>
py
diff --git a/spikeextractors/extractors/nwbextractors/nwbextractors.py b/spikeextractors/extractors/nwbextractors/nwbextractors.py index <HASH>..<HASH> 100644 --- a/spikeextractors/extractors/nwbextractors/nwbextractors.py +++ b/spikeextractors/extractors/nwbextractors/nwbextractors.py @@ -206,7 +206,7 @@ class NwbRecordingExtractor(se.RecordingExtractor): self._channel_properties[i]['group'] = int(unique_grp_names.index(nwbfile.electrodes[col][ind])) elif col == 'location': self._channel_properties[i]['brain_area'] = nwbfile.electrodes[col][ind] - elif col in ['x', 'y', 'z']: + elif col in ['x', 'y', 'z', 'rel_x', 'rel_y']: continue else: self._channel_properties[i][col] = nwbfile.electrodes[col][ind]
do not add (rel_x, rel_y) as properties of channels
py
diff --git a/nrefocus/_propagate.py b/nrefocus/_propagate.py index <HASH>..<HASH> 100644 --- a/nrefocus/_propagate.py +++ b/nrefocus/_propagate.py @@ -52,7 +52,7 @@ def refocus(field, d, nm, res, method="helmholtz", num_cpus=1): vardict = dict() for name in names: - if loc.has_key(name): + if name in loc: vardict[name] = loc[name] vardict["fftfield"] = np.fft.fftn(field)
pythonic "key in dict"
py
diff --git a/quilt/cli/push.py b/quilt/cli/push.py index <HASH>..<HASH> 100644 --- a/quilt/cli/push.py +++ b/quilt/cli/push.py @@ -32,8 +32,8 @@ class PushCommand(Command): action="store_true") def run(self, options, args): - push.applying.connect(self.applying) push = Push(self.get_cwd(), self.get_pc_dir(), self.get_patches_dir()) + push.applying_patch.connect(self.applying_patch) push.applied.connect(self.applied) if options.all: @@ -43,7 +43,7 @@ class PushCommand(Command): else: push.apply_patch(args[0]) - def applying(self, patch): + def applying_patch(self, patch): print "Applying patch %s" % patch.get_name() def applied(self, patch):
Correct signal/slot connection for push
py
diff --git a/metal/mmtl/scorer.py b/metal/mmtl/scorer.py index <HASH>..<HASH> 100644 --- a/metal/mmtl/scorer.py +++ b/metal/mmtl/scorer.py @@ -86,15 +86,15 @@ class Scorer(object): batch = place_on_gpu(batch) Xb, Yb = batch - Y.append(utils.to_numpy(Yb)) + Y.append(Yb) Yb_probs = model.calculate_output(Xb, [task.name])[task.name] Y_probs.append(Yb_probs) - Yb_preds = utils.break_ties(Yb_probs.numpy(), "random").astype(np.int) - Y_preds.append(Yb_preds) # Stack batches - Y_preds, Y, Y_probs = map(utils.stack_batches, [Y_preds, Y, Y_probs]) + Y = utils.stack_batches(Y) + Y_probs = utils.stack_batches(Y_probs) + Y_preds = utils.break_ties(Y_probs, "random").astype(np.int) # From the labels and predictions calculate metrics for standard_metric_name in self.standard_metrics:
Convert to numpy before scoring in Scorer
py
diff --git a/codecov/__init__.py b/codecov/__init__.py index <HASH>..<HASH> 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -229,17 +229,15 @@ def _add_env_if_not_empty(lst, value): def generate_toc(root): - return ( - str( - ( - try_to_run(["git", "ls-files"], cwd=root) - or try_to_run(["git", "ls-files"]) - or try_to_run(["hg", "locate"], cwd=root) - or try_to_run(["hg", "locate"]) - ) - ).strip() - or "" + res = ( + try_to_run(["git", "ls-files"], cwd=root) + or try_to_run(["git", "ls-files"]) + or try_to_run(["hg", "locate"], cwd=root) + or try_to_run(["hg", "locate"]) ) + if res is None: + return "" + return str(res).strip() or "" def main(*argv, **kwargs):
Fixing command for when neither hg or git are available Sometimes not hg or git are available to run. On those cases, 'try_to_run' will return None, and we need to not stringify that None
py
diff --git a/pluggy/hooks.py b/pluggy/hooks.py index <HASH>..<HASH> 100644 --- a/pluggy/hooks.py +++ b/pluggy/hooks.py @@ -234,6 +234,7 @@ class _HookCaller(object): raise ValueError("plugin %r not found" % (plugin,)) def get_hookimpls(self): + # Order is important for _hookexec return self._nonwrappers + self._wrappers def _add_hookimpl(self, hookimpl):
Added comment to make order importance more explicit.
py
diff --git a/osbs/cli/main.py b/osbs/cli/main.py index <HASH>..<HASH> 100644 --- a/osbs/cli/main.py +++ b/osbs/cli/main.py @@ -43,10 +43,8 @@ def cmd_list_builds(args, osbs): for build in sorted(builds, key=lambda x: x.get_time_created_in_seconds()): image = build.get_image_tag() - if args.USER: - # image can contain registry - we may have to parse it more intelligently - registry_and_namespace = image.split("/")[:-1] - if args.USER not in registry_and_namespace: + if args.FILTER: + if args.FILTER not in image: continue b = { "name": build.get_build_name(), @@ -262,7 +260,7 @@ def cli(): list_builds_parser = subparsers.add_parser(str_on_2_unicode_on_3('list-builds'), help='list builds in OSBS', description="list all builds in specified namespace " "(to list all builds in all namespaces, use --namespace=\"\")") - list_builds_parser.add_argument("USER", help="list builds only for specified username", + list_builds_parser.add_argument("FILTER", help="list only builds which contain provided string", nargs="?") list_builds_parser.set_defaults(func=cmd_list_builds)
cli,list-builds: make filtering more generic
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -132,21 +132,15 @@ class MyBuildPy(build_py): else: base = modname basedir = os.path.join(self.build_lib, base) - if sys.platform == 'win32': - two_to_three = [sys.executable] - exe_path = os.path.dirname(sys.executable) - two_to_three.append(os.path.join(exe_path, 'Tools\\Scripts\\2to3.py')) - else: - two_to_three = ['2to3'] for directory in include_dirs: dest = join(basedir, directory) shutil.rmtree(dest, ignore_errors=True) shutil.copytree(directory, dest) if sys.version_info >= (3, 0): # process manually python file in include_dirs (test data) - from subprocess import check_call - print('running 2to3 on', dest) # parens are NOT optional here for py3k compat - check_call(two_to_three + ['-wn', dest]) + from distutils.util import run_2to3 + print('running 2to3 on', dest) + run_2to3([dest]) def install(**kwargs): """setup entry point"""
backport pylint fix on setup.py for py3k windows/cross-compiliation install issue
py
diff --git a/src/edeposit/amqp/aleph/marcxml.py b/src/edeposit/amqp/aleph/marcxml.py index <HASH>..<HASH> 100755 --- a/src/edeposit/amqp/aleph/marcxml.py +++ b/src/edeposit/amqp/aleph/marcxml.py @@ -874,9 +874,10 @@ class MARCXMLRecord: if "c" in other_subfields: surname = ",".join(other_subfields["c"]) - elif ind1 == "1" and ind2 == "0" or ind1 == 0 and ind2 == 0: + elif ind1 == "1" and ind2 == "0" or ind1 == "0" and ind2 == "0": name = person.strip() - title = ",".join(other_subfields["c"]) + if "c" in other_subfields: + title = ",".join(other_subfields["c"]) parsed_persons.append( Person(
Fixed bug in Marc XML parsing (titles of author).
py
diff --git a/cherrypy/_cpconfig.py b/cherrypy/_cpconfig.py index <HASH>..<HASH> 100644 --- a/cherrypy/_cpconfig.py +++ b/cherrypy/_cpconfig.py @@ -303,7 +303,7 @@ def _engine_namespace_handler(k, v): elif k == 'autoreload_match': engine.autoreload.match = v elif k == 'reload_files': - engine.autoreload.files = v + engine.autoreload.files = set(v) elif k == 'deadlock_poll_freq': engine.timeout_monitor.frequency = v elif k == 'SIGHUP':
Fix for #<I> (Bug in cherrypy/process/plugins.py).
py
diff --git a/beakerx/beakerx/easyform/easyform.py b/beakerx/beakerx/easyform/easyform.py index <HASH>..<HASH> 100644 --- a/beakerx/beakerx/easyform/easyform.py +++ b/beakerx/beakerx/easyform/easyform.py @@ -133,7 +133,8 @@ class EasyForm(Box): arguments = dict(target_name='beaker.tag.run') comm = Comm(**arguments) msg = {'runByTag': args[0].tag} - comm.send(data=msg, buffers=[]) + state = {'state': msg} + comm.send(data=state, buffers=[]) def addList(self, *args, **kwargs): multi_select = getValue(kwargs, 'multi', True)
#<I> EasyForm Python buttons not working (#<I>)
py
diff --git a/visidata/vdtui.py b/visidata/vdtui.py index <HASH>..<HASH> 100755 --- a/visidata/vdtui.py +++ b/visidata/vdtui.py @@ -1425,7 +1425,9 @@ class Sheet: col = self.visibleCols[vcolidx] if col.width is None and self.visibleRows: # handle delayed column width-finding - col.width = min(col.getMaxWidth(self.visibleRows), options.default_width)+minColWidth + col.width = col.getMaxWidth(self.visibleRows)+minColWidth + if vcolidx != self.nVisibleCols-1: # let last column fill up the max width + col.width = min(col.width, options.default_width) width = col.width if col.width is not None else options.default_width if col in self.keyCols or vcolidx >= self.leftVisibleColIndex: # visible columns self.visibleColLayout[vcolidx] = [x, min(width, winWidth-x)]
[vdtui] last column auto-width does not max out
py
diff --git a/tests/test_esmarc.py b/tests/test_esmarc.py index <HASH>..<HASH> 100644 --- a/tests/test_esmarc.py +++ b/tests/test_esmarc.py @@ -141,11 +141,11 @@ class MarcDocTest(unittest.TestCase): def test_DOC_03692895X(self): em = marcx.marcdoc(DOC_03692895X) self.assertNotEquals(None, em) - self.assertEquals(em.titles(), [u'De hydrophobia nonnulla /']) - self.assertEquals(em.subtitles(), []) - self.assertEquals(em.authors(), [u'Nahmer, Friedrich Wilhelm V. D.']) - self.assertEquals(em.additional_authors(), []) - self.assertEquals(em.isbns(), []) + self.assertEquals(em.x245a, [u'De hydrophobia nonnulla /']) + self.assertEquals(em.x245b, []) + self.assertEquals(em.x100a, [u'Nahmer, Friedrich Wilhelm V. D.']) + self.assertEquals(em.x700a, []) + self.assertEquals(list(em.isbns()), []) def test_DOC_091849799(self): em = marcx.marcdoc(DOC_091849799)
replaced nice names with more cryptic ones
py
diff --git a/txaws/reactor.py b/txaws/reactor.py index <HASH>..<HASH> 100644 --- a/txaws/reactor.py +++ b/txaws/reactor.py @@ -1,5 +1,6 @@ '''Reactor utilities.''' + def get_exitcode_reactor(): """ This is only neccesary until a fix like the one outlined here is
Added missing blank line before module-level code.
py
diff --git a/bin/split-pext.py b/bin/split-pext.py index <HASH>..<HASH> 100755 --- a/bin/split-pext.py +++ b/bin/split-pext.py @@ -61,7 +61,7 @@ def getpextfnames(path): if mnpext <= k <= mxpext]; pextfnames = [ i for path in opts['<dirs>'] for i in getpextfnames(path)]; #get headers from the first directory -headers = [ get_header(fname,gzip='guess') +headers = [ get_header(fname[0],gzip='guess') for fname in pextfnames[:len(opts['<dirs>'])]]; keys = np.unique([ i[1] for i in pextfnames ]); pextplanes = {k:[] for k in keys}; @@ -88,7 +88,7 @@ def process_plane(paths, header, k): if len(d) > 1: d[:-1] = [ i[ i['t'] < j['t'].min() ] for i,j in zip(d[:-1],d[1:]) ]; return d -vprint(''); +vprint('reading planes'); d = [ di for paths,header, k in zip(pextplanes,cycle(headers),keys) for di in process_plane(paths,header,k) ];
neext to add testing locally omg
py
diff --git a/samcli/commands/local/cli_common/options.py b/samcli/commands/local/cli_common/options.py index <HASH>..<HASH> 100644 --- a/samcli/commands/local/cli_common/options.py +++ b/samcli/commands/local/cli_common/options.py @@ -153,13 +153,25 @@ def warm_containers_common_options(f): warm_containers_options = [ click.option( "--warm-containers", - help="Optional. Specifies how AWS SAM CLI manages containers for each function.", + help=""" + \b + Optional. Specifies how AWS SAM CLI manages + containers for each function. + Two modes are available: + EAGER: Containers for all functions are + loaded at startup and persist between + invocations. + LAZY: Containers are only loaded when each + function is first invoked. Those containers + persist for additional invocations. + """, type=click.Choice(ContainersInitializationMode.__members__, case_sensitive=False), ), click.option( "--debug-function", help="Optional. Specifies the Lambda Function logicalId to apply debug options to when" - " --warm-containers is specified ", + " --warm-containers is specified. This parameter applies to --debug-port, --debugger-path," + " and --debug-args.", type=click.STRING, multiple=False, ),
chore: update the warm-containers & debug-function options help wording (#<I>)
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,13 +10,13 @@ with open(path.join(here, 'README.rst'), encoding='utf-8') as f: setup( name='jira-metrics-extract', - version='0.13', + version='0.14', description='Extract agile metrics data from JIRA', long_description=long_description, author='Rudiger Wolf', author_email='rudiger.wolf@throughputfocus.com', url='https://github.com/rnwolf/jira-metrics-extract', - download_url = 'https://github.com/rnwolf/jira-metrics-extract/tarball/0.13', + download_url = 'https://github.com/rnwolf/jira-metrics-extract/tarball/0.14', license='MIT', keywords='agile metrics jira analytics kanban cfd', packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
update setup.py for new version number
py
diff --git a/latexmk.py b/latexmk.py index <HASH>..<HASH> 100644 --- a/latexmk.py +++ b/latexmk.py @@ -99,7 +99,6 @@ class LatexMaker(object): if (re.search('No file %s.bbl.' % self.project_name, self.out) or re.search('LaTeX Warning: Citation .* undefined', self.out) or cite_counter != self.generate_citation_counter()): - print 'bib detected' make_bib = True elif os.path.isfile('%s.bib.old' % self.project_name): with nested(open('%s.bib' % self.project_name),
debug print removed :-)
py
diff --git a/benchmarks/memory/test_curves.py b/benchmarks/memory/test_curves.py index <HASH>..<HASH> 100644 --- a/benchmarks/memory/test_curves.py +++ b/benchmarks/memory/test_curves.py @@ -29,10 +29,7 @@ SUCCESS_TEMPLATE = 'Memory usage: {:g}KB.' def get_bounds(): # NOTE: These bounds assume **just** the interpeter is running this code. # When using a test runner like `py.test`, usage goes up by 4-8 KB. - if os.getenv('CIRCLECI') == 'true': - return 22, 30 - else: - return 28, 32 + return 28, 32 def intersect_all():
Remove memory benchmark "special" bounds for CircleCI. The builds that have run so far seem to be in the observed range on my **own** install of Ubuntu <I>: - <I>KB (<URL>) - <I>KB (<URL>) - <I> KB (<URL>)
py
diff --git a/satpy/_config.py b/satpy/_config.py index <HASH>..<HASH> 100644 --- a/satpy/_config.py +++ b/satpy/_config.py @@ -79,7 +79,7 @@ if _satpy_config_path is not None: # colon-separated are ordered by builtins -> custom # i.e. first/lowest priority to last/highest priority _satpy_config_path = _satpy_config_path.split(':') - os.environ['SATPY_CONFIG_PATH'] = _satpy_config_path + os.environ['SATPY_CONFIG_PATH'] = repr(_satpy_config_path) for config_dir in _satpy_config_path[::-1]: _CONFIG_PATHS.append(os.path.join(config_dir, 'satpy.yaml'))
Fix SATPY_CONFIG_PATH getting a non-string assigned
py
diff --git a/cufflinks/plotlytools.py b/cufflinks/plotlytools.py index <HASH>..<HASH> 100644 --- a/cufflinks/plotlytools.py +++ b/cufflinks/plotlytools.py @@ -819,9 +819,9 @@ def _iplot(self,kind='scatter',data=None,layout=None,filename='',sharing=None,ti y=self[y].values.tolist() z=size if size else z rg=self[z].values - if len(rg) > 1: + if len(rg) > 1: z=[int(100*(float(_)-rg.min())/(rg.max()-rg.min()))+12 for _ in rg] - else: + else: z=[12] if len(rg) else [] text=kwargs['labels'] if 'labels' in kwargs else text labels=self[text].values.tolist() if text else ''
changed whitespace to tabs to match existing code
py
diff --git a/lib/reda/configs/configManager.py b/lib/reda/configs/configManager.py index <HASH>..<HASH> 100644 --- a/lib/reda/configs/configManager.py +++ b/lib/reda/configs/configManager.py @@ -126,20 +126,26 @@ class ConfigManager(object): ---------- filename: string absolute or relative path to a mcf-file - + Returns ------- Nx2 numpy array with current injections """ injections = [] - #load all injections + # load all injections with open(filename, encoding="latin-1") as mcf: for line in mcf: if line[:2] == "SE": - injections.append((line[3:6],line[7:10])) - #remove every second line to remove double entries - injections = np.asarray(injections[0::2], dtype=int) + injections.append((line[3:6], line[7:10])) + + # convert to array + injections = np.asarray(injections, dtype=int) + # remove double entries because only one current injection + # is needed for configs + mask = np.less(injections[:, 0], injections[:, 1]) + injections = injections[mask] + return(injections) def load_crmod_config(self, filename):
reformatted for pep8-coding and changed switched current injection filter
py
diff --git a/blimpy/filterbank.py b/blimpy/filterbank.py index <HASH>..<HASH> 100755 --- a/blimpy/filterbank.py +++ b/blimpy/filterbank.py @@ -730,7 +730,7 @@ class Filterbank(object): # Reverse oder if vertical orientation. if orientation is not None: if 'v' in orientation: - plt.plot(plot_data, plot_t[::-1], **kwargs) + plt.plot(plot_data, plot_t, **kwargs) else: plt.plot(plot_t, plot_data, **kwargs) plt.xlabel(xlabel)
Bugfix. Also related to the time flip bug. Former-commit-id: <I>df0eb<I>d8e6fa<I>f7bac6ad
py
diff --git a/beetle/base.py b/beetle/base.py index <HASH>..<HASH> 100644 --- a/beetle/base.py +++ b/beetle/base.py @@ -73,10 +73,13 @@ class Writer(object): def write(self): for destination, content in self.files(): - destination_folder = os.path.dirname(destination) + self.write_file(destination, content) - if not os.path.exists(destination_folder): - os.makedirs(destination_folder) + def write_file(self, destination, content): + destination_folder = os.path.dirname(destination) - with open(destination, 'wb') as fo: - fo.write(content) + if not os.path.exists(destination_folder): + os.makedirs(destination_folder) + + with open(destination, 'wb') as fo: + fo.write(content)
Splitted actual writing to a new function.
py
diff --git a/src/transformers/trainer_utils.py b/src/transformers/trainer_utils.py index <HASH>..<HASH> 100644 --- a/src/transformers/trainer_utils.py +++ b/src/transformers/trainer_utils.py @@ -676,6 +676,8 @@ class RemoveColumnsCollator: self.message_logged = False def _remove_columns(self, feature: dict) -> dict: + if not isinstance(feature, dict): + return feature if not self.message_logged and self.logger and self.model_name: ignored_columns = list(set(feature.keys()) - set(self.signature_columns)) if len(ignored_columns) > 0:
Fix Trainer for Datasets that don't have dict items (#<I>)
py
diff --git a/great_expectations/util.py b/great_expectations/util.py index <HASH>..<HASH> 100644 --- a/great_expectations/util.py +++ b/great_expectations/util.py @@ -1401,11 +1401,16 @@ def get_sqlalchemy_selectable(selectable: Union[Table, Select]) -> Union[Table, without explicitly turning the inner select() into a subquery first. This helper method ensures that this conversion takes place. + For versions of SQLAlchemy < 1.4 the implicit conversion to a subquery may not always work, so that + also needs to be handled here, using the old equivalent method. + https://docs.sqlalchemy.org/en/14/changelog/migration_14.html#change-4617 """ - if version.parse(sa.__version__) >= version.parse("1.4"): - if isinstance(selectable, Select): + if isinstance(selectable, Select): + if version.parse(sa.__version__) >= version.parse("1.4"): selectable = selectable.subquery() + else: + selectable = selectable.alias() return selectable
[BUGFIX] Update helper to add explicit alias to subqueries for SQLA version < <I> (#<I>) * Update helper to add explicit alias to subqueries for SQLA version < <I> Implicit conversion of a nested select into a subquery failed when running on SQLA <I> against Postgres - update the existing helper to also handle older supported versions of SQLA. * Update util.py
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ setup( # 3 - Alpha # 4 - Beta # 5 - Production/Stable - "Development Status :: 3 - Alpha", + "Development Status :: 4 - Beta", # Indicate who your project is intended for "Intended Audience :: Science/Research", "Topic :: Database :: Front-Ends",
Change status to 'beta' in setup.py
py
diff --git a/torchvision/datasets/phototour.py b/torchvision/datasets/phototour.py index <HASH>..<HASH> 100644 --- a/torchvision/datasets/phototour.py +++ b/torchvision/datasets/phototour.py @@ -10,7 +10,17 @@ from .utils import download_url class PhotoTour(VisionDataset): - """`Learning Local Image Descriptors Data <http://phototour.cs.washington.edu/patches/default.htm>`_ Dataset. + """`Multi-view Stereo Correspondence <http://matthewalunbrown.com/patchdata/patchdata.html>`_ Dataset. + + .. note:: + + We only provide the newer version of the dataset, since the authors state that it + + is more suitable for training descriptors based on difference of Gaussian, or Harris corners, as the + patches are centred on real interest point detections, rather than being projections of 3D points as is the + case in the old dataset. + + The original dataset is available under http://phototour.cs.washington.edu/patches/default.htm. Args:
add version information to docstring of Phototour dataset (#<I>)
py
diff --git a/nodeconductor/iaas/serializers.py b/nodeconductor/iaas/serializers.py index <HASH>..<HASH> 100644 --- a/nodeconductor/iaas/serializers.py +++ b/nodeconductor/iaas/serializers.py @@ -518,11 +518,11 @@ class InstanceCreateSerializer(structure_serializers.PermissionFieldFilteringMix membership = validated_data.get('cloud_project_membership') floating_ip = validated_data.pop('external_ips', None) if floating_ip: - ip = models.FloatingIP.objects.filter( + ip = models.FloatingIP.objects.get( address=floating_ip, status='DOWN', cloud_project_membership=membership, - ).first() + ) ip.status = 'BOOKED' ip.save()
Use a more reliable lookup method - ITACLOUD-<I>
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name=NAME, version=VERSION, description='Yet another IRC bot library', - long_description=open(os.path.join(CURRENT_DIR, 'README.md')).read().strip(), + long_description=open(os.path.join(CURRENT_DIR, 'README.rst')).read().strip(), author=AUTHOR, author_email='mattoufootu@gmail.com', url=URL,
reflect README extension change in setup.py
py
diff --git a/mpldatacursor.py b/mpldatacursor.py index <HASH>..<HASH> 100644 --- a/mpldatacursor.py +++ b/mpldatacursor.py @@ -343,7 +343,13 @@ class DataCursor(object): def enable(self): """Connects callbacks and makes artists pickable. If the datacursor has already been enabled, this function has no effect.""" - connect = lambda fig: fig.canvas.mpl_connect('pick_event', self) + def connect(fig): + cid = fig.canvas.mpl_connect('pick_event', self) + # Shouldn't be necessary. Workaround for a bug in some mpl versions + proxy = fig.canvas.callbacks.BoundMethodProxy(self) + fig.canvas.callbacks.callbacks['pick_event'][cid] = proxy + return cid + if not getattr(self, '_enabled', False): self._cids = [(fig, connect(fig)) for fig in self.figures] for artist in self.artists:
Workaround for matplotlib bug when disconnecting and reconnecting events
py
diff --git a/kettle/update.py b/kettle/update.py index <HASH>..<HASH> 100755 --- a/kettle/update.py +++ b/kettle/update.py @@ -73,12 +73,12 @@ def main(): call(f'{bq_cmd} k8s-gubernator:build.all build_all.json.gz schema.json') call(f'python3 stream.py --poll {SUB_PATH} ' \ - '--dataset k8s-gubernator:build --tables all:{MONTH} day:{DAY} week:{WEEK} --stop_at=1') + f'--dataset k8s-gubernator:build --tables all:{MONTH} day:{DAY} week:{WEEK} --stop_at=1') else: call(f'{mj_cmd} | pv | gzip > build_staging.json.gz') call(f'{bq_cmd} k8s-gubernator:build.staging build_staging.json.gz schema.json') call(f'python3 stream.py --poll {SUB_PATH} ' \ - '--dataset k8s-gubernator:build --tables staging:0 --stop_at=1') + f'--dataset k8s-gubernator:build --tables staging:0 --stop_at=1') if __name__ == '__main__': os.chdir(os.path.dirname(__file__))
Missing multi-line on f-string
py
diff --git a/python_modules/dagster/dagster/cli/workspace/workspace.py b/python_modules/dagster/dagster/cli/workspace/workspace.py index <HASH>..<HASH> 100644 --- a/python_modules/dagster/dagster/cli/workspace/workspace.py +++ b/python_modules/dagster/dagster/cli/workspace/workspace.py @@ -66,6 +66,11 @@ class Workspace: self._location_origin_dict[origin.location_name] = origin self._load_handle(origin.location_name) + # Can be overidden in subclasses that need different logic for loading repository + # locations from origins + def create_handle_from_origin(self, origin): + return origin.create_handle() + def _load_handle(self, location_name): existing_handle = self._location_handle_dict.get(location_name) if existing_handle: @@ -79,7 +84,7 @@ class Workspace: origin = self._location_origin_dict[location_name] try: - handle = origin.create_handle() + handle = self.create_handle_from_origin(origin) self._location_handle_dict[location_name] = handle except Exception: # pylint: disable=broad-except error_info = serializable_error_info_from_exc_info(sys.exc_info())
Add overridable method to workspace that allows for changing the logic for turning origins into handles Summary: This will be useful in places where we want to take the same origins but load the underlying repositories differently. Test Plan: BK Reviewers: sashank Reviewed By: sashank Differential Revision: <URL>
py
diff --git a/tensor2tensor/utils/decoding.py b/tensor2tensor/utils/decoding.py index <HASH>..<HASH> 100644 --- a/tensor2tensor/utils/decoding.py +++ b/tensor2tensor/utils/decoding.py @@ -70,6 +70,7 @@ def decode_hparams(overrides=""): shards=1, # How many shards of data to decode (treating 1 as None). shard_id=0, # Which shard are we decoding if more than 1 above. shards_start_offset=0, # Number of the first shard to decode. + shard_google_format=False, # If True use Google shard naming format. num_decodes=1, force_decode_length=False, display_decoded_images=False, @@ -510,7 +511,11 @@ def decode_from_file(estimator, def _add_shard_to_filename(filename, decode_hp): if decode_hp.shards > 1: shard_id = decode_hp.shard_id + decode_hp.shards_start_offset - filename = filename + ("%.3d" % shard_id) + if decode_hp.shard_google_format: + filename = filename + "-{0:05d}-of-{1:05d}".format(shard_id, + decode_hp.shards) + else: + filename = filename + ("%.3d" % shard_id) return filename
Fix sharded decoding name convention. PiperOrigin-RevId: <I>
py
diff --git a/cassiopeia/core/summoner.py b/cassiopeia/core/summoner.py index <HASH>..<HASH> 100644 --- a/cassiopeia/core/summoner.py +++ b/cassiopeia/core/summoner.py @@ -203,3 +203,8 @@ class Summoner(CassiopeiaGhost): def league_positions(self) -> "LeagueEntries": from .league import LeagueEntries return LeagueEntries(summoner=self, region=self.region) + + @lazy_property + def rank_last_season(self): + most_recent_match = self.match_history[0] + return most_recent_match.participants[self.name].rank_last_season
added a `rank_last_season` property to Summoners
py
diff --git a/microsoftbotframework/activity.py b/microsoftbotframework/activity.py index <HASH>..<HASH> 100644 --- a/microsoftbotframework/activity.py +++ b/microsoftbotframework/activity.py @@ -96,13 +96,9 @@ class Activity(Response): if getattr(self, key, None) is None: setattr(self, key, value) - # We need to modify the slack channel data to changed the user id to the bot id + # We need to remove the slack channel data when posting back. if key == 'channelData': if 'SlackMessage' in message['channelData']: - if 'user' in message['channelData']['SlackMessage']: - message['channelData']['SlackMessage']['user'] = message['recipient']['id'].split(':')[0] - if 'text' in message['channelData']['SlackMessage']: - message['channelData']['SlackMessage']['user'] = getattr(self, 'text') setattr(self, key, None) else: setattr(self, key, value)
Set channeldata to None when responding to Slack message
py
diff --git a/thermohw/preprocessors.py b/thermohw/preprocessors.py index <HASH>..<HASH> 100644 --- a/thermohw/preprocessors.py +++ b/thermohw/preprocessors.py @@ -41,6 +41,8 @@ class HomeworkPreprocessor(Preprocessor): def preprocess(self, nb, resources): """Preprocess the entire notebook.""" + # Use this loop to remove raw cells because the NotebookExporter + # doesn't have the exclude_raw configurable option keep_cells = [] for cell in nb.cells: if cell.cell_type != 'raw':
Add note to preprocessors about why we don't use exclude_raw config
py
diff --git a/tensorlayer/models/core.py b/tensorlayer/models/core.py index <HASH>..<HASH> 100644 --- a/tensorlayer/models/core.py +++ b/tensorlayer/models/core.py @@ -1,6 +1,3 @@ -import sys -sys.path.append("/Users/wurundi/PycharmProjects/tensorlayer2") -import numpy as np from abc import ABCMeta, abstractmethod import tensorflow as tf from tensorflow.python.framework import ops as tf_ops
remove sys.path in the head of model core
py
diff --git a/astroplan/utils.py b/astroplan/utils.py index <HASH>..<HASH> 100644 --- a/astroplan/utils.py +++ b/astroplan/utils.py @@ -51,8 +51,8 @@ def download_IERS_A(show_progress=True): Download and cache the IERS Bulletin A table. If one is already cached, download a new one and overwrite the old. Store - table in the astropy cache, and undo the monkey patching done by - `~astroplan.get_IERS_A_or_workaround`. + table in the astropy cache, and undo the monkey patching caused by earlier + failure (if applicable). If one does not exist, monkey patch `~astropy.time.Time._get_delta_ut1_utc` so that `~astropy.time.Time` objects don't raise errors by computing UT1-UTC
* Fix sphinx errors in docstring.
py
diff --git a/scripts/update_contributors.py b/scripts/update_contributors.py index <HASH>..<HASH> 100644 --- a/scripts/update_contributors.py +++ b/scripts/update_contributors.py @@ -44,7 +44,11 @@ def iter_recent_authors(): state="closed", sort="updated", direction="desc" ).get_page(0) for pull in recent_pulls: - if pull.merged and pull.user.login not in BOT_LOGINS: + if ( + pull.merged + and pull.user.type == "User" + and pull.user.login not in BOT_LOGINS + ): yield pull.user
Only consider users of type 'User'
py
diff --git a/mlbgame/__init__.py b/mlbgame/__init__.py index <HASH>..<HASH> 100644 --- a/mlbgame/__init__.py +++ b/mlbgame/__init__.py @@ -276,3 +276,9 @@ def league(): """Return Info object that contains league information""" info = mlbgame.info.league_info() return mlbgame.info.Info(info) + +def teams(): + """Return list of Info objects for each team""" + info = mlbgame.info.team_info() + output = [mlbgame.info.Info(x) for x in info] + return output
Add function that returns information on every team Fixes #<I>
py
diff --git a/tests/test_modeling_tf_common.py b/tests/test_modeling_tf_common.py index <HASH>..<HASH> 100644 --- a/tests/test_modeling_tf_common.py +++ b/tests/test_modeling_tf_common.py @@ -476,6 +476,7 @@ class TFModelTesterMixin: "TFFunnelForPreTraining", "TFElectraForPreTraining", "TFXLMWithLMHeadModel", + "TFTransfoXLLMHeadModel", ]: self.assertEqual(tf_loss is None, pt_loss is None) @@ -490,7 +491,8 @@ class TFModelTesterMixin: "TFFunnelForPreTraining", "TFElectraForPreTraining", "TFXLMWithLMHeadModel", - ] + ["TFTransfoXLLMHeadModel"]: + "TFTransfoXLLMHeadModel", + ]: self.assertEqual(tf_keys, pt_keys) # Since we deliberately make some tests pass above (regarding the `loss`), let's still try to test
Skip equivalence test for TransfoXL (#<I>) * Skip test for TransfoXL * Single list
py
diff --git a/odswriter/ods_components.py b/odswriter/ods_components.py index <HASH>..<HASH> 100644 --- a/odswriter/ods_components.py +++ b/odswriter/ods_components.py @@ -57,7 +57,7 @@ manifest_xml = """<?xml version="1.0" encoding="UTF-8"?> <manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2"> <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/> <manifest:file-entry manifest:full-path="content.xml" manifest:media-type="text/xml"/> - <manifest:file-entry manifest:full-path="manifest.rdf" manifest:media-type="application/rdf+xml"/> + <manifest:file-entry manifest:full-path="styles.xml" manifest:media-type="text/xml"/> </manifest:manifest> """
Correct references to styles.xml, manifest.rdf.
py
diff --git a/toucan_data_sdk/utils/decorators.py b/toucan_data_sdk/utils/decorators.py index <HASH>..<HASH> 100644 --- a/toucan_data_sdk/utils/decorators.py +++ b/toucan_data_sdk/utils/decorators.py @@ -38,11 +38,10 @@ Note: """ import logging import time -from collections.abc import Callable from functools import partial, wraps from hashlib import md5 from threading import current_thread -from typing import Any, Dict, List, Optional, Tuple, Union +from typing import Any, Callable, Dict, List, Optional, Tuple, Union import joblib import pandas as pd
fix: import Callable for python <I>
py
diff --git a/proso/analysis.py b/proso/analysis.py index <HASH>..<HASH> 100644 --- a/proso/analysis.py +++ b/proso/analysis.py @@ -1,6 +1,7 @@ import json import hashlib import os +import pandas def get_experiment_data(name, compute_fun, cache_dir, cached=True, **kwargs): @@ -18,6 +19,20 @@ def get_experiment_data(name, compute_fun, cache_dir, cached=True, **kwargs): return result +def get_raw_data(name, load_fun, cache_dir, cached=True, **kwargs): + kwargs_hash = hashlib.sha1(json.dumps(kwargs, sort_keys=True)).hexdigest() + filename = '{}/{}_{}.pd'.format(cache_dir, name, kwargs_hash) + if cached and os.path.exists(filename): + with open(filename, 'r') as f: + return pandas.read_pickle(filename) + result = load_fun(**kwargs) + if cached: + if not os.path.exists(cache_dir): + os.makedirs(cache_dir) + result.to_pickle(filename) + return result + + def _convert_json_keys(json_struct): if isinstance(json_struct, list): return map(_convert_json_keys, json_struct)
be able to cache also raw data
py
diff --git a/niworkflows/interfaces/bids.py b/niworkflows/interfaces/bids.py index <HASH>..<HASH> 100644 --- a/niworkflows/interfaces/bids.py +++ b/niworkflows/interfaces/bids.py @@ -648,6 +648,10 @@ space-MNI152NLin6Asym_desc-preproc_bold.json' if new_data is None: set_consumables(new_header, orig_img.dataobj) new_data = orig_img.dataobj.get_unscaled() + else: + # Without this, we would be writing nans + # This is our punishment for hacking around nibabel defaults + new_header.set_slope_inter(slope=1., inter=0.) unsafe_write_nifti_header_and_data( fname=out_file, header=new_header,
FIX: Set slope and intercept to 1/0 if not otherwise provided
py
diff --git a/tests/checkers/unittest_refactoring.py b/tests/checkers/unittest_refactoring.py index <HASH>..<HASH> 100644 --- a/tests/checkers/unittest_refactoring.py +++ b/tests/checkers/unittest_refactoring.py @@ -20,7 +20,7 @@ def test_process_tokens() -> None: assert cm.value.code == 0 -@pytest.mark.timeout(25) +@pytest.mark.timeout(60) def test_issue_5724() -> None: """Regression test for parsing of pylint disable pragma's.""" with pytest.raises(SystemExit) as cm:
increase timeout value for test_issue_<I> (#<I>)
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ from setuptools import setup setup( name='Flask-Assistant', - version='0.2.92', + version='0.2.93', url='https://github.com/treethought/flask-assistant', license='Apache 2.0', author='Cam Sweeney',
version bump <I> - bdist_wheel and setup.py test
py
diff --git a/fireplace/managers.py b/fireplace/managers.py index <HASH>..<HASH> 100644 --- a/fireplace/managers.py +++ b/fireplace/managers.py @@ -1,5 +1,5 @@ from hearthstone.enums import GameTag -from .enums import ALWAYS_WINS_BRAWLS, CANT_OVERLOAD, KILLED_THIS_TURN +from . import enums class Manager(object): @@ -112,7 +112,7 @@ class PlayerManager(Manager): GameTag.TEMP_RESOURCES: "temp_mana", GameTag.TIMEOUT: "timeout", GameTag.TURN_START: "turn_start", - CANT_OVERLOAD: "cant_overload", + enums.CANT_OVERLOAD: "cant_overload", } @@ -181,8 +181,8 @@ CARD_ATTRIBUTE_MAP = { GameTag.TAUNT: "taunt", GameTag.WINDFURY: "windfury", GameTag.ZONE: "zone", - ALWAYS_WINS_BRAWLS: "always_wins_brawls", - KILLED_THIS_TURN: "killed_this_turn", + enums.ALWAYS_WINS_BRAWLS: "always_wins_brawls", + enums.KILLED_THIS_TURN: "killed_this_turn", GameTag.AFFECTED_BY_SPELL_POWER: None, GameTag.ARTISTNAME: None, GameTag.AttackVisualType: None,
Make the managers.py import less verbose
py
diff --git a/r12/shell.py b/r12/shell.py index <HASH>..<HASH> 100644 --- a/r12/shell.py +++ b/r12/shell.py @@ -67,7 +67,7 @@ class ArmShell(cmd.Cmd, object): def __init__(self, arm, wrapper=None, color=DEFAULT_COLOR): super(ArmShell, self).__init__() - colorama.init(autoreset=True) + colorama.init() self.arm = arm self.style = ShellStyle(color) @@ -95,6 +95,8 @@ class ArmShell(cmd.Cmd, object): def cmdloop(self, intro=None): ''' Override the command loop to handle Ctrl-C. ''' self.preloop() + + # Set up completion with readline. if self.use_rawinput and self.completekey: try: import readline @@ -103,6 +105,7 @@ class ArmShell(cmd.Cmd, object): readline.parse_and_bind(self.completekey + ': complete') except ImportError: pass + try: if intro is not None: self.intro = intro
Fix command history not working in Python 2.
py
diff --git a/tests/test_tables.py b/tests/test_tables.py index <HASH>..<HASH> 100644 --- a/tests/test_tables.py +++ b/tests/test_tables.py @@ -295,6 +295,15 @@ def test_where_predicates(table): z | 1 | 10 | 10 """) +@pytest.mark.filterwarnings("error") +def test_where_predicates_nowarning_on_str(table): + t = table + test = t.where('letter', are.equal_to('a')) + assert_equal(test, """ + letter | count | points + a | 9 | 1 + """) + def test_where_predicates_warning(table, capsys): t1 = table.copy() count1 = t1['count'] - 1 @@ -1647,4 +1656,3 @@ def test_read_table(): assert isinstance(Table().read_table("tests/us-unemployment-copy"), Table) assert isinstance(Table().read_table("tests/us-unemployment.txt"), Table) assert isinstance(Table().read_table("https://raw.githubusercontent.com/data-8/textbook/gh-pages/data/deflategate.csv"), Table) - \ No newline at end of file
Add regression test to make sure we don't warn when passing a string to a predicate.
py
diff --git a/insteonplm/plm.py b/insteonplm/plm.py index <HASH>..<HASH> 100644 --- a/insteonplm/plm.py +++ b/insteonplm/plm.py @@ -5,7 +5,7 @@ import binascii import time from .constants import * -from .devices.ipdb import IPDB +#from .devices.ipdb import IPDB from .aldb import ALDB from .address import Address from .plmprotocol import PLMProtocol
Removed IPDB reference from PLM
py
diff --git a/lib/stsci/tools/teal_bttn.py b/lib/stsci/tools/teal_bttn.py index <HASH>..<HASH> 100644 --- a/lib/stsci/tools/teal_bttn.py +++ b/lib/stsci/tools/teal_bttn.py @@ -5,11 +5,24 @@ $Id: teal_bttn.py 1 2011-08-30 03:19:02Z sontag $ """ from __future__ import division # confidence high -# local modules import eparoption - class TealActionParButton(eparoption.ActionEparButton): + def getButtonLabel(self): + """ Return string to be used on as button label - "value" of par. """ + # If the value has a comma, return the 2nd part, else use whole thing + return self.value.split(',')[-1] + + def getShowName(self): + """ Return string to be used on LHS of button - "name" of par. """ + # If the value has a comma, return the 1st part, else leave empty + if self.value.find(',') >= 0: + return self.value.split(',')[0] + else: + return '' + def clicked(self): # use to be called childEparDialog() + # if needed, we *could* use self._helpCallbackObj.getTaskParsObj + # or design in some better way to get to the actual ConfigObj ... print "More to do in TealActionParButton!"
this adds the basics of the GUI part for #<I> (a task can have a button in their .cfgspc), now I need to add the run-user-code-upon-button-click part, and the update-current-values-from-a-dict part git-svn-id: <URL>
py
diff --git a/pyramid_zipkin/zipkin.py b/pyramid_zipkin/zipkin.py index <HASH>..<HASH> 100644 --- a/pyramid_zipkin/zipkin.py +++ b/pyramid_zipkin/zipkin.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from py_zipkin.zipkin import create_http_headers_for_new_span # pragma: no cover +from py_zipkin.zipkin import create_http_headers_for_new_span # pragma: no cover # Backwards compatibility for places where pyramid_zipkin is unpinned -create_headers_for_new_span = create_http_headers_for_new_span # pragma: no cover +create_headers_for_new_span = create_http_headers_for_new_span # pragma: no cover
flake8 wants 2 spaces before inline comment
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages setup( name='pycannon', - version='0.1.0', + version='0.2.0', packages=find_packages(), install_requires=[ 'requests', @@ -15,7 +15,13 @@ setup( license='MIT', url='https://github.com/nathan-osman/pycannon', classifiers=[ - 'Development Status :: 3 - Alpha', + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', + 'Topic :: Software Development :: Libraries :: Python Modules', ], )
Bumped version to <I>.
py
diff --git a/h11/readers.py b/h11/readers.py index <HASH>..<HASH> 100644 --- a/h11/readers.py +++ b/h11/readers.py @@ -181,17 +181,6 @@ class ContentLengthReader: return Data(data=data) -class Http10Reader: - def __call__(self, buf): - data = buf.maybe_extract_at_most(999999999) - if data is None: - return None - return Data(data) - - def read_eof(self): - return EndOfMessage() - - chunk_header_re = re.compile(br"(?P<count>[0-9]{1,20})\r\n") class ChunkedReader: def __init__(self): @@ -222,6 +211,18 @@ class ChunkedReader: self._bytes_in_chunk -= len(data) return Data(data=data) + +class Http10Reader: + def __call__(self, buf): + data = buf.maybe_extract_at_most(999999999) + if data is None: + return None + return Data(data) + + def read_eof(self): + return EndOfMessage() + + READERS = { (CLIENT, IDLE): maybe_read_from_IDLE_client, (SERVER, IDLE): maybe_read_from_SEND_RESPONSE_server,
style fixup -- put readers and writers in same order
py
diff --git a/pylint/extensions/broad_try_clause.py b/pylint/extensions/broad_try_clause.py index <HASH>..<HASH> 100644 --- a/pylint/extensions/broad_try_clause.py +++ b/pylint/extensions/broad_try_clause.py @@ -10,6 +10,7 @@ # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE """Looks for try/except statements with too much code in the try clause.""" +from typing import Union from astroid import nodes @@ -59,7 +60,7 @@ class BroadTryClauseChecker(checkers.BaseChecker): return statement_count - def visit_tryexcept(self, node: nodes.TryExcept) -> None: + def visit_tryexcept(self, node: Union[nodes.TryExcept, nodes.TryFinally]) -> None: try_clause_statements = self._count_statements(node) if try_clause_statements > self.config.max_try_statements: msg = f"try clause contains {try_clause_statements} statements, expected at most {self.config.max_try_statements}"
Fix the typing for BroadTryClause.visit_tryexcept We're calling it from visit_tryfinally it's not strictly the expected for the visitor pattern
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ DESCRIPTION = "Global hotkey bindings for Windows and Linux for PyQt apps" URL = "https://github.com/codito/pyqtkeybind" EMAIL = "arun@codito.in" AUTHOR = "Arun Mahapatra" -VERSION = (0, 0, 8) +VERSION = (0, 0, 9) # Dependencies required for execution REQUIRED = [
chore: release <I>.
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -66,6 +66,8 @@ setup( "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Multimedia :: Sound/Audio :: Analysis", "Topic :: Utilities", ],
chore: officially support Python <I> & <I>
py