[Bug]: Visualizer in for loop increases RAM successively

Describe the bug
While letting our PaDiM model (export via torch) iteratively predict on unlabeled data and storing the visualization results we observed that after a while we get an MemoryError
https://github.com/matplotlib/matplotlib/issues/20490/
from anomalib.post_processing import Visualizer, VisualizationMode
import psutil
import os
from anomalib.data.utils import read_image
from anomalib.deploy import TorchInferencer
from pathlib import Path

# has to be adapted
result_path = 'path to your model'
img_path = 'path to a image'
file_path = Path('.')

inferencer = TorchInferencer(
    path=result_path + '/weights/torch/model.pt',
    #device="CPU",  # We would like to run it on an Intel CPU.
)

image = read_image(img_path)
predictions = inferencer.predict(image)

process = psutil.Process(os.getpid())

visualizer = Visualizer(mode=VisualizationMode.FULL, task=TaskType.CLASSIFICATION)
for i in range(0,2000):
    output_image = visualizer.visualize_image(predictions)
    visualizer.save(file_path / 'test.png', output_image)
    memory_usage = process.memory_info()
    if i % 100 == 0:
        print(f"Loop {i}: Process memory used: {memory_usage.rss / (1024 * 1024):.2f} MB")

Dataset
Folder
Model
PADiM
Steps to reproduce the behavior
Steps to reproduce:

train model and use export type torch (probably is the same for others as well)
load model and visualize results like in the code above

OS information
OS information:

OS: Windows
Python 3.9.16
Anomalib version: 0.6.0

Expected behavior
RAM stays relatively constant
Screenshots

-> probably other process released memmory between loop 100 and 200
Pip/GitHub
pip
What version/branch did you use?
No response
Configuration YAML
n/a

Logs
n/a

Code of Conduct

[X] I agree to follow this project's Code of Conduct

Hi @blaz-r, FYI based on your message I thought I give the OpenVINOInferencer a try but also there memory increases..

Thanks for this information, then I'm not sure. There are many possibilities, could be the way matplotlib handles data. It's quite tricky to track memory leaks 😅


DbCredentials, TimeInterval and DatacubeQueryContext classes

Some things to be thrown into the API thinking pot:
New TimeInterval class allows start and end dates to be encapsulated in one instance reducing the number of query tile_list() parameters by one. Inspired by Java Joda package.
There seems to be no need for a the tile_list method which takes a "year" list:
interval = TimeInterval(datetime(2000,1,1), datettime(2003,12,31))
is equivalent to
years = range(2000,2004)
Instances of new DbCredentials credentials class carry database credentials reducing the number of query tile_list() parameters by 4. Factory method in config module creates instances of DbCredentials from existing config.
Instance of new DatacubeQueryContext class carries a DbCredentials instance and offers simplified api calls (5 fewer parameters). Methods delegate to the existing api functions.

AGDC pull request approval team have been notified of the request.

This pull request was created against an old version of the API code base and much of it is no longer applicable.  I'm closing this pull request and in the near future will go through and extract any relevant/desirable parts from it into new pull requests


Making Alarm app

Project title
Making a Alarm App website
Project Description
To make an alarm app using html,css and javascript
Stack:
And in order to tick the check box just but x inside them for example - [x] like this. Please delete options that are not relevant.

[x] Html
[x] CSS
[x] JavaScript

/assign

@khushi-purwar

Assigned to u @AastikSharma05


Add support for france.tv (pluzz replacement)

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.05.09. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

[x] I've verified and I assure that I'm running youtube-dl 2017.05.09

Before submitting an issue make sure you have:

[x] At least skimmed through README and most notably FAQ and BUGS sections
[x] Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

[ ] Bug report (encountered problems with youtube-dl)
[x] Site support request (request for adding support for a new site)
[ ] Feature request (request for a new functionality)
[ ] Question
[ ] Other

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):

Single video: https://www.france.tv/france-5/c-dans-l-air/137029-emission-du-lundi-8-mai-2017.html

The formerly supported french public televisions website pluzz.francetv.fr has been replaced by france.tv. youtube-dl cannot download video from this new website yet:
youtube-dl https://www.france.tv/france-5/c-dans-l-air/137029-emission-du-lundi-8-mai-2017.html
[FranceTV] 137029-emission-du-lundi-8-mai-2017: Downloading webpage
[FranceTV] 157542173: Downloading video JSON
ERROR: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by <HTTPError 404: 'Not Found'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Impossible de lire la vidéo.

can't be played in the browser.

Sorry, the link I posted was valid yesterday. Check this one instead: https://www.france.tv/actualites-et-societe/politique/137117-speciale-c-politique.html
I believe this bug should not be closed.

if it's not working for you then post full verbose output with the latest version.
youtube-dl https://www.france.tv/actualites-et-societe/politique/137117-speciale-c-politique.html
[FranceTV] 137117-speciale-c-politique: Downloading webpage
[FranceTV] 157542203: Downloading video JSON
[FranceTV] 157542203: Downloading geo restriction info
[FranceTV] 157542203: Downloading m3u8 information
[FranceTV] 157542203: Downloading m3u8 information
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 861
[download] Destination: On change de monde-157542203.mp4
[download]   0.0% of ~1.59GiB at 91.54KiB/s ETA 06:51:38

Sorry, for the report. It work now. Thanks for your help - it seems I needed it ! ^^


image-sets-normalization pipeline

Prior art:

https://github.com/Kitware/VolView/blob/main/src/io/itk-dicom/dicom.cpp#L174
https://github.com/malaterre/GDCM/blob/master/Examples/Cxx/DiscriminateVolume.cxx
https://github.com/malaterre/GDCM/blob/master/Utilities/VTK/vtkGDCMImageReader.cxx

Image sets JSON shape:
https://docs.aws.amazon.com/healthimaging/latest/devguide/understanding-image-sets.html
TODO

[x]  Instead of Filename key, do ImageFrames
[x] Pull Patient, study, series tags: https://docs.aws.amazon.com/healthimaging/latest/devguide/reference-dicom-support.html
[x] Group files by "Patient, Study + Series + orientation + frame of reference UID, pixel size" and put all Volumes under Series with unique IDs.
[x] Pass our volume grouped series to Spatial Sorter.
[x] Return arrays of numbers as array of floats, not strings. https://github.com/malaterre/GDCM/blob/master/Source/MediaStorageAndFileFormat/gdcmJSON.cxx
[x] params for grouping image sets and volumes
[x] Check consistence of GDCM Keyword AWS Image Set property -> provide Keyword dictionary if needed
[x] Fix extra space at end of string tags.
[x] Use SpecificCharacterSet tag and DICOMTagReader::CharStringToUTF8Converter.

[ ] Fix exception related tag memory management with the set.
[ ] Support proviing just binary file headers and add test
[ ] Optimize: Only read tags once.
[ ] Delete gdcmDiscriminateVolume.h if still unused (may be helpful for instance sorting step)

Current output with 2 image series/sets:
actual.json.tar.gz

https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/IO/GDCM/src/itkGDCMImageIO.cxx

Notes:

