message
stringlengths
13
484
diff
stringlengths
38
4.63k
Update newsroom.py Updated the URL for Newsroom download so it's more robust to future changes.
@@ -82,7 +82,7 @@ class Newsroom(nlp.GeneratorBasedBuilder): VERSION = nlp.Version("1.0.0") MANUAL_DOWNLOAD_INSTRUCTIONS = """\ - You should download the dataset from https://summari.es/download/ + You should download the dataset from http://lil.nlp.cornell.edu/newsroom/ The webpage requires registration. To unzip the .tar file run `tar -zxvf complete.tar`. To unzip the .gz files run `gunzip train.json.gz` , ... @@ -100,7 +100,7 @@ class Newsroom(nlp.GeneratorBasedBuilder): description=_DESCRIPTION, features=nlp.Features(features), supervised_keys=(_DOCUMENT, _SUMMARY), - homepage="https://summari.es", + homepage="http://lil.nlp.cornell.edu/newsroom/", citation=_CITATION, )
[sync] catch attempts at deleting home folder early this allows us to provide a better error message
@@ -2544,6 +2544,20 @@ class SyncEngine: client = client or self.client + # We intercept any attempts to delete the home folder here instead of waiting + # for an error from the Dropbox API. This allows us to provide a better error + # message. + + home_path = self._state.get("account", "home_path") + + if event.dbx_path == home_path: + raise SyncError( + title="Could not delete item", + message="Cannot delete the user's home folder", + dbx_path=event.dbx_path, + local_path=event.local_path, + ) + if event.local_path == self.dropbox_path: self.ensure_dropbox_folder_present()
Support Quantization to variable number of bits Summary: allow quantization using quant noise with variable number of bits
@@ -7,17 +7,19 @@ import torch def emulate_int(w, bits, method, scale=None, zero_point=None): - q = globals()[f"emulate_int{bits}_{method}"] - return q(w, scale=scale, zero_point=zero_point) + q = globals()[f"emulate_int8_{method}"] + return q(w, scale=scale, zero_point=zero_point, bits=bits) -def quantize(w, scale, zero_point): +def quantize(w, scale, zero_point, bits=8): + # In the default behavior, max_val = 255. + max_val = 2 ** bits - 1 return ( - torch.clamp(torch.round(w / scale + zero_point), 0, 255) - zero_point + torch.clamp(torch.round(w / scale + zero_point), 0, max_val) - zero_point ) * scale -def emulate_int8_histogram(w, scale=None, zero_point=None): +def emulate_int8_histogram(w, scale=None, zero_point=None, bits=8): if scale is None: obs = torch.quantization.observer.HistogramObserver() obs.to(device=w.device) @@ -25,10 +27,10 @@ def emulate_int8_histogram(w, scale=None, zero_point=None): scale, zero_point = obs.calculate_qparams() scale = scale.cuda().type_as(w) zero_point = zero_point.cuda().type_as(w) - return quantize(w, scale, zero_point), scale, zero_point + return quantize(w, scale, zero_point, bits=bits), scale, zero_point -def emulate_int8_channel(w, scale=None, zero_point=None): +def emulate_int8_channel(w, scale=None, zero_point=None, bits=8): if scale is None: obs = torch.quantization.observer.PerChannelMinMaxObserver( ch_axis=-1, qscheme=torch.per_channel_symmetric @@ -38,10 +40,10 @@ def emulate_int8_channel(w, scale=None, zero_point=None): scale, zero_point, ch_axis = obs.get_qparams() scale = scale.cuda().type_as(w) zero_point = zero_point.cuda().type_as(w) - return quantize(w, scale, zero_point), scale, zero_point + return quantize(w, scale, zero_point, bits=bits), scale, zero_point -def emulate_int8_tensor(w, scale=None, zero_point=None): +def emulate_int8_tensor(w, scale=None, zero_point=None, bits=8): if scale is None: obs = torch.quantization.observer.MinMaxObserver() obs.to(device=w.device) @@ -49,4 +51,4 @@ def emulate_int8_tensor(w, scale=None, zero_point=None): scale, zero_point = obs.calculate_qparams() scale = scale.cuda().type_as(w) zero_point = zero_point.cuda().type_as(w) - return quantize(w, scale, zero_point), scale, zero_point + return quantize(w, scale, zero_point, bits=bits), scale, zero_point
Document Postgres-backed instance Summary: Includes a YAML snippet. Stacked on D1166 Test Plan: N/A. Reviewers: #ft, alangenfeld, natekupp
@@ -18,3 +18,46 @@ Tools like the Dagster CLI or Dagit use the following behavior to select the cur 4. Use an ephemeral instance, which will hold information in memory and use a TemporaryDirectory for local artifacts which is cleaned up on exit. This is useful for tests and is the default for direct python api invocations such as `execute_pipeline`. + + +## Writing a dagster.yaml + +You can use the explicit settings in `$DAGSTER_HOME/dagster.yaml` to tell Dagster which classes +to use to manage the event log storage, run log storage, and so forth. This means that these +storage classes are pluggable. + +In general, you can tell Dagster which class to use for, e.g., run storage by writing yaml like: + +``` +run_storage: + module: my_very_awesome_module.run_storage + class: AwesomeRunStorage + config: + secret_word: "quux" +``` + +(If you're thinking of writing your own class for a case like this, please get in touch -- we can +help you implement the necessary interfaces.) + +## Using a local or remote Postgres instance for storage. + +We've written a set of classes (in `dagster-postgres`) which let you target a (local or remote) +Postgres instance to store information about runs and event logs. + +Make sure that `dagster-postgres` is installed in your Python environment, put the following lines +into your `dagster.yaml` (replacing the values for `user`, `password`, the port, and `db_name` as +needed to target your own local or remote Postgres instance), and then just start dagit as normal: + +``` +run_storage: + module: dagster_postgres.run_storage + class: PostgresRunStorage + config: + postgres_url: "postgresql://user:[email protected]:5432/db_name" + +event_log_storage: + module: dagster_postgres.event_log + class: PostgresEventLogStorage + config: + postgres_url: "postgresql://user:[email protected]:5432/db_name" +```
Speed up BQM.add_variable and BQM.add_interaction BQM.add_variable and .add_interaction used the LinearView and QuadraticView respectively to add biases to the BQM. This was slow relative to manipulating the underlying BQM._adj directly. The down side is now there are two places where _adj is manipulated.
@@ -427,21 +427,22 @@ class BinaryQuadraticModel(abc.Sized, abc.Container, abc.Iterable): if vartype is not None and vartype is not self.vartype: if self.vartype is Vartype.SPIN and vartype is Vartype.BINARY: # convert from binary to spin - bias /= 2. + bias /= 2 self.offset += bias elif self.vartype is Vartype.BINARY and vartype is Vartype.SPIN: # convert from spin to binary self.offset -= bias - bias *= 2. + bias *= 2 else: raise ValueError("unknown vartype") - # add the variable to linear and adj - linear = self.linear - if v in linear: - linear[v] += bias + # we used to do this using self.linear but working directly with _adj + # is much faster + _adj = self._adj + if v in _adj: + _adj[v][v] += bias else: - linear[v] = bias + _adj[v] = {v: bias} try: self._counterpart.add_variable(v, bias, vartype=self.vartype) @@ -539,38 +540,35 @@ class BinaryQuadraticModel(abc.Sized, abc.Container, abc.Iterable): if u == v: raise ValueError("no self-loops allowed, therefore ({}, {}) is not an allowed interaction".format(u, v)) - linear = self.linear - quadratic = self.quadratic - adj = self.adj - - # so that they exist - self.add_variable(u, 0.0) - self.add_variable(v, 0.0) - if vartype is not None and vartype is not self.vartype: if self.vartype is Vartype.SPIN and vartype is Vartype.BINARY: # convert from binary to spin bias /= 4 - self.offset += bias - linear[u] += bias - linear[v] += bias + self.add_offset(bias) + self.add_variable(u, bias) + self.add_variable(v, bias) elif self.vartype is Vartype.BINARY and vartype is Vartype.SPIN: # convert from spin to binary - self.offset += bias - linear[u] += -2 * bias - linear[v] += -2 * bias + self.add_offset(bias) + self.add_variable(u, -2 * bias) + self.add_variable(v, -2 * bias) bias *= 4 else: raise ValueError("unknown vartype") + else: + # so that they exist + self.add_variable(u, 0) + self.add_variable(v, 0) - if (v, u) in quadratic: - quadratic[(v, u)] += bias + _adj = self._adj + if u in _adj[v]: + _adj[u][v] = _adj[v][u] = _adj[u][v] + bias else: - quadratic[(u, v)] = bias + _adj[u][v] = _adj[v][u] = bias try: self._counterpart.add_interaction(u, v, bias, vartype=self.vartype)
Fix ketos test progress bar regression Fixes
@@ -773,13 +773,13 @@ def test(ctx, batch_size, model, evaluation_files, device, pad, workers, error += c except FileNotFoundError as e: batches -= 1 - pred.update(total=batches) + progress.update(pred_task, total=batches) logger.warning('{} {}. Skipping.'.format(e.strerror, e.filename)) except KrakenInputException as e: batches -= 1 - pred.update(total=batches) + progress.update(pred_task, total=batches) logger.warning(str(e)) - pred.update(pred_task, advance=1) + progress.update(pred_task, advance=1) acc_list.append((chars - error) / chars) confusions, scripts, ins, dels, subs = compute_confusions(algn_gt, algn_pred)
fixed tests for `format_board_bonus_challenge` step updated `/backend/main/tests/test_transcript.json`
{ "get_solution": [ "def format_board(board):", - " result = ' '", - " for i in range(len(board)):", - " result += str(i + 1)", - " result += '\\n'", - " for i in range(len(board)):", - " result += str(i + 1)", - " for char in board[i]:", - " result += char", - " if i != len(board) - 1:", - " result += '\\n'", - " return result" + " joined_rows = []", + " for row in board:", + " joined_rows.append(\"|\".join(row))", + " lines = []", + " for _ in board[0]:", + " lines.append(\"-\")", + " line = f'\\n{\"+\".join(lines)}\\n'", + " return line.join(joined_rows)" ], "page": "The newline character, <code>format_board</code>", "program": [ "def format_board(board):", - " result = ' '", - " for i in range(len(board)):", - " result += str(i + 1)", - " result += '\\n'", - " for i in range(len(board)):", - " result += str(i + 1)", - " for char in board[i]:", - " result += char", - " if i != len(board) - 1:", - " result += '\\n'", - " return result" + " joined_rows = []", + " for row in board:", + " joined_rows.append(\"|\".join(row))", + " lines = []", + " for _ in board[0]:", + " lines.append(\"-\")", + " line = f'\\n{\"+\".join(lines)}\\n'", + " return line.join(joined_rows)" ], "response": { "message": "",
Add ansible timeout for ssh connection And attempts of connection retries
@@ -20,6 +20,8 @@ RUN pip install ./kqueen # Avoid Ssh issues with docker overlayfs and sockets ENV ANSIBLE_SSH_CONTROL_PATH /dev/shm/cp%%h-%%p-%%r +ENV ANSIBLE_SSH_RETRIES 3 +ENV ANSIBLE_TIMEOUT 25 ENV KQUEEN_KS_KUBESPRAY_PATH /code/kubespray ENV KQUEEN_KS_ANSIBLE_CMD /usr/local/bin/ansible ENV KQUEEN_KS_ANSIBLE_PLAYBOOK_CMD /usr/local/bin/ansible-playbook
Check key in python for table join * Check key in python for table join fixes * fix
@@ -1632,7 +1632,7 @@ class Table(ExprContainer): @typecheck_method(right=table_type, how=enumeration('inner', 'outer', 'left', 'right')) - def join(self, right, how='inner') -> 'Table': + def join(self, right: 'Table', how='inner') -> 'Table': """Join two tables together. Examples @@ -1680,6 +1680,12 @@ class Table(ExprContainer): Joined table. """ + left_key_types = list(self.key.dtype.values()) + right_key_types = list(right.key.dtype.values()) + if not left_key_types == right_key_types: + raise ValueError(f"'join': key mismatch:\n " + f" left: [{', '.join(str(t) for t in left_key_types)}]\n " + f" right: [{', '.join(str(t) for t in right_key_types)}]") return Table(self._jt.join(right._jt, how))
typo copy and paste issue
@@ -633,7 +633,7 @@ def compare(*args, **kw): with this string in the message in the :class:`AssertionError`. - :param x_label: If provided, in the event of an :class:`AssertionError` + :param y_label: If provided, in the event of an :class:`AssertionError` being raised, the object passed as the second positional argument, or ``y`` keyword argument, will be labelled with this string in the message in the
langkit.parsers.NodeToParsersPass: switch to new-style objects TN:
@@ -1451,7 +1451,7 @@ class Predicate(Parser): # pretty printers for Langkit grammars. -class NodeToParsersPass(): +class NodeToParsersPass(object): """ This pass computes the correspondence between AST node types and parsers. The end goal is to have one and only one non-ambiguous rule to pretty-print
skip cache during tests This object is deleted via couch API call, so the mechanism which normally clears the cache is not called. Since tests frequently use domain names like "test", conflicts can arise which wouldn't be an issue with a 5 minute cache in the real world.
from decimal import Decimal +from django.conf import settings from django.db import models from django.db.models.signals import post_delete, post_save from django.dispatch import receiver @@ -148,7 +149,7 @@ class CommtrackConfig(QuickCachedDocumentMixin, Document): self.for_domain.clear(self.__class__, self.domain) @classmethod - @quickcache(vary_on=['domain']) + @quickcache(vary_on=['domain'], skip_arg=lambda *args: settings.UNIT_TESTING) def for_domain(cls, domain): result = get_docs_in_domain_by_class(domain, cls) try:
bugfix: order of variables in quantified Z3 terms This fix guarantees that variables are quantified in the right order. This is important for queries otherwise the order of the columns in the answers may be arbitrary. The bug was mostly visible on Python 3 due to dictionnary implementation details.
@@ -322,6 +322,7 @@ class Z3Context(object): As it is used mainly for rules, the head is distinguished. """ variables = {} # type: Dict[str, z3.Const] + z3vars = [] def compile_expr(expr, translator): """Compiles an expression to Z3""" @@ -331,6 +332,7 @@ class Z3Context(object): return variables[name] var = Z3OPT.Const(name, translator.type()) variables[name] = var + z3vars.append(var) return var elif isinstance(expr, ast.ObjectConstant): return translator.to_z3(expr.name) @@ -366,7 +368,6 @@ class Z3Context(object): z3body = [compile_atom(atom) for atom in body] # We give back variables explicitely and do not rely on declare_var and # abstract. Otherwise rules are cluttered with useless variables. - z3vars = [v for v in six.itervalues(variables)] return (z3vars, z3head, z3body) def compile_rule(self, theory, rule):
Add GH code scanning with codeQL * Create codeql-analysis.yml * Update codeql-analysis.yml set permissions * Update stale.yml
@@ -4,6 +4,8 @@ on: schedule: - cron: "0 0 * * *" +permissions: read-all + jobs: stale:
Update noaa-s102.yaml Adding bucket browser link
@@ -23,6 +23,8 @@ Resources: ARN: arn:aws:s3:::noaa-s102-pds Region: us-east-1 Type: S3 Bucket + Explore: + - '[Browse Bucket](https://noaa-s102-pds.s3.amazonaws.com/index.html)' - Description: NOAA S-102 Bathymetric Surface New Object Notification ARN: arn:aws:sns:us-east-1:123901341784:NewS102Object Region: us-east-1
CompileCtx: enhance docstring a bit for symbol_literals TN:
@@ -468,14 +468,15 @@ class CompileCtx(object): pre-computed in each analysis context so that parsing and properties evaluation does not need to perform symbol table lookups for them. - Set set of such pre-computed symbols is stored in an array indexed by - an enumeration type. This holds a mapping: symbol text -> enumerator, - to be used for code generation. See the "Symbol_Literals" array in - $.Analysis.Analysis_Context_Type. + Set of such pre-computed symbols is stored in the generated library in + an array indexed by an enumeration type. Here, this holds a mapping: + symbol text -> enumerator, to be used for code generation. See the + "Symbol_Literals" array in $.Analysis.Analysis_Context_Type. This mapping is not supposed to be directly modified anywhere else than inside this CompileCtx class. See the add_symbol_literal method to add - symbols to this mapping. + symbols to this mapping. Note that this mapping will be empty until one + calls the finalize_symbol_literals method. :type: dict[str, names.Name] """
Turn off the rule RequireTestDocumentation in our repo We need to do more tweaking to which rules we care about in our own repo, but this at least gets the ball rolling and sets an example for how to configure the rules.
@@ -15,6 +15,8 @@ tasks: options: path: - cumulusci/robotframework + ignore: + - RequireTestDocumentation robot_libdoc: description: Generates html documentation for the Salesorce and CumulusCI libraries and resource files class_path: cumulusci.tasks.robotframework.RobotLibDoc
Update _normTufoProps to normalize property names by checking/ripping off form names and trailing colons. This allows for setTufoProps (and storm setprop operator) to accept full prop values and relative prop values when called using kwarg unpacking notation.
@@ -2207,6 +2207,14 @@ class Cortex(EventBus, DataModel, Runtime, Configable, s_ingest.IngestApi): valu = inprops.get(name) + if name.startswith(form): + # Possibly a full prop - strip name off + name = name[len(form):] + + if name.startswith(':'): + # Relative prop - strip and form + name = name[1:] + prop = form + ':' + name if not self._okSetProp(prop): inprops.pop(name, None)
add missing default value for LRScheduler.step() Summary: see also other type errors in and Pull Request resolved:
@@ -6,7 +6,7 @@ class _LRScheduler: def state_dict(self) -> dict: ... def load_state_dict(self, state_dict: dict) -> None: ... def get_lr(self) -> float: ... - def step(self, epoch: Optional[int]) -> None: ... + def step(self, epoch: Optional[int]=...) -> None: ... class LambdaLR(_LRScheduler): def __init__(self, optimizer: Optimizer, lr_lambda: float, last_epoch: int=...) -> None: ...
Update REQUEST-903.9003-NEXTCLOUD-EXCLUSION-RULES.conf Using the example as put in the comments, I get errors: the ID is a duplicate and the rule isn't parsed. I've chosen a new ID (not sure how this is normally done) and changed the configuration line to one that works for me.
# you put something like this in crs-setup.conf: # # SecRule REQUEST_FILENAME "@rx /(?:remote.php|index.php)/" \ -# "id:9003330,\ +# "id:9003600,\ # phase:1,\ # t:none,\ # nolog,\ # pass,\ -# tx.restricted_extensions='.bak/ .config/ .conf/'" +# setvar:'tx.restricted_extensions=.bak/ .config/ .conf/'" # # Large uploads can be modified with SecRequestBodyLimit. Or they # can be more controlled by using the following:
Add test for `--optimal` to `test_compare_sky` modified: pypeit/tests/test_scripts.py
@@ -335,10 +335,15 @@ def test_compare_sky(): sky_file = os.path.join(resource_filename('pypeit', 'data/sky_spec/'), 'sky_kastb_600.fits') - # Running in `test` mode + # Running in `test` mode for boxcar extraction pargs = scripts.compare_sky.CompareSky.parse_args([spec_file, sky_file, '--test']) scripts.compare_sky.CompareSky.main(pargs) + # Running in `test` mode for optimal extraction + pargs = scripts.compare_sky.CompareSky.parse_args([spec_file, sky_file, '--test', + '--optimal']) + scripts.compare_sky.CompareSky.main(pargs) + @cooked_required def test_collate_1d(tmp_path, monkeypatch):
[commands] Lazily fetch members in discord.Member converters This makes commands taking members mostly work transparently without much effort from the user.
@@ -122,13 +122,49 @@ class MemberConverter(IDConverter): .. versionchanged:: 1.5 Raise :exc:`.MemberNotFound` instead of generic :exc:`.BadArgument` + + .. versionchanged:: 1.5.1 + This converter now lazily fetches members from the gateway and HTTP APIs, + optionally caching the result if :attr:`.MemberCacheFlags.joined` is enabled. """ + async def query_member_named(self, guild, argument): + cache = guild._state._member_cache_flags.joined + if len(argument) > 5 and argument[-5] == '#': + username, _, discriminator = argument.rpartition('#') + members = await guild.query_members(username, limit=100, cache=cache) + return discord.utils.get(members, name=username, discriminator=discriminator) + else: + members = await guild.query_members(argument, limit=100, cache=cache) + return discord.utils.find(lambda m: m.name == argument or m.nick == argument, members) + + async def query_member_by_id(self, bot, guild, user_id): + ws = bot._get_websocket(shard_id=guild.shard_id) + cache = guild._state._member_cache_flags.joined + if ws.is_ratelimited(): + # If we're being rate limited on the WS, then fall back to using the HTTP API + # So we don't have to wait ~60 seconds for the query to finish + try: + member = await guild.fetch_member(user_id) + except discord.HTTPException: + return None + + if cache: + guild._add_member(member) + return member + + # If we're not being rate limited then we can use the websocket to actually query + members = await guild.query_members(limit=1, user_ids=[user_id], cache=cache) + if not members: + return None + return members[0] + async def convert(self, ctx, argument): bot = ctx.bot match = self._get_id_match(argument) or re.match(r'<@!?([0-9]+)>$', argument) guild = ctx.guild result = None + user_id = None if match is None: # not a mention... if guild: @@ -143,6 +179,15 @@ class MemberConverter(IDConverter): result = _get_from_guilds(bot, 'get_member', user_id) if result is None: + if guild is None: + raise MemberNotFound(argument) + + if user_id is not None: + result = await self.query_member_by_id(bot, guild, user_id) + else: + result = await self.query_member_named(guild, argument) + + if not result: raise MemberNotFound(argument) return result
Update ant_env.py Avoid falling into infinity
@@ -195,7 +195,7 @@ class AntClimbEnv(CameraRobotEnv): alive = float(self.robot.alive_bonus(self.robot.body_rpy[0], self.robot.body_rpy[1])) # state[0] is body height above ground (z - z initial), body_rpy[1] is pitch - done = self.nframe > 700 or alive < 0 + done = self.nframe > 700 or alive < 0 or self.robot.body_xyz[2] < 0 if not np.isfinite(state).all(): print("~INF~", state)
horizontal scroll on translation page ref
@@ -619,6 +619,10 @@ article { margin: 20px 0 40px 0; padding: 0; position: static; + + .selectbox-wrapper { + margin-bottom: 8px; + } } } } @@ -1044,6 +1048,9 @@ article { table { border: 1px solid #ddd; width: 100%; + color: #666; + font-size: 12px; + font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; } .from,
Redirect for trailing slash, fix url decoding * Request for `/problem/1234` turns to `/problem/1234/` * Set path in proxy_pass instead of rewrite so URLs are not decoded (e.g. `/problem/my%20path/file.css` no longer turns into `/problem/my%2520path/file.css`)
@@ -39,12 +39,15 @@ server { types { } default_type application/octet-stream; } + {% if (enable_shell_proxy|bool) -%} + location ~ /problem/(\d+)$ { + return 301 $scheme://{{ shell_hostname }}/problem/$1/; + } location ~ /problem/(\d+)/?(.*) { set $port $1; set $path $2; - rewrite ^.*$ /$path break; - proxy_pass http://127.0.0.1:$port; + proxy_pass http://127.0.0.1:$port/$path; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Update android_anubis.txt Fixing typo and alphabetic order.
@@ -2531,15 +2531,14 @@ http://52.247.252.64 /inj/a8.phpy /inj/a9.phpy /inj/fafa.php -/inj/in_axis.php -/inj/fafa.php /inj/grab1.php /inj/grab2.php /inj/grab3.php /inj/grab4.php /inj/grab5.php +/inj/in_axis.php /inj/xorx.php -/inj/zebapy.php +/inj/zebpay.php /injclientup/fafa.php /injectfull/ /kokojamba1212/
Add function to copy TIF metadata between images And remove merge markers
@@ -99,6 +99,27 @@ def classify_fpaths(prefix, fpaths, id_to_files, file_type): elif '-A1BS-' in fpath: id_to_files[prefix]['swir'][file_type] = fpath + +def copy_tif_info(in_fpath, out_fpath): + """ + Copy the TIF metadata from in_fpath and save it to the image at out_fpath. + :param in_fpath: Filepath for input image which has metadata to copy. + :type in_fpath: str + + :param out_fpath: Filepath for image to which we want to save the metadata. + :type out_fpath: str + """ + logging.info("---- Copying TIF information ----") + gdal_in = gdal.Open(in_fpath) + gdal_out = gdal.Open(out_fpath, gdal.GA_Update) + metadata_domains = gdal_in.GetMetadataDomainList() + for domain in metadata_domains: + dico = gdal_in.GetMetadata_Dict(domain) + for key, val in dico.items(): + gdal_out.SetMetadataItem(key, val, domain) + gdal_out.SetProjection(gdal_in.GetProjection()) + gdal_out.SetGeoTransform(gdal_in.GetGeoTransform()) + # Note: here are the AOI boundaries for the current AOIs # D1: 747285 747908 4407065 4407640 # D2: 749352 750082 4407021 4407863 @@ -229,6 +250,7 @@ def main(config_fpath): orthorectify.main(cmd_args) files['pan']['ortho_img_fpath'] = pan_ortho_img_fpath + copy_tif_info(pan_ntf_fpath, pan_ortho_img_fpath) # Orthorectify the msi images msi_ntf_fpath = files['msi']['image'] @@ -242,6 +264,7 @@ def main(config_fpath): orthorectify.main(cmd_args) files['msi']['ortho_img_fpath'] = msi_ortho_img_fpath + copy_tif_info(msi_ntf_fpath, msi_ortho_img_fpath) # # Note: we may eventually select a subset of input images # on which to run this and the following steps @@ -272,6 +295,7 @@ def main(config_fpath): if angle < lowest_angle: lowest_angle = angle most_nadir_collection_id = collection_id + copy_tif_info(ortho_pan_fpath, pansharpened_output_image) ############################################# # Convert to 8-bit RGB
Use integer format fo text trees if positions are integers As we do for the SVG format. This is useful now that msprime.sim_ancestry defaults to integer breakpoints.
@@ -1490,17 +1490,17 @@ class TextTreeSequence: self.ts = ts time_label_format = "{:.2f}" if time_label_format is None else time_label_format - position_label_format = ( - "{:.2f}" if position_label_format is None else position_label_format - ) + tick_labels = ts.breakpoints(as_array=True) + if position_label_format is None: + integer_ticks = np.all(np.round(tick_labels) == tick_labels) + label_precision = 0 if integer_ticks else 2 + position_label_format = f"{{:.{label_precision}f}}" time = ts.tables.nodes.time time_scale_labels = [ time_label_format.format(time[u]) for u in range(ts.num_nodes) ] - position_scale_labels = [ - position_label_format.format(x) for x in ts.breakpoints() - ] + position_scale_labels = [position_label_format.format(x) for x in tick_labels] trees = [ VerticalTextTree( tree,
always use local influxdb for monitoring HG-- branch : feature/microservices
## Multiple URLs from which to read InfluxDB-formatted JSON urls = [ - "http://{{influx_host}}:{{ influxdb_port }}/debug/vars" + "http://127.0.0.1:{{ influxdb_port }}/debug/vars" ]
Allows use of inline powershell for cmd.script args Fixes
@@ -344,7 +344,7 @@ def _run(cmd, # The last item in the list [-1] is the current method. # The third item[2] in each tuple is the name of that method. if stack[-2][2] == 'script': - cmd = 'Powershell -NonInteractive -NoProfile -ExecutionPolicy Bypass -File ' + cmd + cmd = 'Powershell -NonInteractive -NoProfile -ExecutionPolicy Bypass {0}'.format(cmd.replace('"', '\\"')) elif encoded_cmd: cmd = 'Powershell -NonInteractive -EncodedCommand {0}'.format(cmd) else:
Update asr.sh Make calculate_rtf.py work with espnet2
@@ -1242,7 +1242,8 @@ if ! "${skip_eval}"; then # 2. Submit decoding jobs log "Decoding started... log: '${_logdir}/asr_inference.*.log'" - # shellcheck disable=SC2046,SC2086 + rm -f "${_logdir}/*.log" + # shellcheck disable=SC2086 ${_cmd} --gpu "${_ngpu}" JOB=1:"${_nj}" "${_logdir}"/asr_inference.JOB.log \ ${python} -m ${asr_inference_tool} \ --batch_size ${batch_size} \ @@ -1254,7 +1255,12 @@ if ! "${skip_eval}"; then --output_dir "${_logdir}"/output.JOB \ ${_opts} ${inference_args} || { cat $(grep -l -i error "${_logdir}"/asr_inference.*.log) ; exit 1; } - # 3. Concatenates the output files from each jobs + # 3. Calculate and report RTF based on decoding logs + log "Calculating RTF & latency ... log: '${_logdir}/calculate_rtf.log'" + ../../../utils/calculate_rtf.py --log-dir ${_logdir} \ + --log-name "asr_inference" >"${_logdir}/calculate_rtf.log" + + # 4. Concatenates the output files from each jobs for f in token token_int score text; do if [ -f "${_logdir}/output.1/1best_recog/${f}" ]; then for i in $(seq "${_nj}"); do
lnworker: also check expiring_htlcs in ChannelState.SHUTDOWN otherwise the remote could intentionally send "shutdown" during an attack
@@ -971,7 +971,8 @@ class LNWallet(LNWorker): util.trigger_callback('channel', self.wallet, chan) return - if chan.get_state() == ChannelState.OPEN and chan.should_be_closed_due_to_expiring_htlcs(self.network.get_local_height()): + if (chan.get_state() in (ChannelState.OPEN, ChannelState.SHUTDOWN) + and chan.should_be_closed_due_to_expiring_htlcs(self.network.get_local_height())): self.logger.info(f"force-closing due to expiring htlcs") await self.schedule_force_closing(chan.channel_id)
Updated "DE" zones.json most of the sources are updated with the source from Fraunhofer ISE (https://energy-charts.info/charts/installed_power/chart.htm?l=de&c=DE&year=2020&interval=year&stacking=grouped) The source is already mentioned in the DATA_SOURCES.md file. And I'm already on the list of contributors :) geothermal was updated with the source from entsoe.eu wich is also mentioned in the DATA_SOURCES.md
] ], "capacity": { - "biomass": 8210, + "biomass": 8240, "coal": 43490, "gas": 29930, - "geothermal": 42, - "hydro": 4780, + "geothermal": 47, + "hydro": 4790, "hydro storage": 9810, "nuclear": 8114, "oil": 4360, - "solar": 51990, + "solar": 53580, "unknown": 3700, - "wind": 61880 + "wind": 62380 }, "contributors": [ "https://github.com/corradio",
Code Style Updates Updated the to conform with the line ends expected by the code style in tests rather than PyCharm.
@@ -589,9 +589,8 @@ def dao_fetch_monthly_historical_usage_by_template_for_service(service_id, year) for today_result in today_results: add_to_stats = True for stat in stats: - if today_result.template_id == stat.template_id and \ - today_result.month == stat.month and \ - today_result.year == stat.year: + if today_result.template_id == stat.template_id and today_result.month == stat.month \ + and today_result.year == stat.year: stat.count = stat.count + today_result.count add_to_stats = False
Remove title The title takes too much room on mobile screens
![](docs/jupytext_word_cloud.png) -# Jupyter Notebooks as Markdown Documents, Julia, Python or R Scripts - [![Build Status](https://travis-ci.com/mwouts/jupytext.svg?branch=master)](https://travis-ci.com/mwouts/jupytext) [![Documentation Status](https://readthedocs.org/projects/jupytext/badge/?version=latest)](https://jupytext.readthedocs.io/en/latest/?badge=latest) [![codecov.io](https://codecov.io/github/mwouts/jupytext/coverage.svg?branch=master)](https://codecov.io/github/mwouts/jupytext?branch=master)
Importer: Manage KHR_materials_unit for 2.79 Using Light Path "Is camera Ray"
@@ -53,6 +53,7 @@ class BlenderPbr(): elif nodetype == "unlit": if bpy.app.version < (2, 80, 0): main_node = node_tree.nodes.new('ShaderNodeEmission') + main_node.location = 750, -300 else: main_node = node_tree.nodes.new('ShaderNodeBackground') main_node.location = 0, 0 @@ -290,4 +291,17 @@ class BlenderPbr(): node_tree.links.new(metallic_text.inputs[0], metallic_mapping.outputs[0]) # link node to output + if bpy.app.version < (2, 80, 0): + if nodetype == 'principled': + node_tree.links.new(output_node.inputs[0], main_node.outputs[0]) + elif nodetype == 'unlit': + mix = node_tree.nodes.new('ShaderNodeMixShader') + mix.location = 1000, 0 + path = node_tree.nodes.new('ShaderNodeLightPath') + path.location = 750, 300 + + node_tree.links.new(output_node.inputs[0], mix.outputs[0]) + node_tree.links.new(mix.inputs[2], main_node.outputs[0]) + node_tree.links.new(mix.inputs[0], path.outputs[0]) + else: node_tree.links.new(output_node.inputs[0], main_node.outputs[0])
Update task.py fixed a simple bug
@@ -57,7 +57,7 @@ class ArithmeticTask(task.Task): b = np.random.randint(10**difficulty) correct = False problem = str(a) + ' + ' + str(b) + ' = ' - result = text_generation_fn(problem) + response = text_generation_fn(problem) # Regex post-processing to capture expected output type. result = re.findall(r'[-+]?\d+', response)[0] if result == str(a + b):
Update test_compute_flow.py - properly label what's happening Note: this text is generated here: So they need to be in line. I just updated that file.
@@ -300,7 +300,7 @@ def run_compute_test( log_file = ocean_instance.compute.compute_job_result_logs( dataset_and_userdata.asset, service, job_id, consumer_wallet, "algorithmLog" ) - assert "Applying Gaussian processing." in str(log_file[0]) + assert "Building Gaussian Process Regressor (GPR) model" in str(log_file[0]) print(f"got algo log file: {str(log_file)}") result = ocean_instance.compute.result(
Role-spec NovaComputeStartupDelay Make it role-specific for other compute roles, like HCI, to work with it Follow-up
@@ -100,6 +100,8 @@ parameters: type: number constraints: - range: { min: 0, max: 600 } + tags: + - role_specific EnableInstanceHA: default: false description: Whether to enable an Instance Ha configuration or not. @@ -859,8 +861,13 @@ conditions: not: {equals: [{get_param: AuthCloudName}, ""]} compute_startup_delay: and: - - not: {equals: [{get_param: NovaComputeStartupDelay}, 0]} - not: {get_param: EnableInstanceHA} + - not: + and: + - {equals: [{get_param: NovaComputeStartupDelay}, 0]} + - or: + - {equals: [{get_param: [RoleParameters, NovaComputeStartupDelay]}, 0]} + - {equals: [{get_param: [RoleParameters, NovaComputeStartupDelay]}, '']} libvirt_file_backed_memory_enabled: #not (P = 0 and (R = 0 or R = ")) not: @@ -981,6 +988,7 @@ resources: nova::compute::libvirt::cpu_models: NovaLibvirtCPUModels nova::compute::libvirt::cpu_model_extra_flags: NovaLibvirtCPUModelExtraFlags nova_compute_opt_volumes: NovaComputeOptVolumes + nova_compute_startup_delay: NovaComputeStartupDelay nova_compute_opt_env_vars: NovaComputeOptEnvVars nova::workarounds::never_download_image_if_on_rbd: NovaDisableImageDownloadToRbd nova::compute::image_type_exclude_list: NovaImageTypeExcludeList @@ -1084,6 +1092,7 @@ resources: NovaLibvirtCPUModels: {get_param: NovaLibvirtCPUModels} NovaLibvirtCPUModelExtraFlags: {get_param: NovaLibvirtCPUModelExtraFlags} NovaComputeOptVolumes: {get_param: NovaComputeOptVolumes} + NovaComputeStartupDelay: {get_param: NovaComputeStartupDelay} NovaComputeOptEnvVars: {get_param: NovaComputeOptEnvVars} NovaDisableImageDownloadToRbd: {get_param: NovaDisableImageDownloadToRbd} NovaImageTypeExcludeList: {get_param: NovaImageTypeExcludeList} @@ -1268,7 +1277,7 @@ outputs: - compute_startup_delay - str_replace: template: '/var/lib/nova/delay-nova-compute --delay DELAY --nova-binary' - params: { DELAY: {get_param: NovaComputeStartupDelay} } + params: { DELAY: {get_attr: [RoleParametersValue, value, nova_compute_startup_delay]} } - if: - {get_param: EnableInstanceHA} - /var/lib/nova/instanceha/check-run-nova-compute @@ -1573,7 +1582,7 @@ outputs: when: "'compute_instanceha' in service_names" - name: Do we prepend nova startup with a delay set_fact: - nova_compute_delay: {get_param: NovaComputeStartupDelay} + nova_compute_delay: {get_attr: [RoleParametersValue, value, nova_compute_startup_delay]} - name: install nova-compute delay wrapper script copy: content: {get_file: ../../scripts/delay-nova-compute}
Reduce the number of days an issue is stale by 25 As we ease into a more reasonable `daysUntilStale` value, this updates the time an issue will be marked as stale to about 3 years and 4 months.
# Probot Stale configuration file # Number of days of inactivity before an issue becomes stale -# 1250 is approximately 3 years and 5 months -daysUntilStale: 1250 +# 1225 is approximately 3 years and 4 months +daysUntilStale: 1225 # Number of days of inactivity before a stale issue is closed daysUntilClose: 7
Simplify unnecessary nesting, casting and constant values in f-strings(simplify-fstring-formatting) Replace unused for index with underscore(for-index-underscore)
@@ -114,7 +114,7 @@ class Optimizer(ABC): length = int(self.population_size / self.cpu_cores) progressbar = Progressbar(length) - for i in range(length): + for _ in range(length): people = [] with Manager() as manager: dna_bucket = manager.list([]) @@ -138,7 +138,7 @@ class Optimizer(ABC): for w in workers: w.join() if w.exitcode > 0: - logger.error(f'a process exited with exitcode: {str(w.exitcode)}') + logger.error(f'a process exited with exitcode: {w.exitcode}') except exceptions.Termination: self._handle_termination(manager, workers)
FieldAccessExpr: switch to BasicExpr's requires_incref feature TN:
@@ -2818,17 +2818,11 @@ class FieldAccessExpr(BasicExpr): super(FieldAccessExpr, self).__init__( 'Fld', '{}.{}', result_type, [NullCheckExpr(prefix_expr, result_var_name='Pfx'), field_name], + requires_incref=do_explicit_incref, abstract_expr=abstract_expr, ) self.prefix_expr = prefix_expr self.field_name = field_name - self.do_explicit_incref = do_explicit_incref - - def render_pre(self): - result = super(FieldAccessExpr, self).render_pre() - return ('{}\nInc_Ref ({});'.format(result, self.result_var.name) - if self.do_explicit_incref and self.type.is_refcounted() else - result) @property def subexprs(self):
Change the downgrade of the execution_status enum * Unfortunately postgres doesn't directly support removing enum values, so we create a new type with the correct enum values and swap out the old one * The previous approch required access to the pg_enum table which our user (cloudify) doesn't have
@@ -7,6 +7,7 @@ Create Date: 2018-04-03 14:31:11.832546 """ from alembic import op import sqlalchemy as sa +from sqlalchemy.dialects import postgresql from manager_rest.storage.models_base import UTCDateTime # revision identifiers, used by Alembic. @@ -65,14 +66,30 @@ def downgrade(): set status='failed' where status='kill_cancelling' """) + # unfortunately postgres doesn't directly support removing enum values, - # so we need to resort to changing pg_enum directly - op.execute(""" - delete from pg_enum - where - enumtypid=( - select oid from pg_catalog.pg_type - where typname='execution_status' + # so we create a new type with the correct enum values and swap + # out the old one + op.execute("alter type execution_status rename to execution_status_old") + + # create the new type + execution_status = sa.Enum( + 'terminated', + 'failed', + 'cancelled', + 'pending', + 'started', + 'cancelling', + 'force_cancelling', + name='execution_status', ) - and enumlabel='kill_cancelling' - """) + execution_status.create(op.get_bind()) + + # update executions to use the new type + op.alter_column('executions', + 'status', + type_=execution_status, + postgresql_using='status::text::execution_status') + + # remove the old type + op.execute("DROP TYPE execution_status_old;")
Update Arduino_Code.ino Changing the while to if on the main loop. Since it's already on the main loop there is no need for a while. The while implementation uses a little bit more lines of code (assembly).
@@ -86,7 +86,7 @@ String get_DUCOID() { // Infinite loop void loop() { // Wait for serial data - while (Serial.available() > 0) { + if (Serial.available() > 0) { memset(job, 0, job_maxsize); // Read last block hash lastblockhash = Serial.readStringUntil(',');
use subtraction instead of or If we use or, we will get minions that are in the ret list, but not connected to the master in cases where the syndic is used.
@@ -738,7 +738,7 @@ class LocalClient(object): ret[mid] = (data if full_return else data.get('ret', {})) - for failed in list(set(pub_data['minions']) ^ set(ret)): + for failed in list(set(pub_data['minions']) - set(ret)): ret[failed] = False return ret finally:
Update readsettings.py switch exception order
@@ -939,10 +939,10 @@ class ReadSettings: fp = open(cfgfile, "w") config.write(fp) fp.close() - except IOError: - self.log.exception("Error writing to autoProcess.ini.") except PermissionError: self.log.exception("Error writing to autoProcess.ini due to permissions.") + except IOError: + self.log.exception("Error writing to autoProcess.ini.") def migrateFromOld(self, config, configFile): if config.has_section("MP4"):
Fix more Python 3 issues in run_sk_stress_test I only discovered these when running with Python 3.9 (they passed with Python 3.8).
@@ -326,9 +326,9 @@ class StressTesterRunner(object): return not self.compat_runner_failed with open(results_path, 'r') as results_file: - results = json.load(results_file, encoding='utf-8') + results = json.load(results_file) with open(xfails_path, 'r') as xfails_file: - xfails = json.load(xfails_file, encoding='utf-8') + xfails = json.load(xfails_file) xfails_not_processed = [] for xfail in xfails: @@ -340,7 +340,7 @@ class StressTesterRunner(object): xfails_not_processed.append(xfail) num_failures = len(results['issues']) - num_xfails = sum(len(value) for _, value in results['expectedIssues'].iteritems()) + num_xfails = sum(len(value) for _, value in results['expectedIssues'].items()) num_xfail_issues = len(results['expectedIssues']) unmatched = results['unmatchedExpectedIssues'] @@ -348,7 +348,7 @@ class StressTesterRunner(object): if num_xfails > 0: print('Expected stress tester issues:') - for url, issues in results['expectedIssueMessages'].iteritems(): + for url, issues in results['expectedIssueMessages'].items(): for (index, issue) in enumerate(issues): self._print_issue(index, issue, url) print('\n========================================')
fix: Avoid ConfigParser squashing When adding values to a ConfigParser, everything gets squashed into a string. Avoid this by preserving the Python object as a whole.
@@ -87,8 +87,10 @@ def extract_formats(config_handle): return formats -def load_dynamic_config(configurations, config_dir=getcwd()): +def load_dynamic_config(config_dir=getcwd()): """Load and parse dynamic config""" + dynamic_configurations = {} + # Create full path of config config_file = '{path}/config.py'.format(path=config_dir) @@ -97,14 +99,12 @@ def load_dynamic_config(configurations, config_dir=getcwd()): try: config_module = __import__('config') - for key, value in config_module.CONFIG.items(): - LOG.debug('Importing %s with key %s', key, value) - # Update configparser object - configurations.update({key: value}) + dynamic_configurations = config_module.CONFIG except ImportError: # Provide a default if config not found LOG.error('ImportError: Unable to load dynamic config. Check config.py file imports!') - configurations = {} + + return dynamic_configurations def find_config(): @@ -130,7 +130,7 @@ def find_config(): LOG.info('Loading static configuration file.') elif exists(dynamic_config_file): LOG.info('Loading dynamic configuration file.') - load_dynamic_config(configurations) + configurations = load_dynamic_config() else: config_locations.append(dynamic_config_file) LOG.warning('No configuration found in the following locations:\n%s', '\n'.join(config_locations))
Add __gt__ and __lt__ overrides for TagBase. Fixes an incompatibility with django-modelcluster and, by extension, Wagtail. Currently untested, just committing the change to 'save' it.
@@ -27,6 +27,12 @@ class TagBase(models.Model): def __str__(self): return self.name + def __gt__(self, other): + return self.name > other.name + + def __lt__(self, other): + return self.name < other.name + class Meta: abstract = True
fix silent failure on Windows builds Summary: Closes Remove backticks that are being interpreted by the shell. Add -e option to bash script to avoid future such failures Pull Request resolved:
-#!/bin/bash +#!/bin/bash -e COMPACT_JOB_NAME=pytorch-win-ws2016-cuda9-cudnn7-py3-test source "$(dirname "${BASH_SOURCE[0]}")/common.sh" @@ -75,7 +75,7 @@ set PYTHONPATH=%TMP_DIR_WIN%\\build;%PYTHONPATH% if NOT "%BUILD_ENVIRONMENT%"=="" ( cd %TMP_DIR_WIN%\\build python %TMP_DIR_WIN%\\ci_scripts\\download_image.py %TMP_DIR_WIN%\\%IMAGE_COMMIT_TAG%.7z - :: 7z: `-aos` skips if exists because this .bat can be called multiple times + :: 7z: -aos skips if exists because this .bat can be called multiple times 7z x %TMP_DIR_WIN%\\%IMAGE_COMMIT_TAG%.7z -aos cd %WORKING_DIR% ) else (
Changing upgrade database engine button label The button was not showing the current version on databaseinfra.engine_patch
<a href="{{ database.get_upgrade_retry_url }}" class="btn btn-warning" title="Retry upgrade" onclick="return confirm('Are you sure?')">Retry upgrade {{ database.infra.engine_name }} {{ database.infra.plan.engine.version}} to {{ database.infra.plan.engine_equivalent_plan.engine.version }}</a> <p><a href="{% url 'admin:maintenance_databaseupgrade_change' last_upgrade.id %}" target='_blank'>Last upgrade</a> has an <b>error</b>, please check the <a href="{% url 'admin:notification_taskhistory_change' last_upgrade.task.id %}" target='_blank'>task</a> and retry the database upgrade clicking in button above</p> {% else %} - <a href="{{ database.get_upgrade_url }}" class="btn btn-primary" title="Start upgrade" onclick="return confirm('Are you sure?')">Upgrade {{ database.infra.engine_name }} {{database.infra.plan.engine.version }} to {{ database.infra.plan.engine_equivalent_plan.engine.version }}</a> + <a href="{{ database.get_upgrade_url }}" class="btn btn-primary" title="Start upgrade" onclick="return confirm('Are you sure?')">Upgrade {{ database.infra.engine_name }} {{database.infra.engine_patch.full_version }} to {{ database.infra.plan.engine_equivalent_plan.engine.version }}</a> {% endif %} </div> </div>
updater: remove magic number Remove the magic number, a whence value of 2 for file.seek(), and instead use the io.SEEK_END constant from the io module.
@@ -128,6 +128,7 @@ import time import fnmatch import copy import warnings +import io import tuf import tuf.download @@ -1245,9 +1246,7 @@ class Updater(object): None. """ - # seek to the end of the file; that is offset 0 from the end of the file, - # represented by a whence value of 2 - file_object.seek(0, 2) + file_object.seek(0, io.SEEK_END) observed_length = file_object.tell() # Return and log a message if the length 'file_object' is equal to
remove a "is" When I translated in Chinese, I found a needless "is"
@@ -657,7 +657,7 @@ SitemapSpider .. attribute:: sitemap_follow - A list of regexes of sitemap that should be followed. This is is only + A list of regexes of sitemap that should be followed. This is only for sites that use `Sitemap index files`_ that point to other sitemap files.
Prepare 2.11.0rc6. [ci skip-rust]
# 2.11.x Release Series +## 2.11.0rc6 (Apr 30, 2022) + +### User API Changes + +* Upgrade Pex to 2.1.84. (Cherry-picks of #15200, #15281 & #15288) ([#15289](https://github.com/pantsbuild/pants/pull/15289)) + +### Bug fixes + +* Memoize equality for `CoarsenedTarget(s)` to avoid exponential runtime in `check`. (Cherry-pick of #15277) ([#15278](https://github.com/pantsbuild/pants/pull/15278)) + ## 2.11.0rc5 (Apr 26, 2022) ### Bug fixes
Prepare 2.6.1rc0. [ci skip-rust]
# 2.6.x Stable Releases +## 2.6.1rc0 (Aug 06, 2021) + +### New Features + +* Add `skip_tests` field to `python_tests` to facilitate incremental migrations (Cherry-pick of #12510) ([#12511](https://github.com/pantsbuild/pants/pull/12511)) + +* Adds support for Poetry group dependencies (Cherry-pick of #12492) ([#12497](https://github.com/pantsbuild/pants/pull/12497)) + +### User API Changes + +* Add to default module mapping: Django extensions, Google Cloud, Pillow, and python-dotenv (Cherry-pick of #12506) ([#12507](https://github.com/pantsbuild/pants/pull/12507)) + +### Bug fixes + +* Make the pantsd crash error message more precise. (#12512) ([#12513](https://github.com/pantsbuild/pants/pull/12513)) + +* Resolve plugins using the PEX --python option. (cherrypick of #12500) ([#12504](https://github.com/pantsbuild/pants/pull/12504)) + +* Shield isolated-Sessions / StreamingWorkunitHandlers from Ctrl+C. (cherrypick of #12483) ([#12485](https://github.com/pantsbuild/pants/pull/12485)) + +### Performance + +* Don't resolve constraints file / lockfile if no 3rd-party requirements used (Cherry-pick of #12488) ([#12490](https://github.com/pantsbuild/pants/pull/12490)) + ## 2.6.0 (Jul 30, 2021) The first stable release of the `2.6.x` series, with no changes since the previous `rc`!
improve plugin name to differ from the new 'Versions Loaded in Scene' plugin
@@ -10,7 +10,7 @@ class CollectSceneVersion(pyblish.api.ContextPlugin): """ order = pyblish.api.CollectorOrder - label = 'Collect Version' + label = 'Collect Scene Version' hosts = [ "aftereffects", "blender",
options: add link to help page Ref
{% set active_page = 'options' %} {% block content %} - <h2>{{ _('fava: options') }}</h2> + <h2>{{ _('Fava options') }} <a href="{{ url_for('help_page', page_slug='options') }}">({{ _('help') }})</a></h2> <table class="options sortable"> <thead> <tr> {% endfor %} </tbody> </table> - <h2>{{ _('beancount: options') }}</h2> + <h2>{{ _('Beancount options') }}</h2> <table class="options sortable"> <thead> <tr>
Fix regexes in yaml-validate.py with python 3.8 In Python 3.8, the re module no longer escapes various characters (such as ; or /), as opposed to python 3.6. Update various regexes in yaml-validate.py to match patterns as expected for all python versions. Closes-Bug:
@@ -1034,7 +1034,7 @@ def validate_service_hiera_interpol(f, tpl): # name. The only exception is allow anything under # str_replace['params'] ('str_replace;params' in the str notation). # We need to escape because of '$' char may be in templated params. - query = re.compile(r'\\;str(\\)?_replace\\;params\\;\S*?net', + query = re.compile(r'(\\)?;str(\\)?_replace(\\)?;params(\\)?;\S*?net', re.IGNORECASE) if not query.search(re.escape(path_str)): # Keep parsing, if foo_vip_network, or anything @@ -1046,7 +1046,7 @@ def validate_service_hiera_interpol(f, tpl): # Omit mappings in tht, like: # [NetXxxMap, <... ,> {get_param: [ServiceNetMap, ... - if re.search(r'Map.*get\\_param', re.escape(path_str)): + if re.search(r'Map.*get(\\)?_param', re.escape(path_str)): continue # For the remaining cases, verify if there is a template
Lock graph_task before writing leaf_streams. Summary: Pull Request resolved: Fixes Test Plan: Imported from OSS
@@ -562,6 +562,7 @@ void Engine::evaluate_function( // Records leaf stream (if applicable) // See note "Streaming backwards" if (opt_parent_stream) { + std::lock_guard<std::mutex> lock(graph_task->mutex_); graph_task->leaf_streams.emplace(*opt_parent_stream); } return;
Use datetime type for timestamps columns This aligns the created_at and updated_at columns to have the same column type as deleted_at
@@ -337,9 +337,9 @@ class Blueprint: Returns: self """ - self.timestamp("created_at", nullable=True, now=True) + self.datetime("created_at", nullable=True, now=True) - self.timestamp("updated_at", nullable=True, now=True) + self.datetime("updated_at", nullable=True, now=True) return self
always add nginx headers HG-- branch : feature/microservices
@@ -116,8 +116,8 @@ server { ssl_certificate_key {{ nginx_ssl_key_path }}; add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"; add_header X-Content-Type-Options nosniff; - add_header X-Backend-Server $upstream_addr; - add_header X-Front-Server $hostname; + add_header X-Backend-Server $upstream_addr always; + add_header X-Front-Server $hostname always; ssl_stapling on; ssl_stapling_verify on;
`prettytable`: Fix stubtest errors Fixes A partial revert of
from _typeshed import Incomplete from html.parser import HTMLParser from typing import Any -from typing_extensions import Literal, TypedDict FRAME: int ALL: int @@ -17,8 +16,6 @@ SINGLE_BORDER: int DOUBLE_BORDER: int BASE_ALIGN_VALUE: str -class _EmptyDictionary(TypedDict): ... - class PrettyTable: encoding: Any def __init__(self, field_names: Any | None = ..., **kwargs): ... @@ -202,19 +199,13 @@ class PrettyTable: def xhtml(self, val: bool) -> None: ... @property def rows(self) -> list[Incomplete]: ... - @property - def header_align(self) -> dict[str, str]: ... - @header_align.setter - def header_align(self, val: Literal["l", "c", "r"] | _EmptyDictionary | None) -> None: ... def add_autoindex(self, fieldname: str = ...): ... def get_latex_string(self, **kwargs) -> str: ... def set_style(self, style) -> None: ... def add_rows(self, rows) -> None: ... def add_row(self, row) -> None: ... def del_row(self, row_index) -> None: ... - def add_column( - self, fieldname, column, align: str = ..., valign: str = ..., header_align: Literal["l", "c", "r"] = ... - ) -> None: ... + def add_column(self, fieldname, column, align: str = ..., valign: str = ...) -> None: ... def del_column(self, fieldname) -> None: ... def clear_rows(self) -> None: ... def clear(self) -> None: ...
Cleaning the exceptions trackback in linux_lvm.py pvcreate and pvremove from linux_lvm execution module raises a trackback when they should fail graciously. Initial work to remove the trackbacks and substitute then with clean failures.
@@ -10,7 +10,6 @@ import os.path # Import salt libs import salt.utils.path -from salt.exceptions import CommandExecutionError from salt.ext import six # Set up logger @@ -251,13 +250,11 @@ def pvcreate(devices, override=True, force=True, **kwargs): for device in devices: if not os.path.exists(device): - raise CommandExecutionError("{0} does not exist".format(device)) + return "{0} does not exist".format(device) if not pvdisplay(device, quiet=True): cmd.append(device) elif not override: - raise CommandExecutionError( - 'Device "{0}" is already an LVM physical volume.'.format(device) - ) + return 'Device "{0}" is already an LVM physical volume.'.format(device) if not cmd[2:]: # All specified devices are already LVM volumes @@ -275,7 +272,7 @@ def pvcreate(devices, override=True, force=True, **kwargs): "labelsector", "setphysicalvolumesize", ) - no_parameter = ("force", "norestorefile") + no_parameter = "norestorefile" for var in kwargs: if kwargs[var] and var in valid: cmd.extend(["--{0}".format(var), kwargs[var]]) @@ -284,12 +281,12 @@ def pvcreate(devices, override=True, force=True, **kwargs): out = __salt__["cmd.run_all"](cmd, python_shell=False) if out.get("retcode"): - raise CommandExecutionError(out.get("stderr")) + return out.get("stderr") # Verify pvcreate was successful for device in devices: if not pvdisplay(device): - raise CommandExecutionError('Device "{0}" was not affected.'.format(device)) + return 'Device "{0}" was not affected.'.format(device) return True @@ -321,7 +318,7 @@ def pvremove(devices, override=True, force=True): if pvdisplay(device): cmd.append(device) elif not override: - raise CommandExecutionError("{0} is not a physical volume".format(device)) + return "{0} is not a physical volume".format(device) if not cmd[2:]: # Nothing to do @@ -329,12 +326,12 @@ def pvremove(devices, override=True, force=True): out = __salt__["cmd.run_all"](cmd, python_shell=False) if out.get("retcode"): - raise CommandExecutionError(out.get("stderr")) + return out.get("stderr") # Verify pvremove was successful for device in devices: if pvdisplay(device, quiet=True): - raise CommandExecutionError('Device "{0}" was not affected.'.format(device)) + return 'Device "{0}" was not affected.'.format(device) return True
Add key_filename parameter to SSHChannel This forwards along the ssh key_filename to Paramiko, allowing clients to pass along their keyfile if they don't want to use user name password or rely on ~/.ssh being in its usual spot.
@@ -26,7 +26,7 @@ class SSHChannel(Channel, RepresentationMixin): ''' - def __init__(self, hostname, username=None, password=None, script_dir=None, envs=None, gssapi_auth=False, skip_auth=False, port=22): + def __init__(self, hostname, username=None, password=None, script_dir=None, envs=None, gssapi_auth=False, skip_auth=False, port=22, key_filename=None): ''' Initialize a persistent connection to the remote system. We should know at this point whether ssh connectivity is possible @@ -40,6 +40,7 @@ class SSHChannel(Channel, RepresentationMixin): - script_dir (string) : Full path to a script dir where generated scripts could be sent to. - envs (dict) : A dictionary of environment variables to be set when executing commands + - key_filename (string or list): the filename, or list of filenames, of optional private key(s) Raises: ''' @@ -51,6 +52,7 @@ class SSHChannel(Channel, RepresentationMixin): self.script_dir = script_dir self.skip_auth = skip_auth self.gssapi_auth = gssapi_auth + self.key_filename = key_filename if self.skip_auth: self.ssh_client = NoAuthSSHClient() @@ -72,6 +74,7 @@ class SSHChannel(Channel, RepresentationMixin): allow_agent=True, gss_auth=gssapi_auth, gss_kex=gssapi_auth, + key_filename=key_filename ) t = self.ssh_client.get_transport() self.sftp_client = paramiko.SFTPClient.from_transport(t)
BUG: md5 tests failing on bitbucket pipelines, skip on linux for now [CHANGED] this is due to platform specific handling of line-endings is my bet. A problem with scitrack (I'm the dev on that project), not cogent3.
@@ -103,6 +103,9 @@ class DataStoreBaseTests: got = {l: s for l, s in MinimalFastaParser(data)} self.assertEqual(got, expect) + # todo not really bnroken, but something to do with line-feeds I + # suspect. This means scitrack needs a more platform robust approach... + @unittest.skipIf(sys.platform.lower() != 'darwin', 'broken on linux') def test_md5_read(self): """tracks md5 checksums of read data""" dstore = self.ReadClass(self.basedir, suffix='.fasta') @@ -126,6 +129,7 @@ class DataStoreBaseTests: got = dstore.read(abs_id) self.assertEqual(got, expect) + @unittest.skipIf(sys.platform.lower() != 'darwin', 'broken on linux') def test_md5_write(self): """tracks md5 sums of written data""" with open('data/brca1.fasta') as infile:
Update test_fetchers_facade_data.py Fix box definitions to find data from all sources and modes
@@ -159,7 +159,7 @@ class Test_Facade: dsh = fetcher.plot(ptype='qc_altimetry', embed='slide') assert isinstance(dsh(0), IPython.display.Image) - # Test invalid plot + # Test invalid plot name with pytest.raises(ValueError): fetcher.plot(ptype='invalid_cat', with_seaborn=ws) @@ -182,8 +182,8 @@ class Test_DataFetching: args["float"] = [[2901623], [2901623, 6901929]] args["profile"] = [[2901623, 12], [2901623, np.arange(12, 14)], [6901929, [1, 6]]] args["region"] = [ - [-65.1, -65, 35.1, 36., 0, 10.0], - [-65.4, -65, 35.1, 36., 0, 10.0, "2013-01-01", "2013-09-01"], + [12.181, 13.459, -40.416, -39.444, 0.0, 1014.0], + [12.181, 17.459, -40.416, -34.444, 0.0, 2014.0, '2008-06-07', '2008-09-06'], ] def test_profile_from_float(self): @@ -240,7 +240,7 @@ class Test_DataFetching: def test_float_argovis(self): self.__test_float("argovis") - @requires_ftp + @requires_connected_gdac @safe_to_server_errors def test_float_ftp(self): self.__test_float("ftp") @@ -261,7 +261,7 @@ class Test_DataFetching: def test_profile_argovis(self): self.__test_profile("argovis") - @requires_ftp + @requires_connected_gdac @safe_to_server_errors def test_profile_ftp(self): self.__test_profile("ftp") @@ -282,7 +282,7 @@ class Test_DataFetching: def test_region_argovis(self): self.__test_region("argovis") - @requires_ftp + @requires_connected_gdac @safe_to_server_errors def test_region_ftp(self): self.__test_region("ftp")
Request a test experiment Request an experiment to test the recent changes.
# Please add new experiment requests towards the top of this file. # + +- experiment: 2023-01-27-test-request + description: "Test if the new system can run experiments by online request." + fuzzers: + - aflplusplus + - centipede + - honggfuzz + - libfuzzer + - experiment: 2023-01-25-libafl description: "libafl grammar comparison" fuzzers:
fix bug in output format for pyav * fix bug in output format for pyav * add read from memory with constructor overload * Revert "add read from memory with constructor overload" This reverts commit * run ufmt
@@ -273,15 +273,17 @@ def read_video( raise RuntimeError(f"File not found: {filename}") if get_video_backend() != "pyav": - return _video_opt._read_video(filename, start_pts, end_pts, pts_unit) - + vframes, aframes, info = _video_opt._read_video(filename, start_pts, end_pts, pts_unit) + else: _check_av_available() if end_pts is None: end_pts = float("inf") if end_pts < start_pts: - raise ValueError(f"end_pts should be larger than start_pts, got start_pts={start_pts} and end_pts={end_pts}") + raise ValueError( + f"end_pts should be larger than start_pts, got start_pts={start_pts} and end_pts={end_pts}" + ) info = {} video_frames = []
[DesignRuleCheck] Less is more for M* layers 1) Use Scanline.dIndex instead of layer['direction'] 2) Report errors in array instead of logging (Logging needs to be implemented globally)
-import logging - class DesignRuleCheck(): def __init__(self, canvas): self.canvas = canvas + self.errors = [] + + @property + def num_errors(self): + return len(self.errors) def run(self): ''' @@ -12,7 +15,6 @@ def run(self): (aka removeDuplicates has been run) ''' - self.num_errors = 0 for (layer, vv) in self.canvas.rd.store_scan_lines.items(): if self.canvas.rd.layers[layer] == '*': self._check_via_rules(layer, vv) @@ -29,34 +31,28 @@ def _check_metal_rules(self, layer, vv): '''Check metal min-length / min-spacing rules''' for v in vv.values(): self._check_min_length( - layer, v.rects, self.canvas.rd.layers[layer]) + layer, v.rects, v.dIndex) self._check_min_spacing( - layer, v.rects, self.canvas.rd.layers[layer]) + layer, v.rects, v.dIndex) - def _check_min_length(self, layer, slrects, direction): + def _check_min_length(self, layer, slrects, dIndex): min_length = self.canvas.pdk[layer]['MinL'] - (l, u) = (0, 2) if direction == 'h' else (1, 3) + (start, end) = (dIndex, dIndex + 2) for slr in slrects: rect = slr.rect - if rect[u] - rect[l] < min_length: + if rect[end] - rect[start] < min_length: root = slr.root() - logging.error( - f"MinLength violation on layer:{layer} position:{rect} net:{root.netName}") - self.num_errors += 1 + self.errors.append( + f"MinLength violation on {layer}: {root.netName}{rect}") - def _check_min_spacing(self, layer, slrects, direction): + def _check_min_spacing(self, layer, slrects, dIndex): min_space = self.canvas.pdk[layer]['End-to-End'] - (l, u) = (0, 2) if direction == 'h' else (1, 3) + (start, end) = (dIndex, dIndex + 2) prev_slr = None for slr in slrects: - if prev_slr is not None and slr.rect[l] - prev_slr.rect[u] < min_space: - if direction == 'h': - space_rect = ( prev_slr.rect[2], prev_slr.rect[1], slr.rect[0], slr.rect[3] ) - else: - space_rect = ( prev_slr.rect[0], prev_slr.rect[3], slr.rect[2], slr.rect[1] ) - logging.error( - f"MinSpace violation on layer:{layer} position:{space_rect} net1:{prev_slr.root().netName}, net2:{slr.root().netName}]") - self.num_errors += 1 + if prev_slr is not None and slr.rect[start] - prev_slr.rect[end] < min_space: + self.errors.append( + f"MinSpace violation on {layer}: {prev_slr.root().netName}{prev_slr.rect} x {slr.root().netName}{slr.rect}") prev_slr = slr return
use WorkflowsClient.show_invocation in InvocationsClient.wait_for_invocations. It might be deprecated in future versions but for now it is supported by all versions of Galaxy
@@ -262,16 +262,12 @@ class InvocationClient(Client): after this timeout, an InvocationNotScheduledException is raised. """ - galaxy_version = os.environ.get('GALAXY_VERSION', None) - is_newer = galaxy_version == 'dev' or galaxy_version >= 'release_19.09' - show_invocation = self.gi.invocations.show_invocation if is_newer else self.gi.workflows.show_invocation - args = [invocation['id']] if is_newer else [invocation['workflow_id'], invocation['id']] for _ in range(timeout_seconds * 2): - invocation = show_invocation(*args) + invocation = self.gi.workflows.show_invocation(invocation['workflow_id'], invocation['id']) if invocation['state'] in INVOCATION_TERMINAL_STATES: break time.sleep(.5) - invocation = show_invocation(*args) + invocation = self.gi.workflows.show_invocation(invocation['workflow_id'], invocation['id']) if invocation["state"] != 'scheduled': raise InvocationNotScheduledException(f"Invocation with ID {invocation['id']} was not scheduled after {timeout_seconds} seconds.")
[README] Merge Pull Request Correct typo Replaced 'interpretor' with 'interpreter'.
@@ -179,4 +179,4 @@ Use py2app on OS X and pyinstaller on Windows. For reference setup.py files, loo # VirtualEnv issues -Under virtualenv on OS X, a window created with pywebview has issues with keyboard focus and Cmd+Tab. This behaviour is caused by the Python interpretor that comes with virtualenv. To solve this issue, you need to overwrite `your_venv/bin/python` with the Python interpretor found on your system. Alternatively you can configure your virtual environment to use another Python interpretor as described [here](https://virtualenv.pypa.io/en/stable/userguide/#using-virtualenv-without-bin-python). +Under virtualenv on OS X, a window created with pywebview has issues with keyboard focus and Cmd+Tab. This behaviour is caused by the Python interpreter that comes with virtualenv. To solve this issue, you need to overwrite `your_venv/bin/python` with the Python interpreter found on your system. Alternatively you can configure your virtual environment to use another Python interpreter as described [here](https://virtualenv.pypa.io/en/stable/userguide/#using-virtualenv-without-bin-python).
Doc update for make_image_classifier regarding pip packages: now available from tf-hub-nightly (starting at 0.6.0.dev201908230004), recomend tf-nightly-[gpu-]2.0-preview, due to performance issues with tensorflow-gpu=2.0.0.beta1.
@@ -17,24 +17,28 @@ which demonstrates the key techniques of this program in your browser. ## Installation -This tool requires TensorFlow 2.0 (or its public beta1) and -tensorflow_hub 0.6.0 or better (yet to be released as of August 2019). +This tool requires pre-release versions of the tensorflow and tensorflow_hub +libraries, which can be installed with: ```shell -$ pip install 'tensorflow>=2.0.0beta1' -$ pip install 'tensorflow-hub[make_image_classifier]>=0.6.0' +$ pip install tf-nightly-2.0-preview +$ pip install tf-hub-nightly[make_image_classifier] ``` -After that, the `make_image_classifier` executable is available on the -command line: +<!-- TODO(b/139467904): replace by tensorflow>=2.0.0 --> +<!-- and matching tensorflow_hub once available. --> + +After installation, the `make_image_classifier` executable is available +on the command line: ```shell $ make_image_classifier --help ``` This tool tends to run much faster with a GPU, if TensorFlow is installed -to use it. For instructions, see -[tensorflow.org/install/gpu](https://www.tensorflow.org/install/gpu). +to use it. To do so, you need to install GPU drivers per +[tensorflow.org/install/gpu](https://www.tensorflow.org/install/gpu) +and use pip package `tf-nightly-gpu-2.0-preview`. ## Basic Usage
Update requirement from Py3.5+ to Py3.6+ Since we make use of f-strings.
@@ -41,7 +41,7 @@ Documentation: <https://openml.github.io/automlbenchmark/> ## Installation ### Pre-requisites To run the benchmarks, you will need: -* Python 3.5+. +* Python 3.6+. * PIP3: ensure you have a recent version. If necessary, upgrade your pip using `pip3 install --upgrade pip`. * The Python libraries listed in [requirements.txt](../requirements.txt): it is strongly recommended to first create a [Python virtual environment](https://docs.python.org/3/library/venv.html#venv-def) (cf. also [Pyenv](https://github.com/pyenv/pyenv): quick install using `curl https://pyenv.run | bash` or `brew install pyenv`) and work in it if you don't want to mess up your global Python environment. * [Docker](https://docs.docker.com/install/), if you plan to run the benchmarks in a container.
swarming: downgrade ensure_active_slice errors to warnings TEST=None
@@ -932,7 +932,8 @@ def _ensure_active_slice(request, try_number, task_slice_index): to_runs = [r for r in to_runs if r.queue_number] if to_runs: if len(to_runs) != 1: - logging.error('_ensure_active_slice: %s != 1 TaskToRuns', len(to_runs)) + logging.warning('_ensure_active_slice: %s != 1 TaskToRuns', + len(to_runs)) return None assert len(to_runs) == 1, 'Too many pending TaskToRuns.' @@ -956,7 +957,7 @@ def _ensure_active_slice(request, try_number, task_slice_index): result_summary = task_pack.request_key_to_result_summary_key( request.key).get() if not result_summary: - logging.error('_ensure_active_slice: no TaskToRun or TaskResultSummary') + logging.warning('_ensure_active_slice: no TaskToRun or TaskResultSummary') return None if not result_summary.is_pending:
Fix a typo in the simulated OLT adapter that was preventing it from being enabled.
@@ -336,7 +336,7 @@ class SimulatedOltAdapter(object): yield asleep(0.05) try: log.info("Setting p") - p = PmsConfig( + p = PmConfigs( default_freq=150, grouped=False, freq_override=False)
pin cryptography package pin cryptography package
altair>=4.0.0,<5 Click>=7.1.2 colorama>=0.4.3 -cryptography>=3.2 +cryptography>=3.2,<37.0.0 importlib-metadata>=1.7.0 # (included in Python 3.8 by default.) Ipython>=7.16.3 jinja2>=2.10,<3.1.0 # contextfilter has been renamed
Move import fcntl inside if statement. Fixed
@@ -20,7 +20,6 @@ import vaex.dataset import vaex.file from vaex.expression import Expression import struct -import fcntl logger = logging.getLogger("vaex.file") @@ -45,6 +44,7 @@ if no_mmap: from cachetools import LRUCache import threading + import fcntl GB = 1024**3 def getsizeof(ar): return ar.nbytes
added TX quaternary hospitalization Clicking on the "Hospitals - Statewide" tab of the "other link".
@@ -510,6 +510,19 @@ quaternary: page.done(); message: click button for PR recoveries ("Convalecientes") + TX: + renderSettings: + viewport: + width: 2000 + overseerScript: > + page.manualWait(); + await page.waitForDelay(20000); + await page.evaluate(() => { document.evaluate("//div[text()='Hospitals - Statewide']", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.setAttribute("ctpclickhere", "ctpclickhere"); }); + page.click("div[ctpclickhere]"); + await page.waitForDelay(20000); + page.done(); + message: clicking on "Hospitals - Statewide" tab. Also widening viewport so that tab is visible. + WI: file: csv message: download CSV for testing data
Mariner: skip serial_console_enabled test The issue with this test in 1.0 has been closed as 'wont fix' Serial console still works, just the message isn't always logged.
@@ -753,6 +753,11 @@ class AzureImageStandard(TestSuite): CpuArchitecture.X64: "ttyS0", CpuArchitecture.ARM64: "ttyAMA0", } + if isinstance(node.os, CBLMariner): + if node.os.information.version < "2.0.0": + raise SkippedException( + "CBLMariner 1.0 has a known 'wont fix' issue with this test" + ) lscpu = node.tools[Lscpu] arch = lscpu.get_architecture()
[FIX] Enable additional edit summary for syntax correction set the right edit summary either the summary that the bot corrects the syntax of a <references /> tag or the edit summary that the bot adds the <references /> tag Also improve doc.
@@ -498,7 +498,6 @@ class NoReferencesBot(Bot): self.generator = pagegenerators.PreloadingGenerator(generator) self.site = pywikibot.Site() - self.comment = i18n.twtranslate(self.site, 'noreferences-add-tag') self.refR = _ref_regex self.referencesR = _references_regex @@ -544,11 +543,17 @@ class NoReferencesBot(Bot): Add a references tag into an existing section where it fits into. If there is no such section, creates a new section containing - the references tag. - * Returns : The modified pagetext + the references tag. Also repair malformed references tags. + Set the edit summary accordingly. + @param oldText: page text to be modified + @type oldText: str + @return: The modified pagetext + @rtype: str """ # Do we have a malformed <reference> tag which could be repaired? + # Set the edit summary for this case + self.comment = i18n.twtranslate(self.site, 'noreferences-fix-tag') # Repair two opening tags or a opening and an empty tag pattern = re.compile(r'< *references *>(.*?)' @@ -563,6 +568,8 @@ class NoReferencesBot(Bot): return re.sub(pattern, '<references />', oldText) # Is there an existing section where we can add the references tag? + # Set the edit summary for this case + self.comment = i18n.twtranslate(self.site, 'noreferences-add-tag') for section in i18n.translate(self.site, referencesSections): sectionR = re.compile(r'\r?\n=+ *%s *=+ *\r?\n' % section) index = 0
Added a few unit tests Added a couple unit tests related to cmd2.Cmd.default_to_shell Added a unit test related to cmd2.Cmd._surround_ansi_escapes()
@@ -699,7 +699,6 @@ class HookFailureApp(cmd2.Cmd): """Simulate precmd hook failure.""" return True, statement - @pytest.fixture def hook_failure(): app = HookFailureApp() @@ -714,3 +713,50 @@ def test_precmd_hook_success(base_app): def test_precmd_hook_failure(hook_failure): out = hook_failure.onecmd_plus_hooks('help') assert out == True + + +class ShellApp(cmd2.Cmd): + def __init__(self, *args, **kwargs): + # Need to use this older form of invoking super class constructor to support Python 2.x and Python 3.x + cmd2.Cmd.__init__(self, *args, **kwargs) + self.default_to_shell = True + [email protected] +def shell_app(): + app = ShellApp() + app.stdout = StdOut() + return app + +def test_default_to_shell_found(shell_app): + out = run_cmd(shell_app, 'ls -hal') + assert out == [] + +def test_default_to_shell_unknown(shell_app): + unknown_command = 'zyxcw23' + out = run_cmd(shell_app, unknown_command) + assert out == ["*** Unknown syntax: {}".format(unknown_command)] + + +def test_ansi_prompt_not_esacped(base_app): + prompt = '(Cmd) ' + assert base_app._surround_ansi_escapes(prompt) == prompt + + +def test_ansi_prompt_escaped(): + app = cmd2.Cmd() + color = 'cyan' + prompt = 'InColor' + color_prompt = app.colorize(prompt, color) + + readline_hack_start = "\x01" + readline_hack_end = "\x02" + + readline_safe_prompt = app._surround_ansi_escapes(color_prompt) + if sys.platform.startswith('win'): + # colorize() does nothing on Windows due to lack of ANSI color support + assert prompt == color_prompt + assert readline_safe_prompt == prompt + else: + assert prompt != color_prompt + assert readline_safe_prompt.startswith(readline_hack_start + app._colorcodes[color][True] + readline_hack_end) + assert readline_safe_prompt.endswith(readline_hack_start + app._colorcodes[color][False] + readline_hack_end)
Fixes list_lgst_circuits function so works when prepStrs[0] has empty line labels. Automatically sets the default ('*',) line labels when prepStrs[0] has None or empty line labels (can happen using old-style circuits).
@@ -471,6 +471,7 @@ def list_lgst_circuits(prepStrs, effectStrs, opLabelSrc): else: opLabels = list(map(tolabel, opLabelSrc)) line_labels = prepStrs[0].line_labels if len(prepStrs) > 0 else 'auto' + if line_labels is None or len(line_labels) == 0: line_labels = ('*',) singleOps = [_cir.Circuit((gl,), line_labels=line_labels)**1 for gl in opLabels] # **1 adds parens to stringrep ret = create_circuit_list('eStr', 'prepStr', 'prepStr+eStr', 'prepStr+g+eStr', eStr=effectStrs, prepStr=prepStrs, g=singleOps,
Automatically update any measures on deploy Closes
@@ -168,6 +168,33 @@ def run_migrations(): warn("Refusing to run migrations in staging environment") +@task +def build_measures(environment=None, measures=None): + env.app = environments[environment] + env.environment = environment + env.path = "/webapps/%s" % env.app + + with cd(env.path): + with prefix('source .venv/bin/activate'): + run("cd openprescribing/ && " + "python manage.py import_measures --measure {}".format( + measures)) + + +def build_changed_measures(): + """For any measures changed since the last deploy, run + `import_measures`. + + """ + measures = [] + for f in env.changed_files: + if 'measure_definitions' in f: + measures.append(os.path.splitext(os.path.basename(f))[0]) + if measures: + measures = ",".join(measures) + build_measures(environment=env.environment, measures=measures) + + @task def graceful_reload(): result = sudo_script('graceful_reload.sh %s' % env.app) @@ -218,6 +245,7 @@ def deploy(environment, force_build=False, branch='master'): npm_build_css(force_build) deploy_static() run_migrations() + build_changed_measures() graceful_reload() clear_cloudflare() setup_cron()
Fix - do not trigger during automatic testing Skip if automatic testing and no batch file. Eventually we might want to automatically test webpublisher functionality too.
@@ -38,10 +38,15 @@ class CollectColorCodedInstances(pyblish.api.ContextPlugin): def process(self, context): self.log.info("CollectColorCodedInstances") - self.log.debug("mapping:: {}".format(self.color_code_mapping)) + batch_dir = os.environ.get("OPENPYPE_PUBLISH_DATA") + if (os.environ.get("IS_TEST") and + (not batch_dir or not os.path.exists(batch_dir))): + self.log.debug("Automatic testing, no batch data, skipping") + return existing_subset_names = self._get_existing_subset_names(context) - asset_name, task_name, variant = self._parse_batch() + + asset_name, task_name, variant = self._parse_batch(batch_dir) stub = photoshop.stub() layers = stub.get_layers() @@ -125,9 +130,8 @@ class CollectColorCodedInstances(pyblish.api.ContextPlugin): return existing_subset_names - def _parse_batch(self): + def _parse_batch(self, batch_dir): """Parses asset_name, task_name, variant from batch manifest.""" - batch_dir = os.environ.get("OPENPYPE_PUBLISH_DATA") task_data = None if batch_dir and os.path.exists(batch_dir): task_data = parse_json(os.path.join(batch_dir,
[runtime_env] Fix failing `wheel_urls` release test This PR updates the release tests wheel_urls to make it compatible with the internal API change in PR Previously the release test was breaking with File "/home/ray/anaconda3/lib/python3.7/site-packages/ray/_private/utils.py", line 1266, in get_wheel_filename assert py_version in ray_constants.RUNTIME_ENV_CONDA_PY_VERSIONS, py_version AssertionError: 36
@@ -21,6 +21,7 @@ import time import requests import pprint +import ray._private.runtime_env.constants as ray_constants from ray._private.utils import get_master_wheel_url, get_release_wheel_url @@ -40,7 +41,7 @@ if __name__ == "__main__": retry = set() for sys_platform in ["darwin", "linux", "win32"]: - for py_version in ["36", "37", "38", "39", "310"]: + for py_version in ray_constants.RUNTIME_ENV_CONDA_PY_VERSIONS: if "dev" in ray.__version__: url = get_master_wheel_url( ray_commit=ray.__commit__,
templates: Use help link widget in invite user modal. Updates the help center link in the invite user modal to use the help_link_widget.
</div> <div class="input-group"> <label for="invite_as">{{t "User(s) join as" }} - <a href="/help/roles-and-permissions" target="_blank" rel="noopener noreferrer"> - <i class="fa fa-question-circle-o" aria-hidden="true"></i> - </a> + {{> help_link_widget link="/help/roles-and-permissions" }} </label> <div> <select id="invite_as">
Add --extend option to cci project init to easily configure extensions of other CumulusCI Github repositories
@@ -317,8 +317,9 @@ cli.add_command(service) @click.command(name='init', help="Initialize a new project for use with the cumulusci toolbelt", ) [email protected]('--extend', help="If set to the url of another Github repository configured for CumulusCI, creates this project as an extension which depends on the other Github project and all its dependencies") @pass_config -def project_init(config): +def project_init(config, extend): if not os.path.isdir('.git'): raise click.ClickException("You are not in the root of a Git repository") @@ -364,6 +365,10 @@ def project_init(config): yml_config.append(' package:') yml_config.extend(package_config) + if extend: + yml_config.append(' dependencies:') + yml_config.append(' github: {}'.format(extend)) + # git: git_config = [] click.echo()
Handle null Genotypes resolves
@@ -11,8 +11,11 @@ import scala.collection.mutable object GenotypeSuite { def readWriteEqual(nAlleles: Int, g: Genotype): Boolean = { - val isLinearScale = g._isLinearScale - val gb = new GenotypeBuilder(nAlleles, isLinearScale) + val gb = if (g == null) { + new GenotypeBuilder(nAlleles, false) + } else { + new GenotypeBuilder(nAlleles, g._isLinearScale) + } gb.set(g) val g2 = gb.result()
fix: update failing test with the new thread-safety, we must check the individual values of `_pending_calls`
@@ -38,9 +38,9 @@ def test_flush_mid_execution(accounts, tester): with brownie.multicall: tester.getTuple(addr) - assert len(brownie.multicall._pending_calls) == 1 + assert len([x for v in brownie.multicall._pending_calls.values() for x in v]) == 1 brownie.multicall.flush() - assert len(brownie.multicall._pending_calls) == 0 + assert len([x for v in brownie.multicall._pending_calls.values() for x in v]) == 0 def test_proxy_object_fetches_on_next_use(accounts, tester): @@ -50,10 +50,10 @@ def test_proxy_object_fetches_on_next_use(accounts, tester): with brownie.multicall: ret_val = tester.getTuple(addr) - assert len(brownie.multicall._pending_calls) == 1 + assert len([x for v in brownie.multicall._pending_calls.values() for x in v]) == 1 # ret_val is now fetched assert ret_val == value - assert len(brownie.multicall._pending_calls) == 0 + assert len([x for v in brownie.multicall._pending_calls.values() for x in v]) == 0 def test_proxy_object_updates_on_exit(accounts, tester):
Upnext is incompatible with watched status sync It needs many changes to make it compatible, it will be done in the future
@@ -93,6 +93,14 @@ def play(videoid): event_data = _get_event_data(videoid) event_data['videoid'] = videoid.to_dict() event_data['is_played_by_library'] = g.IS_SKIN_CALL + # Todo: UpNext addon is incompatible with netflix watched status sync feature + # Problems: + # - Need to modify the cache (to update the watched status) on every played item + # - Modifying the cache after the stop, is wrong due to below problems + # - The new fast play, 'play_url' method, cause problems with the Player callbacks, after press play next is missing the Stop event in the controller! + # - To verify possibility problems of data mixing of controller._get_player_state() + # - The call of next video from UpNext is recognized as Skin call, because it's an external addon call, so it causes several operating problems + is_up_next_enabled = False if 'raspberrypi' in common.get_system_platform(): # OMX Player is not compatible with netflix video streams
Svg elements copy preserves dims width and height were dropped during a copy.
@@ -5996,6 +5996,8 @@ class SVGText(GraphicObject, Transformable): self.text = s.text self.x = s.x self.y = s.y + self.width = s.width + self.height = s.height self.dx = s.dx self.dy = s.dy self.anchor = s.anchor @@ -6096,8 +6098,8 @@ class SVGText(GraphicObject, Transformable): width = self.width height = self.height xmin = self.x - ymin = self.y - self.height - xmax = self.x + self.width + ymin = self.y - height + xmax = self.x + width ymax = self.y if not hasattr(self, 'anchor') or self.anchor == 'start': pass
readme MR update for ssdlite Reviewers: mark.kurtz, jfinks, tuan, kevinaer, dhuang Subscribers: #core
@@ -15,7 +15,9 @@ neuralmagicML-python scripts - Functional scripts for working with the Python API onnx - Functional scripts for working with ONNX models pytorch - Functional scripts for working with PyTorch models + server - Scripts to run the Sparsify server tensorflow - Functional scripts for working with TensorFlow models + MANIFEST.in - Attaches server files to installation process README.md - readme file requirements.txt - requirements for the Python API setup.py - setuptools install script @@ -260,7 +262,7 @@ Possible types are: ### Available Models | Architecture | Dataset | Available Types | Frameworks | Validation Baseline Metric | -| ------------------ | -------- | ----------------------- | -------------------------- | -------------------------- | +| ------------------- | -------- | ----------------------- | -------------------------- | -------------------------- | | MnistNet | MNIST | base | ONNX, PyTorch, TensorFlow | ~99% top1 accuracy | | EfficientNet-B0 | ImageNet | base, recal-perf | ONNX, PyTorch | 77.3% top1 accuracy | | EfficientNet-B4 | ImageNet | base, recal-perf | ONNX, PyTorch | 83.0% top1 accuracy | @@ -284,6 +286,8 @@ Possible types are: | VGG-19bn | ImageNet | base | ONNX, PyTorch, TensorFlow | 74.24% top1 accuracy | | SSD-300-ResNet-50 | COCO | base, recal-perf | ONNX, PyTorch | 42.7% [email protected] | | SSD-300-ResNet-50 | VOC | base, recal-perf | ONNX, PyTorch | 52.2% [email protected] | +| SSDLite-MobileNetV2 | COCO | base | ONNX, PyTorch | 35.7% [email protected] | +| SSDLite-MobileNetV2 | VOC | base | ONNX, PyTorch | 43.5% [email protected] | ### Downloading and Usage Tutorial notebooks are provided for easily integrating and using the models in the Neural Magic Model Repo.
Fixes a bug in Estimate serialization. Resets to None several non-serialized elements that otherwise wouldn't be present in the object, causing errors it they were accessed.
@@ -875,6 +875,10 @@ class Estimate(object): state_dict['models'] = state_dict['gatesets'] del state_dict['gatesets'] + # reset MDC objective function and store objects + state_dict['_final_mdc_store'] = None + state_dict['_final_objfn'] = None + self.__dict__.update(state_dict) for crf in self.confidence_region_factories.values(): crf.set_parent(self)
cast int Just realized the round was rounding to a float and wouldn't work I guess they changed that on python3
@@ -830,7 +830,7 @@ def _ecg_findpeaks_rodrigues(signal, sampling_rate=1000): - Sadhukhan, D., & Mitra, M. (2012). R-peak detection algorithm for ECG using double difference and RR interval processing. Procedia Technology, 4, 873-877. """ - N = np.round(3 * sampling_rate/128) + N = int(np.round(3 * sampling_rate/128)) Nd = N-1 Pth = (0.7 * sampling_rate) / 128+2.7 # Pth = 3, optimal for fs = 250 Hz
Update 15-schema_update_17.sql Added `IF NOT EXISTS` in script where I found note from carter.
@@ -3,8 +3,8 @@ ALTER TABLE "augur_data"."repo" ALTER COLUMN "forked_from" TYPE varchar USING "forked_from"::varchar; ALTER TABLE "augur_data"."repo" - ADD COLUMN "repo_archived" int4, - ADD COLUMN "repo_archived_date_collected" timestamptz(0), + ADD COLUMN IF NOT EXISTS "repo_archived" int4, + ADD COLUMN IF NOT EXISTS "repo_archived_date_collected" timestamptz(0), ALTER COLUMN "forked_from" TYPE varchar USING "forked_from"::varchar; update "augur_operations"."augur_settings" set value = 17 where setting = 'augur_data_version';
docs: CONTRIBUTING: Fix placement of -e flag Fixes:
@@ -123,7 +123,7 @@ this we use the `--prefix=~/.local` flag. ```console $ git clone https://github.com/intel/dffml $ cd dffml -$ python3.7 -m pip install -e --prefix=~/.local .[dev] +$ python3.7 -m pip install --prefix=~/.local -e .[dev] ``` > `[dev]` tells `pip` to install the dependencies you'll need to do development
add check to tests This ensures that not only the variables are in the list, but they are the only variables in that list
@@ -73,12 +73,14 @@ def test_dependence_map(): assert x in dependence_map.buckets[0].variables assert y in dependence_map.buckets[0].variables assert z in dependence_map.buckets[0].variables + assert len(set(dependence_map.buckets[0].variables)) == 3 assert conditions[0] in dependence_map.buckets[0].conditions assert conditions[1] in dependence_map.buckets[0].conditions assert a in dependence_map.buckets[1].variables assert b in dependence_map.buckets[1].variables + assert len(set(dependence_map.buckets[1].variables)) == 2 assert conditions[2] in dependence_map.buckets[1].conditions
Upgrade to Mesos 1.0.1 This contains important bugfixes, especially to in which the scheduler can crash when a lot of tasks are updated at once.
@@ -28,7 +28,7 @@ dependencies = ' '.join(['libffi-dev', # For client side encryption for 'azure' 'wget', 'curl', 'openssh-server', - 'mesos=1.0.0-2.0.89.ubuntu1404', + 'mesos=1.0.1-2.0.93.ubuntu1404', 'rsync', 'screen'])
Fix sorting of authors/speakers in widget Which was broken for n > 9.
* along with Indico; if not, see <http://www.gnu.org/licenses/>. */ -/* global showFormErrors:false */ +/* global showFormErrors:false strnatcmp:false */ (function(global) { 'use strict'; $coauthorList.empty(); $otherList.empty(); - var sortedPeople = _.sortBy(people, function(person) { - return [person.displayOrder, person.name]; + var sortedPeople = _.clone(people); + sortedPeople.sort(function(person1, person2) { + var k1 = person1.displayOrder + ' ' + person1.name; + var k2 = person2.displayOrder + ' ' + person2.name; + return strnatcmp(k1, k2); }); // Set default values allowEmptyEmail: options.allow.emptyEmail, multiChoice: true, overwriteChoice: false, - render: function(people) { - renderPeople(people); - }, + render: renderPeople, onAdd: function(people) { people.forEach(function(person) { if (person.authorType === undefined) {
Update wildcards.py Calling out that some shells require quotes around wildcarded expressions.
@@ -30,6 +30,10 @@ _DETAILED_HELP_TEXT = (""" will copy all objects that start with gs://bucket/data/abc followed by any number of characters within that subdirectory. + Note: Some shells require that wildcarded expressions be surrounded with + single quotes (on Linux) or double quotes (on Windows). For example: + + gsutil cp "gs://bucket/data/abc*" . <B>DIRECTORY BY DIRECTORY VS RECURSIVE WILDCARDS</B> The "*" wildcard only matches up to the end of a path within