We do not want to read from directories
We want to take as inputs the dicom file headers, itk::wasm::BinaryFile or itk::wasm::BinaryStream
In the C++ tests, these will be the full dicom binary files
In JavaScript tests, these can just be the binary file headers, code snippet from @floryst :+1:

 function* parseDicomUpToPixelData() {
  const reader = new StreamingByteReader();

  // preamble
  yield* reader.seek(128);

  // prefix
  const prefix = yield* reader.readAscii(4);
  if (prefix !== "DICM") {
    throw new Error("Not DICOM");
  }

  const info = yield* readFieldMetaInfo(reader);
  const explicitVr = info.transferSyntaxUid !== ImplicitTransferSyntaxUID;
  const littleEndian = info.transferSyntaxUid !== ExplicitVRBigEndianUID;

  yield* skipDataElementsUntil(
    reader,
    // (7fe0,0010): Pixel Data
    (group, element) => group === 0x7fe0 && element === 0x0010,
    { explicitVr, littleEndian }
  );
}

current JSON output
image-sets.json

Rebase started in #1197


Dependencies installation failing with Python 3.12

While Python 3.12 is said supported ("python = ">=3.10,<3.13" in pyproject.toml file), dependencies installation fails when using this version. This failure seems to be caused by a Pytorch version, which depends on the triton libary version that can not be found.
This issue does not occur with Python 3.10 and 3.11.
Steps to reproduce

Install python 3.12 (or use a conda environment with python 3.12)
Install poetry with pip install poetry
Install dependencies with poetry install
Installation fails with the following error logs :

  - Installing triton (2.1.0): Failed

  RuntimeError

  Unable to find installation candidates for triton (2.1.0)

  at ~/.local/share/pypoetry/venv/lib/python3.12/site-packages/poetry/installation/chooser.py:74 in choose_for
       70│
       71│             links.append(link)
       72│
       73│         if not links:
    →  74│             raise RuntimeError(f"Unable to find installation candidates for {package}")
       75│
       76│         # Get the best link
       77│         chosen = max(links, key=lambda link: self._sort_key(package, link))
       78│

Cannot install triton.

Expected behavior
The installation should complete without errors, setting up all dependencies required for the project.
Environment:

OS: [Ubuntu 22.04.3 LTS] (through WSL2)
Python Version: [3.12.4]
Poetry Version: [1.8.3]

It's seems that there is also a problem with other libraries. When trying to add ontime as a dependency of a new project with python 3.12, I get a new error :
  - Downgrading numpy (1.26.0 -> 1.25.2): Failed

  ChefBuildError

  Backend 'setuptools.build_meta:__legacy__' is not available.

  Cannot import 'setuptools.build_meta'

  at ~/.local/share/pypoetry/venv/lib/python3.12/site-packages/poetry/installation/chef.py:164 in _prepare
      160│
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│
      163│             if error is not None:
    → 164│                 raise error from None
      165│
      166│             return path
      167│
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with numpy (1.25.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "numpy (==1.25.2)"'.

Commands to reproduce :
poetry env use python3.12
poetry add ontime


feat: Piscina implementation for bulk-lssuance

piscina Implementation for bulk-issuance using workers

Implemented but it's not possible on our approach

Closing as per @tipusinghaw 's comment above


APP-462: [C++ SDK] Error build a sample app from build.bat in the windows

Note! It looks like need to change "build" to a define. What do you think?

Can one of the admins verify this patch?

@kaa-leeroy add to whitelist


New version: Genivia.ugrep version 5.0.0

Pull request has been created with WinGet Releaser v2 :rocket:
Microsoft Reviewers: Open in CodeFlow

Automatic Validation ended with:

No errors to post.

(Automated response - build 791.)

@wingetbot waivers Add Validation-Executable-Error

@wingetbot waivers Add Validation-Executable-Error


Add UniFi Extension

Description
Manage Unifi Controller

Search Devices

Search Clients

Open in Browser

Checklist

[x] I read the extension guidelines
[x] I read the documentation about publishing
[x] I ran npm run build and tested this distribution build in Raycast
[x] I checked that files in the assets folder are used by the extension itself
[x] I checked that assets used by the README are placed outside of the metadata folder

Unstale 😁

???

@pernielsentikaer @mil3na

Checking this @tonka3000

I will add some


Subscription Signature Verification on Deleted Resource

Hello, I am trying to use a REST subscription with signature verification based on the docs provided here: https://www.medplum.com/docs/subscriptions/subscription-extensions#signatures
I noticed that the signature doesn't match for Delete events.
It looks like the signature is generated using the resource that was deleted instead of the body that is sent ({}) based on https://github.com/medplum/medplum/blob/main/packages/server/src/workers/subscription.ts#L571
Is this intentional?
I would expect any of the following would allow the signatures to match on deleted resources:

a signature based on the {} body
include the deleted resource in the body instead of {}
use the content of the X-Medplum-Deleted-Resource header instead of the body for deleted resource signatures

ref: discord support thread

Duplicated with #4906


Making the "preparser" extensible

Targeting https://github.com/slidevjs/slidev/issues/700

[x] rewrite parser to a single while loop and an explicit state (including the current mode, i.e. what it is currently parsing)
[x] make it extensible by addons
[x] add addon pseudo-callbacks in useful places (e.g. onSlice)
[x] allow easy "wrap" use case (to prepend and append lines to the content)
[x] integrate tests in the testing infrastructure
[x] make an initial documentation (a few typical use cases) https://github.com/slidevjs/docs/pull/91/files

I think the core of the PR is fully ok (all parser tests still passing, more tests added for the extensibility).
The question of clean integration in the project is to be checked as I'm not fully familiar with its architecture.

Any feedback is welcome. I'm not perfectly happy with the solution:

I think the parser (and preparser) is though as an independent module, so it has few dependencies (if I am wrong on this, then there are probably ways to simplify the problems below)

Extending the parser requires to load the customizating code from different sources (like addons or the setup/ folder), which causes two roadblocks

the list of paths to search for extensions, is obtained via getUserRoots(), getAddonRoots() which are in the node module
the list of actually-enabled addons is obtained from the headmatter (frontmatter of the first slide) so during the parsing

I ended up with a solution that makes the node module (which has the get...Roots() information) inject an "addon loader" inside the parser which invokes it during parsing, when the headmatter is closed

also, I'm not sure the injecting code is in the best place?

I've made the parsing async, which is probably not an issue as it is only called in an async context already

(not sure what to do about the cypress error which seems unrelated (gpu, dri error))

For the record the old nicely complicated version is archived at https://github.com/twitwi/slidev/tree/preparser-extension-nice-complicated

@antfu if we can find a way to move forward on this, that would be great for (me) writing plugins that could be shared with the community.


[Feature request] Detect when type guards are exhaustive

Suggestion
TypeScript's compiler should recognize code that is unreachable based on exhaustive checks of type guards.
🔍 Search Terms

Case class
Type guard
Dead code
Unnecessary return

✅ Viability Checklist
My suggestion meets these guidelines:

[x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
[x] This wouldn't change the runtime behavior of existing JavaScript code
[x] This could be implemented without emitting different JS based on the types of the expressions
[x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
[x] This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion
Whenever I have a type that is a union of other types, I would like TypeScript to understand that I've exhausted all possible types.
📃 Motivating Example
TypeScript's type system is very rich and is almost powerful enough to support case classes like Scala has. One of the best features of case classes is that I can write code that selects through all possibilities and I'm guaranteed to get compiler errors when the case class is expanded to hold new subtypes.
Consider the following code:
interface Fish {
  kind: "fish";
};

interface Bird {
  kind: "bird";
}

type Animal = Fish | Bird;

function isFish(animal: Animal): animal is Fish {
  return animal.kind === "fish";
}

function isBird(animal: Animal): animal is Bird {
  return animal.kind === "bird";
}

function getPasstime(animal: Animal): string {
  if (isFish(animal)) {
    return "swim";
  } else if (isBird(animal)) {
    return "fly";
  }
}

This code is perfectly safe, but won't transpile because tsc thinks getPasstime is missing a final return statement. Instead, TypeScript could recognize that these type guards are exhaustive and all code will lead to a return statement. That would ensure that when we add Dog as a new type of Animal the code would no longer be exhaustive and would fail until getPasstime is modified to handle or ignore the new case.
💻 Use Cases
I would use this to write forwards-compatible codebases where I can, if I adhere to a coding style, feel safe adding a new type because I know that my previous exhaustive type guards will break until they add the new case.

Looks like duplicate of #21985


Initial MRAA TypeScript Declaration Files

Merges the initial full complement of typescript definitions for Intel's mraa library.

:shipit:


type guards can not assess supertype

Consider
interface A { x: number; }
interface B { y: string; }
type C = A & B;

As we can see C is subtype of A, meaning
var c: C = undefined
var a: A = c; // ok

Is so,why would not the predicate value is A be satisfied?
export function isA(value: C) : value is A {
    return !('y' in <any>value);
}
/*
Error	1	Type 'A' is not assignable to type 'A & B'.
  Type 'A' is not assignable to type 'B'.
    Property 'y' is missing in type 'A'.
*/

the problem is we are checking if A is assignable to C and this fails.
I am not sure i understand the rational for this check though. maybe @tinganho or @JsonFreeman can explain why?

First we should be asking what the behavior of this code should exhibit when called. If you pass in something of type C, should its type be narrowed to A in the guarded context?
I'd argue not because this isn't how instanceof type guards work. Otherwise I'm not sure what behavior we're actually aiming for.
So let's assume we don't narrow - then what is the utility of this code? Should we allow a type guard to subsume a type with its supertype even if we won't actually perform the narrowing? That seems odd.

So that's first. Based on the above, I think this is correct behavior, we just need to give a better error message.
Second, I'm not sure if assignability was the correct relationship between the original type and the guarded type.
To quote the spec:

The assignment compatibility and subtyping rules differ only in that

the Any type is assignable to, but not a subtype of, all types,
the primitive type Number is assignable to, but not a subtype of, all enum types, and
an object type without a particular property is assignable to an object type in which that property is optional.

Why would we want to "narrow" to any? Why take in a number and then state its type is any? This seems odd.
Again, why take in a Foo enum member and say it's a number? It is assignable to all numbers anyway.
This seems like a credible one - it is likely that one does not want to be able to accidentally access an optional property if we know for sure that it's not there.

So I'd argue that because 3 is reasonably important, using the assignability relation wins, but otherwise, using the subtype relation is slightly better.

@DanielRosenwasser check out https://github.com/Microsoft/TypeScript/issues/4107#issuecomment-126970141 for the justification on why we use assignability here.
The behavior reported here is by design. In the signature for isA, the type predicate is trivial because it is always true. Namely any value of type C is of type A because of how C is defined. From the type system's perspective, you could imagine replacing all calls to the isA function with the literal true.

i didn't get a word of what you guys said, shame on me, if it doesn't workout this way for you, then fine, i myself personally find it counter-intuitive that assignment compatibility isn't enough here

on a unrelated note, why do we care what it can or cannot be? why can't we leave it to the developer's discretion to decide what can be what:
i wish i could do this:
const enum Satellite { }
interface Id<a> {
   '': a;
}
function isSatelliteId(value: string) value is Id<Satellite> {
    return /^SAT:\d+-\d+$/.test(value);
}

type guards won't allow it ever, because Id and string have nothing in common, but again why would it matter, after if I said so?

I  mean as I see it, the predicate part should proclaim things rather than trying to assert them, in that predicate I can state whatever I want and it has to be believed to be so by the type system, as long as the result returned by the type guard is true, shouldn't it?

@aleksey-bykov

find it counter-intuitive that assignment compatibility isn't enough here

It is enough. It's precisely the assignability check which fails because A is not assignable to C.
In answer to your broader question, I don't think it makes sense to consider that a string can sometimes be indexable by '' to get a const enum type. And why would the type system care? It's the same reason it would care about anything the user writes. It is to make sure the user is writing something that makes sense. It is trying to catch mistakes, and this type predicate is likely to be a mistake.

But I see your point as well, namely that there is nothing unsafe about allowing the user to write whatever they want. It's just trying to catch code that smells funny.

And why would the type system care?

Thank to dynamic the nature of JavaScript and type erasure we could benefit from tricking TypeScript by saying that a value of a certain type is in fact of a different type. Practical application: my example with treating an actual value of string as a  value of a pseudo-type Id<Whatever>. Thank to being a certain type such Id (a string in disguise) has its own well defined and limited set of operations and can be used only in certain places where it is applicable, compared to an Id as bare string that can be split, concated, upper-cased, or wrongly used to key a entity that it doesn't belong to.
By disallowing such "hijacking" at the type system level we put an artificial limitation on something that could have been a nice zero cost abstraction feature.
Yes, currently such trick can be done even in a 99% type-safe manner:
function withSatelliteId<r>(something: string, haveId: (id: Id<Satellite>) => r, haveOther: (something: string) => r) : r {
   return /^SAT:\d+-\d+$/.test(something) : haveId(<any> something): haveOther(something);
}

But it's quite expensive at runtime since instead of using statements and natural execution flow (as with type guards) we have to use closures as continuation functions. Hence the idea of allowing type guards to do the same kind of trick.

I see your point. I think it is a judgment call as to whether or not to do this assignability check.
I will add that this question is very similar to one that could be asked about type assertions. A type assertion provides a way for the user to bypass the type system, asserting that the type system does not have complete knowledge of something. Yet, in a type assertion <T>x where x is statically of type U, the compiler checks that U is assignable to T or T is assignable to U. It doesn't have to do this check. After all, the very purpose of the type assertion is to bypass the type system, and behold, the type system validates the user's attempt to circumvent it! The purpose of the check is to catch cases where the compiler thinks the type assertion does not even make sense. In the same way, the assignability check in the type predicate is trying to see whether the resulting narrowing even makes sense. And if you think about it, a type predicate is really just a conditional type assertion (a type assertion that fires if the function returns true).
That is the similarity. There is also a difference. A type assertion is unconditional, meaning that if the type assertion turns out to be wrong, the code containing the type assertion will still execute, and likely do something incorrect. In a type predicate of the form (x: U): x is T, if T is not an accurate type for x at runtime, the code associated with the narrowing won't even execute! So even if the type predicate can never be "correct", the function will just always return false, and the suspicious (likely incorrect) code will not run. This is why it may be more reasonable to remove this check for type predicates than it would be for type assertions.
I think we have enough information to make a judgment call about whether to keep this check.

The example with A and B and C is very confusing to me. According to our type system, every C is an A -- the function should always return true. My intuition is that type predicates like this should not exist.
Is there an example where this kind of type predicate makes sense?

Thank you for your answers. The original issue turned out to be non-existing and can be closed unless there is something else to talk about.

Thanks!

What if I just want to check if a class implements an interface in run-time ?
I can't because the Interface does not exists in the JavaScript file.
But what if I still want to hack this capability? Then I have to create a class that will hold the needed properties and I have to extend this basic and "empty" class. The JavaScript instanceof method works in this way. Hack, but works.
So for example I had this little code to play with:
interface test{

}

class _test implements test{

}

abstract class A extends _test {

	private _s: string = "?!?";
	private _b: string = "bb";

	abstract printS(): void;

	get s(): string{
		return this._s;
	}
}

class B extends A{
	constructor(){
		super();
	}

	printS(){
		alert(this.s);
	}
}

var b : B;
b = new B();
b.printS();

// returns true
console.log("is b insteance of test ?", b instanceof _test);

Also, why can't I create a class that implements an interface just like in C# ? Can't see the point.
I think it is possible and really reasonable. A lot of Design Patterns works that way.
Why can't we create a new instance of a child like that:
interface ICharacter{
    value: string;
}

interface MyCharacter implements ICharacter{
   value: string;
   protected   _value: string;
   constructor(s:string){
       _value = s;
   }

    hack   : void(){
      value = "H";
    }
}

ICharacter ch = new MyCharacter("Q"); // if I would check with instanceof could be true, just like in the above code
//and actually that could mean the same like
if( instance of result is true){
    MyCharacter ch = new MyCharacter("Q");
}

// Sorry I have to hurry now, If you can't understand the example code, just let me know and I will write a proper one.

Where IMan is an interface, but in run time it would hold the original Man object and not just the leaner "IMan". As I know an interface is not an object anyway so it could work that way.
So the code above could be the
What do you think?

@bbotond90 I believe your question simply boils down to "Why doesn't TypeScript have a runtime type system?", which because a primary goal of the language is to compile to overhead-free JavaScript.

But would this be possible to write ? I mean JavaScript capable to use the instanceof operator. Also the first part of my code is working it doesn't need any cheating with runtime type system. That is a part of JavaScript. The overhead with the empty abstract object that just implements the interface would be nice to hide. I already used it and its working. Just not nice.
The second part is my true question if possible. In the generated javascript code the left side of the expression wouldn't be more like a normal variable. In typescript something similar to the type any. Only one trick that would be needed to add, to be able to track if the object on the right side is implements the interface or not. If yes, just create a new instance of the object and if not just should throw an error like already does if you try to give an object to a number.
So here we don't have to invent any new trick. At least as I see.

Your proposal only allows for the checking of one interface type per class (because the instanceof operator checks the prototype chain, and the prototype chain is a chain, not a tree). In which case, there's no need to even have the interface type at all (you could just check for the class type instead).

You're right. Thank you for the information :)

I am just curious, what do you think about this code. So IF I create abstract classes instead of interfaces I got the proper behavior that I want. Why can't I do the same with Interfaces ?
Also the c Object can see B and A as a parent but not "notA" class.
Or am I wrong again?
Click here to see generated the code on typescriptlang.org
// an interface should generate the same JavaScript code
abstract class notA{
	abstract toString(): string;
}

abstract class A {
	abstract toString(): string;
}

class B extends A {
	text : string;
	constructor(message: string){
		super();
		this.text = message;
	}
	toString(){
		return "{ "+ typeof(this) +" : "+ this.text + " }";
	}
}

class C extends B{
	int : number;
	constructor(message: string, int: number){
		super(message);
		this.int = int;
	}

	toString(){
		return "{ " + typeof this + " : " + super.toString() + " }";
	}
}

var b = new B("textMessage");
var c = new C("textMessage2", 1000);

alert(b.toString());
alert(c.toString());
alert("c instanceof B = " + (c instanceof B)); //true
alert("c instanceof A = " + (c instanceof A)); //true
alert("c instanceof notA = " + (c instanceof notA)); //false

Also can we get back somehow the name of the Type ?
Discussion about this here

Or should I open a new issue ?


Exclude works on false, but not on true

Issue description:
Exclude seems not to work when exclude contains true values:
'exclude'       => [ true, 1, '1' ] // nothing happens
'exclude'       => [ false, 0, '0' ] // works fine
Version used:
3.0.17
Using theme_mods or options?
theme_mods
Code to reproduce the issue (config + field(s))
Kirki::add_field( 'my-config', array(
	'type'     => 'toggle',
	'settings' => 'show_header',
	'label'    => __( 'Show header?' ),
	'section'  => 'section',
	'transport' => 'auto',
	'output'    => array(
		array(
			'element'       => '.header,
			'property'      => 'display',
			'value_pattern' => 'none',
			'exclude'       => [ true, 1, '1' ] // doesn't work, but [ false, 0, '0' ] works
		),
	),
) );

I tried to confirm this using the following code and was unable to:
		'settings'    => 'color_setting_hex',
		'label'       => __( 'Color Control (hex-only)', 'kirki' ),
		'description' => esc_html__( 'This is a color control - without alpha channel.', 'kirki' ),
		'section'     => 'color_section',
		'default'     => '#0008DC',
		'output'    => array(
			array(
				'element'       => '.site-header',
				'property'      => 'background-color',
				'exclude'       => [ true, 1, '1', '#000000' ],
			),
		),```

Any thoughts @aristath?

This works fine, it just needs some clarification.
Since The switch in the OP uses 'transport' => 'auto', this is handled via postMessage in the customizer.
When the switch is turned off, .header will get display:none.
When the switch gets turned back on, nothing will happen because the exclude argument will make the script exit early - giving the impression that it's broken when in fact it's fine.
The exclude argument will not remove display:none if the value is true. It will simply not add it.
So the code should look something like this instead for a toggle/switch/checkbox control:
'output'    => [
	[
		'element'       => '.header,
		'property'      => 'display',
		'value_pattern' => 'none',
		'exclude'       => [ true, 1, '1' ],
	],
	[
		'element'       => '.header,
		'property'      => 'display',
		'value_pattern' => 'block',
		'exclude'       => [ false, 0, '0' ],
	],
],


Update MapsSearchClient.cs

Contributing to the Azure SDK
Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.
For specific information about pull request etiquette and best practices, see this section.

Can you explain what's the purpose for the code changes? Thanks.


Show progress bar in system provisioning step

Whenever a system is going through the "provisioning" step, it'll usually take a while. It'd be nice if we could show a progress bar, or turn on verbose as a default for the provisioning step, so the user doesn't think that it stopped working.

:+1:

:+1:


See all support MySQL versions links to the wrong page

The link to "See all supported versions" in the middle of this page contains a link to the PostgreSQL version page instead of the MySQL version page.
The correct link would be https://docs.microsoft.com/en-us/azure/mysql/concepts-supported-versions

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 1f766765-03b0-2d76-7fe0-42b207afd9f9
Version Independent ID: cbd009b3-ba92-2207-d843-77c2268eb7a5
Content: Quickstart: Create a server - Azure portal - Azure Database for MySQL
Content Source: articles/mysql/quickstart-create-mysql-server-database-using-azure-portal.md
Service: mysql
GitHub Login: @savjani
Microsoft Alias: pariks

@andybochmann we'll review your feedback and get back to you shortly. Thanks.

@andybochmann we'll review your feedback and get back to you shortly. Thanks.

Thanks @andybochmann for your feedback. I have rectified the link and it should be live in a day. thanks !!!

Thanks @andybochmann for your feedback. I have rectified the link and it should be live in a day. thanks !!!


Added option to pick armor and calculate stats.

This is based on request #215

One last thing before I merge, does it edit stats based on pets? For example, when switching to magma armor with a magma cube pet, does it scale the armor stats?

One last thing before I merge, does it edit stats based on pets? For example, when switching to magma armor with a magma cube pet, does it scale the armor stats?

As you can see in the code what it does, is take the raw numbers from the page and modify them depending on the armor stats. The plugin will cache those to calculate the delta when the user modify any other stats (including other armor).
You can take a look to the function I added before the weapons one.

As you can see in the code what it does, is take the raw numbers from the page and modify them depending on the armor stats. The plugin will cache those to calculate the delta when the user modify any other stats (including other armor).
You can take a look to the function I added before the weapons one.

If you have any question just send me the # line to explain.

If you have any question just send me the # line to explain.

Oops, was going to merge but there's a conflict.

Oops, was going to merge but there's a conflict.

Fixed this.


add reference to EGo's MAA sample

Purpose

Add reference to EGo's Microsoft Azure Attestation sample code. EGo provides Go sample code to demonstrate Microsoft Azure Attestation as well as library functions for simple usage of Azure Attestation.

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type
What kind of change does this Pull Request introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[x] Documentation content changes
[ ] Other... Please describe:

@mssindhurid @gkostal Could I have your feedback on this PR?

@mssindhurid @gkostal Could I have your feedback on this PR?

@katexochen - Thank you for the edits. The PR will be approved and we will place all customer code samples integrated with Azure Attestation under a separate heading


Cannot create a PR if source branch is not included in remotes settings

Create a typical setup where you have an upstream remote and your fork remote added in your local repo.
Rename them. E.g. microsoft and sbatten respectively.
Use the githubPullRequests.remotes setting to add just microsoft as that's the only remote I care about PRs for.
Try to create a PR where the source branch is from the fork sbatten in my case.

:bug: => this silently fails. Console logs show that it does not believe the fork is a github repo.

Pushed a change to at least show a notification in this case with an option to configure remotes


How can I know precisely where HoloLens is in 6DoF space

I went through a HoloLens research mode tutorial where it says that "the application can know precisely where HoloLens is in 6DoF space at each sensor frame capture time."
I was wondering if such function is already provided in Hololens, or we have to develop our own solution with the help of research mode sensor streams.
Here is the link to the tutorial,
https://docs.microsoft.com/en-us/windows/mixed-reality/research-mode#using-sensor-data-in-your-apps

Please, have a look at the sample applications on Github that use the research mode API of HoloLens: https://github.com/Microsoft/HoloLensForCV/. Hope this answers your question.

Thank you so much, Johannes. I really appreciate your reply.
I went through this tutorial in which it uses C# and Unity.
I have several questions,

Is it possible to use the research mode sensor streams in C#? Is there any available related tutorials and documentations?
How can I build/use the sample? I tried to run the SensorStreamViewer sample. Since there is no .sln file, how can I load the whole project into the Visual Studio 2017?

Again, thank you so much!

It should be possible to use the API from C# as well, but you would have to rebuild the entire set of convenience functions / wrappers in the HoloLensForCV project yourself. Otherwise, you could create an interop layer to the already existing C++ code.
Open the HoloLensForCV solution and deploy the project to the HoloLens. For more information, have a look at the tutorials/ files.

@TooSchoolForCool I made an application in Unity that takes the raw HoloLens data and then rebuilds the space in VR using discrete "scans". The only thing that absolutely must be done in C++ is the opaque HoloLensCameraIntrinsics structure, and its methods. Otherwise, almost everything has a direct C# counterpart.


Question about .ToObject() method.

Hi!
I have this config file:
[Person]
Name = Foo
Age = 234
Gender = Male

In the code there are entities:
public class Person
{
	public string Name { get; set; }
	public int Age { get; set; }
	public Gender Gender { get; set; }
}

public enum Gender
{
	Male,
	Female
}

Main method:
var config = Configuration.LoadFromFile(@"....config.cfg");
var obj = config["Person"].ToObject<Person>();

When i invoke .ToObject<Person>(); this method throw exception:
SharpConfig.SettingValueCastException:
Failed to convert value 'Male' to type cfg.Gender; no converter for this type is registered. --->
System.NotImplementedException: no converter for this type is registered.
   --- End of inner exception stack trace ---
   at SharpConfig.Setting.CreateObjectFromString(String value, Type dstType)
   at SharpConfig.Setting.GetValue(Type type)
   at SharpConfig.Section.SetValuesTo(Object obj)
   at SharpConfig.Section.ToObject[T]()
   at cfg.Program.Main(String[] args) in C:\....\Program.cs:line 19

If i remove 'Gender' field, all works perfect. Looks like a bug :)

Hey rdcm, have you tried using the latest source code of SharpConfig, or is this with version 3.0.1?
This bug was fixed with commit 95a3962. I'll release a version soon.

Yes, i use latest NuGet package version 3.0.1.
Ok, thanks, will be wait update :)

Fixed with version 3.1.0!


Make fileExists and checkJobStoreFileID atomic (resolves #320)

The fileExists method is required by the abstractJobStore class and so cannot be private. The method behaves as before, just without the race condition

Oops, you are right.


Optimize with WebAssembly

Using webAssembly on heavy task of the library

I think this is super important, from our testing Quagga is super slow on mobile devices.

I don't want to detract from people who want to make it faster, because I'm all for speed, but on my Nexus 5, it is much faster than other barcode detectors I've used from  the app user perspective.

My point of reference are Obj-C/Java native app bar code scanner libraries.


customRegex as object

Hi,
I saw at master that I can use an object for customRegex. I was happy, because I searched a way to add prefix to some translation keys:
$stateProvider.state( /* i18nextract */ 'stateName', {
  ...
}

stateName should save as "navigation.state.statename".
So I added the following to the i18nextract options:
i18nextract: {
  default_options: {
    ...
    namespace: true,
    customRegex: {
      '\\/\\*\\s*i18nextract navigation-state\\s*\\*\\/\\s\'((?:\\\\.|[^\'\\\\])*)\': function(key) {
        return 'navigation.state.' + key;
      }
    }
  }
}

But that doesn't work. So I searched at the src of grunt-angular-translate, what I did wrong. So I found out, that this.data.customRegex is an empty object, when an object is set as customRegex.
I am not familiar with grunt task developing, so I can't find the failure. What do I do wrong?
When is it planed to build a tag with that new feature?
Thank you
edit:
I use windows 10,
node 4.4.0
grunt 0.4.5

Hey @Ulrikop
I'm currently in a trip with an Indian connection so I'll not be able to take care of this issue.
I'll let you know ASAP what's going on.
My first insight:

v0.3.0 is an old version (pushed 23th, February 2015)
master got a lot of updates but there is still a refactor in progress (move core-lib to https://github.com/Boulangerie/angular-translate-extract and use it into this grunt plugin)

So the plan is for April:

Finish refactoring https://github.com/Boulangerie/angular-translate-extract
Move this project to https://github.com/Boulangerie/grunt-angular-translate
Create https://github.com/Boulangerie/gulp-angular-translate

Ohhh, f***
I found my problem. It was a configuration mistake. Sorry, sorry, sorry.
But i played around a little bit with the customRegex option and now I have a feature wish :-)
First: Can the customRegex get the match object (r in the src) as additional parameter? So the custom regex can use more match groups.
Second: Can the customRegex return more keys as array?
Scenario: For some of my (ui.router) states I use the same template. All have a title and a description:

  {{ 'state.' + stateName + '.title' | translate }}

  {{ 'state.' + stateName + '.description' | translate }}

I want to use the state declaration for the i18n extraction. Therefore I add an enhanced version of the comment regex, so I can specify a prefix (here state) and optional one or more suffixes.
Here is the state declaration with the comment:
$stateProvider.state( /* i18nextract state[title,description] */ 'stateName', {
  ...
}

My customRegex:
customRegex: {
  '\\/\\*\\s*i18nextract\\s*(\\w+(?:\\.\\w+)*)(?:\\[(\\w+(?:\\.\\w+)*(?:,\\w+(?:\\.\\w+)*)*)\\])?\\s*\\*\\/\\s\'(\\w+(?:\\.\\w+)*)\'': function(_, match) {
    var key = match[3];
    var prefix = match[1] + '.';

    if (match[2] === undefined) {
      return prefix + key;
    } else {
      var keys = [];

      match[2].split(',').forEach(function(suffix) {
        keys.push(prefix + key + '.' + suffix.trim());
      });

      return keys;
    }
  }
}

For that the _extractTranslation function must be changed in some places.

The call of the function of custom regex must get the regex match as second parameter:
 translationKey = customRegex[regexName](translationKey, r) || translationKey;

The translationKey can be a single string or an array with strings now. So the single string will be wrapped in an array and the call of defaultValueByTranslationKey must be inside a for each loop:
 if (!_.isArray(translationKey)) {
   translationKey = [translationKey];
 }

 _.forEach(translationKey, function(key) {
   // Avoid empty translation
   if (key === "") {
     return;
   }

   // Ternary operation
   var ternaryKeys = _extractTernaryKey(key)
   if (ternaryKeys) {
     _.forEach(ternaryKeys, function(v) {
       defaultValueByTranslationKey(v);
     });
   } else {
     defaultValueByTranslationKey(key, translationDefaultValue);
   }
 });

The check to avoid empty translation is inside the for each loop now. It would be an improvement in the current version too. An empty string returned from the customRegex function is ignored at the moment. (Perhaps, an additional check for the type === string would be good, to avoid that the customRegex function returns something wrong).


xxxChanged Method behaves differently in Dart and built JS

 Issue by zoechi
Originally opened as dart-lang/sdk#15460

What steps will reproduce the problem?
1.
Create a custom element.
Add a member without default value:
@published String value;
2.
Change the value in ready() to non-null.
3.
run in Dartium
run pub build and run in Chrome
valueChanged is called

in Dart once and value has the non-null value set in ready.
in JS twice where at the first call value is still null.

What is the expected output? What do you see instead?
valueChanged should only be called once when the value is actually changed in JS like in Dart.
What version of the product are you using? On what operating system?
Dart VM version: <IP_ADDRESS>_r30821 (Tue Dec  3 12:51:29 2013) on "linux_x64"
Please provide any additional information below.
The polymer-cookie is a simple custom element where this hit me
https://github.com/ErikGrimes/polymer_elements/blob/master/example/polymer_cookie.html
https://github.com/ErikGrimes/polymer_elements/tree/master/lib/polymer_cookie

 Comment by sgjesse

Added Area-Polymer, Library-Polymer, Triaged labels.

 Comment by zoechi

Additional Info:
in polymer-cookie I have added a null-check in the save() method (called from valueChanged) to prevent the exception in JS "the null object has no member ..." or similar

 Comment by jmesserly

Removed Area-Polymer label.
Added area-pkg, Pkg-Polymer labels.

 Comment by sigmundch

Seems that this is working correctly now in polymer 0.11.0.

Added Fixed label.

 Comment by jmesserly

Removed Library-Polymer label.


Version 5.6 wont open on Mac Os Catalina. How i can downgrade? Or someone can send me older installer?

Hi guys i used to work very fine with a previous version of UVR (I gues it was 5.0 ) but yesterday i upgraded to 5.6.
After the installation the app never open.
Someone can help me with sending the older installer? cuz i cant find it and i dont have it anymore.
Thanks

Hi guys i used to work very fine with a previous version of UVR (I gues it was 5.0 ) but yesterday i upgraded to 5.6. After the installation the app never open. Someone can help me with sending the older installer? cuz i cant find it and i dont have it anymore. Thanks

Having the same issue.


Error in request.raw_input_contents.extend([input_bytes])

System:
TritonInferenceServer:20.6 - nvcr.io/nvidia/tritonserver:20.06-py3
whl file for grpc client - tritongrpcclient-2.0.0-py3-none-any.whl
Hello,
    def prepare_request(self, img):

        request = grpc_service_pb2.ModelInferRequest()
        request.model_name = self._MODEL_NAME
        request.model_version = self._MODEL_VERSION
        output = grpc_service_pb2.ModelInferRequest().InferRequestedOutputTensor()
        output.name = "vgg0_dense2_fwd"
        request.outputs.extend([output])

        input = grpc_service_pb2.ModelInferRequest().InferInputTensor()
        input.name = "data"
        input.shape.extend([1, 3, self._IMAGE_HEIGHT, self._IMAGE_WIDTH])
        request.inputs.extend([input])

        image_data = []
        image_data.append(self.vgg16_preprocess(img))
        input_bytes = image_data[0].tobytes()
        request.raw_input_contents.extend([input_bytes])

        return request

I am trying to prepare a request object and pass the input_bytes to the request object as follows
request.raw_input_contents.extend([input_bytes])
I am getting Attribute error : raw_input_contents
I looked into the file https://github.com/NVIDIA/triton-inference-server/blob/master/src/core/grpc_service.proto but I am not able to use it.
Please let me know how I can resolve this error?

raw_input_contents was added recently into the master with PR #1812.  r20.6 gRPC service proto(link) doesn't have raw_input_contents, but a nested raw_contents field inside InferTensorContents message. Please refer to this example for writing clients for 20.06.
The more performant message format will be available in our 20.08 release.


Initialize with components

Project requirements

Setup a new React application using Create React App
Create a directory for your reusable components: /components.
Install React Router
Setup your router inside of <App>
Add 2 routes in your application:

/, which contains

A book list, where each book has a title and author
A form that allows for creating a new book

/categories

This should display a button that checks for a status

Include a navigation component that includes links to the 2 routes you created

IMPORTANT in the design you can see an input for a category - please replace it with an author.
Note: Styling is NOT required at this state

thanks for your time


Fix spelling

Thanks for the PR! We'll get you a review soon. Can we show you some appreciation for the contribution?
Apparently we are really bad spellers!


Live Preview Mode

Hi,
The plugin does not work when live preview is on - even for inline latex which is not previewed live.
The live preview is experimental and depends on a new version of CodeMirror, so it is understandable that the same plugin may not work for the new version, but I'm actively using this feature and really miss the functionality provided by your plugin.
Looking forward to using it in live preview mode too!

Have you tried codemirror options?
This enables some of the live preview features on the 'classic' mode without breaking this plugin

@infinityiowastaken  thank you so much, I was about to suggest the same thing too ! XD
@richukuttan thank you so much for bringing up this issue! I have gotten my copy of Catalyst and the insider build, and varified the issue too.
Indeed, it seems like a big change in the backend CodeMirror, which I suppose might really take some time to figure out what was the actual issue...
It might really take me a long while to work it out. In the mean time, as suggested by @infinityiowastaken, the codemirror options plugin does do a great job in creating this WYSIWYG editor environment and latex preview without breaking the quick latex plugin. :)

That's a sweet plugin that I was never aware of. To think that I could have been enjoying live preview from almost 6 months back :(
Anyway, @infinityiowastaken, thanks for alerting me to this option. I'll try disabling Obsidian's builtin live preview and using this plugin!
@joeyuping, the plugin recommends switching over to the Obsidian builtin once it becomes stable, so I hope that by the time a general (non-catalyst) WYSIWYG obsidian build is ready (which'll probably take months), the plugin is ready for the switch.
Thanks again to both of you!


What have I done wrong ?

Hey !
I'm starting with Reflux, so I made an easy "application" to try it out. But I can't make it work, and I don't know why.
So, I have three files : actions.js, store.js, component.jsx.js.
I'm working with Browserify, I don't know if there is any sort of connection to my problem. My files are bundled into the main.js.
/ ...
/ index.html
/ main.js
/ js
... / actions.js
... / store.js
... / components.jsx.js
Actions.js
This is my actions.
(function() {
  'use strict';

  var Reflux = require('Reflux');

  var actions = Reflux.createActions([
    'create',
    'destroy'
  ]);

  module.exports = actions;
})();

Store.js
This is my store.
(function() {
  'use strict';

  var Reflux = require('Reflux');

  var store = Reflux.createStore({
    listenable: require('./actions'),

    onCreate: function(){
      console.log('Creating...');
    },
    onDestroy: function(){
      console.log('Destroying...');
    }
  });

  module.exports = store;
})();

Components.js
This is my component.
(function() {
  'use strict';

  var React = require('React');
  var actions = require('./actions');

  var TodoList = React.createClass({
    _handleClick: function() {
      console.log('Handling call...');
      actions.destroy();
    },

    render: function() {
      return (
        <button onClick={this._handleClick}>Todo Hello</button>
      );
    }
  });

  module.exports = TodoList;
})();

My problem
My goal is to display the console.log('Destroying...') when clicking on the button.
But, I'm only getting console.log('Handling call...')and no error.
What am I doing wrong ? Did I forget something ?

Okay, I feel silly now.
My mistake were in the Store.js. I had a typo listenable instead of listenables.
Sorry for this issue.


Bump version to <IP_ADDRESS>

@sestrella LGTM

@jsl since this is a minor change I'm going to go ahead and merge it, in order to push the changes to hackage


pkg : add apparmor user-mode package

Add apparmor_parser to load apparmor profiles on-boot. This should get merged after #3242.

Should it be documented?

There are three yetus/codespell comments which we'll ignore since they are bogus (2x) or on code we copied from elsewhere (1x).

What is the size increase for the EVE rootfs as a result of adding this package?

What is the size increase for the EVE rootfs as a result of adding this package?

3+ mb increase :
shah@dev:~/eve$ ls -alh dist/arm64/0.0.0-master-bbce6255/installer/rootfs.img
-rw-rw-r-- 1 shah shah 183M Jun  7 11:30 dist/arm64/0.0.0-master-bbce6255/installer/rootfs.img
shah@dev:~/eve$ ls -alh dist/arm64/0.0.0-pkg_apparmor-715db30f/installer/rootfs.img
-rw-rw-r-- 1 shah shah 186M Jun  7 11:36 dist/arm64/0.0.0-pkg_apparmor-715db30f/installer/rootfs.img


[Enhancement] Add Egeria React UI Dojo content

Is there an existing issue for this?

[X] I have searched the existing issues

Current Behavior
No dojo content
Expected Behavior
Add documentation for React Ui for Dojo
Alternatives
No response
Any Further Information?
No response
Would you be prepared to be assigned this issue to work on?

[X] I can work on this

Should this be moved to egeria-docs (possibly closed?)


Invalid EAN13 image generation?

I have a barcode<PHONE_NUMBER>005. I tried to generate an image from it
Same as example
let barcode = EAN13::new("2000926398005").unwrap();
let png = Image::png(50);
let encoded = barcode.encode();

let bytes = png.generate(&encoded[..]).unwrap();

let file = File::create(&Path::new("my_barcode.png")).unwrap();
let mut writer = BufWriter::new(file);
writer.write(&bytes[..]).unwrap();

Expected image:

Last - 1 fat, 2 thin
Barcoders generated image:

Last - 2 fat, 3 thin
Barcoders generated images is not scannable

I tried values from test but...

Scanned barcode is not the same/ It has a 9 at the end

I have a similar issue with EAN8 codes. In my experience, dropping the last digit (the checkdigit) provides a workaround.
let ean = "200092639800";
let barcode = EAN13::new(ean).unwrap();

The above code outputs this barcode, which seems to match yours. Scanning it returns<PHONE_NUMBER>005 too.

Workaround is found. Don't think that providing barcodes without chechdigit is a good idea. Maybe EAN13::with_check_digit(ean) needed.
Closing for now


Adapt modules to the nf-core structure

Description of feature
Adapt local modules to the nf-core structure:
module_name
├── environment.yml
├── main.nf
├── meta.yml
└── tests
    ├── main.nf.test
    ├── main.nf.test.snap
    └── tags.yml

The dir tests shouldn't be there if tests are not implemented yet.

Closed in favor of #194


Errors while using EKF

TL;DR
I encountered some errors while using the EKF filtering for performing BIP inference both from my code and from the minimal.py example that is provided. The corresponding fixes can be seen in the commit: souljaboy764/intprim@4ab692c80deceb898e73941f7f3c69ecd7d54664
Long Version:
I was trying to use the EKF filter for performing the performing inference with the BIP, but was getting the following error:
  File "build/bdist.linux-x86_64/egg/intprim/bayesian_interaction_primitives.py", line 298, in generate_probable_trajectory_recursive
  File "build/bdist.linux-x86_64/egg/intprim/filter/spatiotemporal/ekf.py", line 157, in localize
  File "build/bdist.linux-x86_64/egg/intprim/filter/spatiotemporal/nonlinear_system.py", line 109, in get_measurement_model
  File "build/bdist.linux-x86_64/egg/intprim/basis/basis_model.py", line 91, in get_weighted_vector_derivative
IndexError: invalid index to scalar variable.

I thought it might have been an issue in my code but I was getting this issue even when I was running minimal.py with the EKF filter. I am getting the issue in both python2 and python3.
The stack trace shows the error in basis_model.py in the get_weighted_vector_derivative function at the following line:
https://github.com/ir-lab/intprim/blob/8994b158c3f1306be7f9d6304b370d70e2c257fb/intprim/basis/basis_model.py#L91
On reading the docstring of the function, it says:that x should be a scalar value:
https://github.com/ir-lab/intprim/blob/8994b158c3f1306be7f9d6304b370d70e2c257fb/intprim/basis/basis_model.py#L78
I am able to resolve this issue with dropping the index used for x and the line now looks like:
        basis_func_derivs = self.get_basis_function_derivatives(x)

After fixing the above, I get the next error:
  File "build/bdist.linux-x86_64/egg/intprim/bayesian_interaction_primitives.py", line 298, in generate_probable_trajectory_recursive
  File "build/bdist.linux-x86_64/egg/intprim/filter/spatiotemporal/ekf.py", line 157, in localize
  File "build/bdist.linux-x86_64/egg/intprim/filter/spatiotemporal/nonlinear_system.py", line 110, in get_measurement_model
  File "build/bdist.linux-x86_64/egg/intprim/basis/basis_model.py", line 50, in get_block_diagonal_basis_matrix
ValueError: could not broadcast input array from shape (8) into shape (8,1)

On looking further, I saw that the phase value x passed to the get_block_diagonal_basis_matrix function in basis_model.py is a scalar value, which is used here:
https://github.com/ir-lab/intprim/blob/8994b158c3f1306be7f9d6304b370d70e2c257fb/intprim/basis/basis_model.py#L48
The docstrings of the get_basis_functions function for all the different basis functions state that the shape of the return value would be shape(degree, ) if x is a scalar. so I am able to fix this by expanding the dimensions of the value returned by the function:
        basis_funcs = self.get_basis_functions(x)
        if np.isscalar(x):
            basis_funcs = basis_funcs[:, None]

Since this is the same case in the get_block_diagonal_basis_matrix_derivative function, I felt a similar change there would fit.
The next error I get is:
  File "build/bdist.linux-x86_64/egg/intprim/bayesian_interaction_primitives.py", line 298, in generate_probable_trajectory_recursive
  File "build/bdist.linux-x86_64/egg/intprim/filter/spatiotemporal/ekf.py", line 157, in localize
AttributeError: 'GaussianModel' object has no attribute 'inverse_transform'

which is basically this line:
https://github.com/ir-lab/intprim/blob/8994b158c3f1306be7f9d6304b370d70e2c257fb/intprim/filter/spatiotemporal/ekf.py#L157
After digging further, I saw that the only use of inverse_transform is for the scalers and not for any basis functions. Maybe it is from a previous version? I changed that part of the code to how it is in kf.py:
            predicted_measurement = np.dot(measurement_model[:,self.system_size:], self.state_mean[self.system_size:])

thank you, that helps me a lot!


Factory traits

Traits let you have different "versions" of a factory:
// factories/post.js
import { Factory, trait } from 'ember-cli-mirage';

export default Factory.extend({

  title: 'Lorem ipsum',

  published: trait({
    isPublished: true,
    publishedAt: '2010-01-01 10:00:00'
  }),

  withComments: trait({
    afterCreate(post, server) {
      server.createList('comment', 3, { post });
    }
  })

});

Invoke traits during server.create, by passing in a variable-length list of trait names:
let defaultPost = server.create('post');
let publishedPost = server.create('post', 'published');
let postWithComments = server.create('post', 'withComments');
let publishedPostWithComments = server.create('post', 'published', 'withComments');

You can still pass in overrides, by passing in an object as the last argument:
let publishedPost = server.create('post', 'published', { title: 'Rails is omakase' });

I will give it a try this weekend if nobody has started working on traits yet, definitely a super useful feature.

Would be amazing!
Some folks had asked about a chaining API instead, but I can't think of one I like.

@Azdaroth @samselikoff yes, I think https://github.com/samselikoff/ember-cli-mirage/pull/849 is better.
You want to write real-life-like scenario for your seed-data, and this has to be flexible to encompass multiple cases / trees: so server.create('customer').hasOne('premise').hasNo('energyAccount').hasOne('serviceAccount').hasOne('appointment', attrsForAppointment) really seems the natural way to go

Factories are responsible for defining and creating seed data for attributes
Models are responsible for defining and creating relationships

What's wrong with that?

Maybe I got too much used to using factory_girl, but still I would say traits are more natural to work with and the API is less complex, they work just as an extra extensions.
At the end of the day, I think the difference between working with traits and chaining API would be  server.create('article', 'withComments', 'published') vs server.create('article').withComments().published(). Not really sure if it's a good idea to have this setup split between the factories and  the models, it forces you to check both factory and the model if you want to understand what is actually handled where. For the associations I certainly see some benefits like ability to pass overrides instead of doing it in afterCreate hook, but something like published which doesn't handle associations, but only adds some extra attributes, definitely looks like some trait that should belong to factory.

@Azdaroth I would say nothing stops us from having traits for simple scenarios, and model hooks for bigger trees (not many hooks, only hasOne, hasMulti, hasNone and probably and init hook). Let's see what @samselikoff thinks, I can always use my fork of ember-cli-mirage but I's rather see this in the master branch as it really feels like a must-have to me.

I spent some time trying to think of a chained API so we don't just cargo-cult factory_girl, but I couldn't think of one that doesn't introduce breaking changes. The problem with
server.create('post').hasMany('comments')

is that server.create('post') currently returns a post model. So, the above API would be a breaking change, as server.create('post') would need to return something like a factory instance, then we'd need to unwrap it to return the actual model:
server.create('post')
  .hasMany('comments')
  .hasOne('author')
  .value();

I then thought of how we could add traits as pure functions, the way ExMachine works, something like
// factories/post.js
export default Factory.extend({
  title() {
    return faker.lorem.sentence();
  },

  traits: {
    published(post, server) {
      post.update('isPublished', true);
    },

    withComments(post, server) {
      server.createList('comment', 3, { post });
    }
  }
});

but alas JS has no types or piping, and this sucks:
published(withComments(server.create('post')))

(not to mention those traits would need to be imported). Tried to think of a lot of other things but ultimately couldn't think of anything else without breaking API. We could add (now or eventually) another object that lets you chain:
factory.create('post').published().withComments()

but, yeah. Not backwards-compat.
One last point, just adding the .hasMany and .hasOne to the server.create layer, I'm not 100% I like, because traits are supposed to encourage developers to encapsulate logic within their factories, and keep irrelevant object-graph knowledge outside of their tests. So from that perspective, I like keeping server.create underpowered, to encourage devs to write domain-meaningful traits.

235945de3f421f3dbd383dcb8676505079cac6ec closes


Put back fCnt in ChirpStack v4

Hi ChirpStack team,
I remember in ChirpStack v3, we have fCnt in the Web GUI.
This is removed in ChirpStack v4. We have to click on the (+) to see the fCnt.
The fCnt is very useful to monitor if any packets are lost or if the device has been rebooted.

So I think it is useful to bring fCnt back in the above GUI.
Thanks a lot and have a nice day.

@IoTThinks this has been implemented by the above commit :)

@brocaar I tested just now. Confirmed working.
Thanks a lot.