Pick a license?

Regarding:

Licensing; unsure how to proceed here; original's says to "Redistributions in binary form must reproduce the above copyright notice" - but I'm not "redistributing" it, I'm distributing my rewriting of it

The original code is published under a 2-clause BSD, so basically you are free to chose your license. It would be great if you can pick one, because code without a license on GitHub is a gray area (impossible to use / contribute) -- ideally something similar like BSD/MIT/Apache :wink:

If I am free to pick a license, I'll probably make it MIT; I'll double-check the details and add a license upon first release.
Would you know what the case is with significantly reformatting original code? I've already added optimizations, and there may be significant changes via fixes to CWT, to the point of part of the codebase not at all resembling the original. I'm guessing I should still credit the original as long as a substantial portion of code resembles original - but unsure where the line is drawn. Not that I'm against crediting, but I'd rather not have a license banner in every single file.

I am also no expert, but from my understanding all you have to do is add the BSD license text somewhere in the repo. At least that is what I have seen in other repositories, which had some third_party or licenses subfolders containing the original license texts and clarifications/credits.
In terms of source code modifications you are free to do anything to my knowledge.
Speaking of modifications: Keeping the original comments may be a bit confusing, e.g. the MEX stuff, which probably doesn't apply to the Python port. I was wondering if it makes sense to use a short prefix for "original comments" to make it clear whether a comment like "this is X times faster" applies for the Python version or comes from the original?

@bluenote10 Noting specific differences relative to original may introduce much clutter/burden, especially as further fixes/optimizations are added, but I'll be sure to note key points somewhere (README or summarized in docstrings). Regarding MEX and MATLAB-specific stuff, good call - I'll double-check that comments make sense within Python.

Release delayed - found new material, and more things to test. The good news is, by the end, we may have the best open-sourced CWT, possibly beating MATLAB's. Think I'll be writing a wavelet testing suite for comparing performance in various scenarios.
If you're familiar with relevant theory and are willing to contribute, let me know; everything other than the forward CWT will need work that I won't be nearly as invested into, but can guide development for.

As written on stackexchange I am following this with great interest and can only applaud your progress so far.
I have quite significant time constraint right now but will at the very least test your next release as soon as it is available on some medical data that worked well (and sometimes not so well) with matlab. Might be able to give you some comparisson plots by then if there's interest.
I saw your post on boundry effects on the CWT and agree that it would be where I noticed differences with your version so far. Might also be on my end though as I haven't had the time to look it over properly yet.
Looking forward to the next update!

@DavidBondesson1 Sounds great, I'd appreciate tests on real data. If you're able to share code (doesn't have to be polished) and data with me, MATLAB or otherwise, I may add it to the testing suite.

I am happy to share anything I can.
I will discuss what data I can share when I am back on site at work at the end of next week. I can likely share some 1-D time signals as long as they are properly anonymized.
Additionally, I also went through the matlab toolbox and reimplemented their frequency ridge tracking algorithm with penalty for frequency jumps. It isn't a lot of code but if I have permission from work I would be happy to share that too as an add-on for the toolbox (or just give a detailed instruction for easy implementation)

I'm certainly no expert in the field -- I just started with this topic as a hobby. But if I run into something relevant with my experiments I'll surely report back, and I may assist with Python questions.
Already curious what new material you've found.

@bluenote10 Example faceoff between scipy, pywt, and ssqueezepy on a challenging signal, here. Currently figuring out ssqueezepy's problem with higher scales, which seems to be related to padding scheme used - found material 1 and 2 to that end.
I'm also thinking about making a study guide to understand synchosqueezing and CWT, starting with minimal DSP background. When I first ported this repository, I had such minimum, with my headless chicken "analysis". It'd help users to have a minimal yet comprehensive and intuitive study path. As that's for later, if it interests you, I could link my main sources.

I thought this'd never end - wish Toolbox's authors didn't scatter parts of formulas around to save a tad bit of code space. New motto: if it ain't invert, it ain't work. (eyes at pywt and scipy).
Most of the heavy lifting's behind - I'll continue to actively work on tidying up wavelets, likely using classes, but other than that I personally lack any use for further functionality and won't work on porting them. Whoever's willing is welcome to do so, and I'll validate proposed changes.
For license I'm thinking a permissive Apache, but my basic stance is - credit the repo if using a significant portion of code, as one normally would.

Most of the heavy lifting's behind

Great, congrats on the pre-release ;). I haven't had time to play around with it so far, but hope to do so in a few days. In any case this looks like some stroke of a genius.

I'll continue to actively work on tidying up wavelets, likely using classes, but other than that I personally lack any use for further functionality and won't work on porting them.

What exactly does that mean for the synchrosqueeze part? Just that it is ported "as is", but without much correctness deep dives?

@bluenote10 Synchrosqueezing and CWT, forward and inverse, are fully validated and fixed (as noted in the release) - this is what took forever. (Also added an apparently generally more accurate iCWT than in the toolbox). By "other stuff" I mean things like automated ridge extraction, boundary effect uncertainty curves, etc.

@bluenote10 @DavidBondesson1 Posted a synchrosqueezing explanation, may  follow up and notify here. Feedback welcome, if any.


Split news and views

[x] This pull request has been linted by running npm run lint without errors
[X] This pull request has been tested by running npm run dev and reviewing affected routes
[X] This pull request has been built by running npm run generate without errors
[X] This isn't a duplicate of an existing pull request

Description
To address https://github.com/inclusive-design/wecount.inclusivedesign.ca/issues/89. It includes:

Split the "News and Views" page into two separate pages: "News", "Views";
Clicking on a news item redirects the user to the external news;
Clicking on a views item brings up an internal page showing its content;
Refactored the store to fetch data only once when the website starts;
Add "numOfRecPerPage" in config.js to control the number of records shown for one page. This value applies to news, items and search pages.

Steps to test

Run npm run dev to start the website;
Open the site at http://localhost:3000;
The feature described above should match

This pull request is now up to date and ready for a review.

Thanks for the review, @TeddTech. All comments have been addressed and ready for another look.

@greatislander, thanks for the suggestions. The base path access for "/views" and "/news" are added back. I refactored the code a bit so .vue files at "/views", "/views/page/$pageNum", "/news" and "/views/page/$pageNum" can share the same template.
All comments have been addressed. Ready for another review. Thanks.

Thanks @cindyli!


[BUG] Test_TC_OO_2_3 failure

Reproduction steps
@Jerry-ESP @bzbarsky-apple @chshu @woody-apple @jmartinez-silabs
Test_TC_OO_2_3 starts to fail after merge of PR: https://github.com/project-chip/connectedhomeip/pull/21569
I created two temporary branches where added Test_TC_OO_2_3 into GitHub CI automated tests list:

Just enabled run of Test_TC_OO_2_3:
Result Test_TC_OO_2_3 fail: https://github.com/s07641069/connectedhomeip/actions/runs/3995339817/jobs/6854099416
Branch: https://github.com/s07641069/connectedhomeip/commits/telink_enable_Test_TC_OO_2_3

Enabled run of Test_TC_OO_2_3 and reverted PR https://github.com/project-chip/connectedhomeip/pull/21569 changes:
Result Test_TC_OO_2_3 pass: https://github.com/s07641069/connectedhomeip/actions/runs/4004128687/jobs/6872889075
Branch: https://github.com/s07641069/connectedhomeip/commits/telink_fix_Test_TC_OO_2_3

Mainly problem is on change MoveToLevel command into MoveToLevelWithOnOff here:
        // ...else if newValue is OnOff::Commands::Off::Id...
        // "Move CurrentLevel to the minimum level allowed for the device over the
        // time period OnOffTransitionTime."
        if (useOnLevel)
        {
            // If OnLevel is defined, don't revert to stored level.
            moveToLevelHandler(endpoint, Commands::MoveToLevelWithOnOff::Id, minimumLevelAllowedForTheDevice, transitionTime,
                               chip::NullOptional, chip::NullOptional, INVALID_STORED_LEVEL);
        }
        else
        {
            // If OnLevel is not defined, set the CurrentLevel to the stored level.
            moveToLevelHandler(endpoint, Commands::MoveToLevelWithOnOff::Id, minimumLevelAllowedForTheDevice, transitionTime,
                               chip::NullOptional, chip::NullOptional, temporaryCurrentLevelCache.Value());
        }

Because inside moveToLevelHandler function attribute GlobalSceneControl will be set again into true, but in test expected still false.
    if (commandId == Commands::MoveToLevelWithOnOff::Id)
    {
        uint32_t featureMap;
        if (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS &&
            READBITS(featureMap, EMBER_AF_LEVEL_CONTROL_FEATURE_LIGHTING))
        {
            OnOff::Attributes::GlobalSceneControl::Set(endpoint, true);
        }
    }

Just to change commands back into MoveToLevel will crash new algorithm.
Needs to revert changes from PR fully or rework PR with testing Test_TC_OO_2_3.
Bug prevalence
Whenever I do this
GitHub hash of the SDK that was being used
612fc1c456a0c515289bab1420402d4bb149b394
Platform
core
Platform Version(s)
No response
Anything else?
No response

I still don't think https://github.com/project-chip/connectedhomeip/pull/21569 was the right change to start with, and this is evidence that it's not...  @Jerry-ESP @jmartinez-silabs please take a look?

There was a lot of discussion on that PR and on slack. At the time we came to an agreement and tests and cert were done using that code I am surprised this comes out now. I will revisit Jerry's PR, try the test out again an go through the code. There are a lot of corner cases in those cluster interactions


Add RSS feed so folks can subscribe to the blogpost

Currently the blog post is just static content generated by Hugo. It would be cool if folks could subscribe to get new posts.

My personal blog is static (generated by Pelican) and it has an RSS feed. So there's no reason in principle we can't do this.

I don't know if you guys are aware, but this is already done today.
Nightfall theme generates RSS by default (check https://github.com/LordMathis/hugo-theme-nightfall/issues/16).
If you go to https://rust-bitcoin.org/index.xml you'll see the feed.
Additionally, I've tested with my RSS reader. If you add https://rust-bitcoin.org it will find the RSS feed and render everything OK.


lpminimk3 not working in raspberry pi

I'm trying to use the Launchpad Mini MK3 on a Raspberry Pi 4 and struggle getting it to work.
Installed lpminimk3 using
$ pip install lpminimk3

Running the example gives me the following error:
$ python3 -m lpminimk3.examples.hello
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.9/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/home/pi/.local/lib/python3.9/site-packages/lpminimk3/__init__.py", line 81, in <module>
    from .device import LaunchpadMiniMk3, find_launchpads  # noqa
  File "/home/pi/.local/lib/python3.9/site-packages/lpminimk3/device.py", line 3, in <module>
    from rtmidi import MidiOut, MidiIn
  File "/home/pi/.local/lib/python3.9/site-packages/rtmidi/__init__.py", line 4, in <module>
    from ._rtmidi import *  # noqa
ImportError: libjack.so.0: cannot open shared object file: No such file or directory

After installing the libjack-dev dependency it seems to require a JACK server
$ python3 -m lpminimk3.examples.hello
Traceback (most recent call last):
 File "_rtmidi.pyx", line 1023, in _rtmidi.MidiOut.__cinit__
RuntimeError: MidiOutJack::initialize: JACK server not running?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
   return _run_code(code, main_globals, None,
 File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
   exec(code, run_globals)
 File "/home/pi/.local/lib/python3.9/site-packages/lpminimk3/examples/hello.py", line 21, in <module>
   main()
 File "/home/pi/.local/lib/python3.9/site-packages/lpminimk3/examples/hello.py", line 12, in main
   lp = find_launchpads()[0]  # Get the first available launchpad
 File "/home/pi/.local/lib/python3.9/site-packages/lpminimk3/device.py", line 314, in find_launchpads
   midi_out = MidiOut()
 File "_rtmidi.pyx", line 1025, in _rtmidi.MidiOut.__cinit__
_rtmidi.SystemError: MidiOutJack::initialize: JACK server not running?

After installing jackd and running it using
$ jackd -d alsa

Results in not finding the lp mini:
$ python3 -m lpminimk3.examples.hello
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/pi/.local/lib/python3.9/site-packages/lpminimk3/examples/hello.py", line 21, in <module>
    main()
  File "/home/pi/.local/lib/python3.9/site-packages/lpminimk3/examples/hello.py", line 12, in main
    lp = find_launchpads()[0]  # Get the first available launchpad
IndexError: list index out of range

@pitzer, when I tried building on my Raspberry Pi 4, I got a different error:
$ pip3 install lpminimk3
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting lpminimk3
  Using cached https://files.pythonhosted.org/packages/0f/61/9735eaf4d8aa6d765f5f15483ff3075df7c0799a895a96e617596a405efd/lpminimk3-0.6.2-py3-none-any.whl
Collecting python-rtmidi (from lpminimk3)
  Using cached https://files.pythonhosted.org/packages/fc/fa/9c1dd76467da143a779cc78bac7af0b03447ce18c8918f5aee306a6b3b5c/python_rtmidi-1.5.4.tar.gz
  Installing build dependencies ... done
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python3.7/tokenize.py", line 447, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-qocxoxvz/python-rtmidi/setup.py'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-qocxoxvz/python-rtmidi/

The error shows that python-rtmidi failed to install its build dependencies, so I tried to install it directly on the Pi and got this error:
$ pip3 install python-rtmidi
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting python-rtmidi
  Using cached https://files.pythonhosted.org/packages/fc/fa/9c1dd76467da143a779cc78bac7af0b03447ce18c8918f5aee306a6b3b5c/python_rtmidi-1.5.4.tar.gz
  Installing build dependencies ... done
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python3.7/tokenize.py", line 447, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-ueqee1do/python-rtmidi/setup.py'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ueqee1do/python-rtmidi/

So I believe there may be an issue with python-rtmidi on Raspberry Pi 4.
But then, I tried it on a more recent Raspberry Pi 4 I have and got the following result:
$ pip3 install lpminimk3
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting lpminimk3
  Downloading https://www.piwheels.org/simple/lpminimk3/lpminimk3-0.6.2-py3-none-any.whl (147 kB)
     |████████████████████████████████| 147 kB 226 kB/s
Collecting jsonschema
  Downloading https://www.piwheels.org/simple/jsonschema/jsonschema-4.18.4-py3-none-any.whl (80 kB)
     |████████████████████████████████| 80 kB 457 kB/s
Collecting websockets
  Downloading websockets-11.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (130 kB)
     |████████████████████████████████| 130 kB 3.1 MB/s
Collecting python-rtmidi
  Downloading python_rtmidi-1.5.4-cp39-cp39-manylinux_2_28_aarch64.whl (728 kB)
     |████████████████████████████████| 728 kB 6.0 MB/s
Collecting jsonschema-specifications>=2023.03.6
  Downloading https://www.piwheels.org/simple/jsonschema-specifications/jsonschema_specifications-2023.7.1-py3-none-any.whl (17 kB)
Collecting attrs>=22.2.0
  Downloading https://www.piwheels.org/simple/attrs/attrs-23.1.0-py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 372 kB/s
Collecting rpds-py>=0.7.1
  Downloading rpds_py-0.9.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB)
     |████████████████████████████████| 1.2 MB 6.0 MB/s
Collecting referencing>=0.28.4
  Downloading https://www.piwheels.org/simple/referencing/referencing-0.30.0-py3-none-any.whl (25 kB)
Installing collected packages: rpds-py, attrs, referencing, jsonschema-specifications, websockets, python-rtmidi, jsonschema, lpminimk3
Successfully installed attrs-23.1.0 jsonschema-4.18.4 jsonschema-specifications-2023.7.1 lpminimk3-0.6.2 python-rtmidi-1.5.4 referencing-0.30.0 rpds-py-0.9.2 websockets-11.0.3

The only difference between the two Pis are the Debian versions. The Pi that worked had this for its kernel version and distribution information respectively:
$ uname -a   # kernel version
Linux paw 6.1.21-v8+ 1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

$ lsb_release -a   # distribution information
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

The Pi that didn't work had this:
$ uname -a   # kernel version
Linux colaj 4.19.75-v7l+ 1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux

$ lsb_release -a   # distribution information
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 10 (buster)
Release:	10
Codename:	buster

You may want to check if you have the latest version of the OS. Hope this helps.


Pack IV

! @markhibberd @erikd-ambiata

Up to you whether you want to update that arbitrary instance.
:+1:

👍
/jury approve


(3.0.53) useful to be able to open method browser on selected methods in project browser

recently, I've found it convenient to use the method browser to when writing and reading code ... and when I wanted to be able to "group" the following selected methods into a method browser, I found that I couldn't:

This is quite unclear! I see one selected method in the project browser.  On studying this, I think there is more than one method actually selected.  If including a screenshot it's wise to ensure that important details are visible... otherwise why bother...
I believe this request is to compose a method browser containing a deliberately/arbitrarily selected set of methods by multiple-select in the project list browser method pane.

... Sorry about that ... the picture is meant to illustrate that there is no menu item for opening a method browser on selected methods ...
Contrast with the sunit browser menu item (Browse Methods):


Feature request: Patterned bar plots in CairoMakie

Following up on the discussion from slack, it would be great if similar functionality to this example in GLMakie from 100daysOfMakie could be brought to CairoMakie as well
using Makie, GLMakie, Random
Random.seed!(3)
# patterns
# `'/'`, `'\\'`, `'-'`, `'|'`, `'x'`, and `'+'`
directions = [Vec2f0(1), Vec2f0(1, -1), Vec2f0(1, 0), Vec2f0(0, 1),
    [Vec2f0(1), Vec2f0(1, -1)], [Vec2f0(1, 0), Vec2f0(0, 1)]]
colors = [:white, :red, (:green, 0.5), :white, (:navy, 0.85),:black]
patterns = [Makie.LinePattern(direction= hatch; width = 5, tilesize=(20,20),
    linecolor = colors[indx], background_color = colors[end-indx+1])
    for (indx, hatch) in enumerate(directions)]
fig = Figure(resolution = (1200,800), fontsize = 32)
ax = Axis(fig[1,1])
for (idx, pattern) in enumerate(patterns)
    barplot!(ax, [idx], [idx*(2rand()+1)], color = pattern, strokewidth = 2)
end
ax.xticks = (1:6, ["/", "\\", "-", "|", "x", "+"])
save("strippedPatterns.png", fig)
fig

I'd like to try implementing this, any pointer to a similar PR?

not sure if relevant, but here's the PR that added this to Plots.jl https://github.com/JuliaPlots/Plots.jl/pull/3107

don't think so, this is CairoMakie, for the record:
julia> using CairoMakie

julia> p = Pattern('/');

julia> save("/tmp/f.png", barplot([1],[2], color=p))
ERROR: CanonicalIndexError: getindex not defined for Makie.LinePattern
Stacktrace:
  [1] error_if_canonical_getindex(::IndexCartesian, ::Makie.LinePattern, ::Int64, ::Int64)
    @ Base ./abstractarray.jl:1255
  [2] getindex
    @ ./abstractarray.jl:1235 [inlined]
  [3] _getindex
    @ ./abstractarray.jl:1281 [inlined]
  [4] getindex
    @ ./abstractarray.jl:1236 [inlined]
  [5] attr_broadcast_getindex(x::Makie.LinePattern, i::Int64)
    @ Makie ~/Documents/github/Makie.jl/src/utilities/utilities.jl:164
  [6] macro expansion
    @ ~/Documents/github/Makie.jl/src/utilities/utilities.jl:199 [inlined]
  [7] broadcast_foreach(::CairoMakie.var"#64#65"{CairoMakie.CairoScreen{Cairo.CairoSurfaceBase{UInt32}}}, ::Vector{GeometryBasics.HyperRectangle{2, Float32}}, ::Makie.LinePattern, ::Symbol, ::Int64)
    @ Makie ~/Documents/github/Makie.jl/src/utilities/utilities.jl:185
  [8] draw_poly(scene::Scene, screen::CairoMakie.CairoScreen{Cairo.CairoSurfaceBase{UInt32}}, poly::Combined{Makie.poly, Tuple{Vector{GeometryBasics.HyperRectangle{2, Float32}}}}, rects::Vector{GeometryBasics.HyperRectangle{2, Float32}})
    @ CairoMakie ~/Documents/github/Makie.jl/CairoMakie/src/overrides.jl:84
  [9] draw_plot(scene::Scene, screen::CairoMakie.CairoScreen{Cairo.CairoSurfaceBase{UInt32}}, poly::Combined{Makie.poly, Tuple{Vector{GeometryBasics.HyperRectangle{2, Float32}}}})
    @ CairoMakie ~/Documents/github/Makie.jl/CairoMakie/src/overrides.jl:13
 [10] draw_plot(scene::Scene, screen::CairoMakie.CairoScreen{Cairo.CairoSurfaceBase{UInt32}}, primitive::Combined{Makie.barplot, Tuple{Vector{Point{2, Float32}}}})
    @ CairoMakie ~/Documents/github/Makie.jl/CairoMakie/src/infrastructure.jl:255
 [11] cairo_draw(screen::CairoMakie.CairoScreen{Cairo.CairoSurfaceBase{UInt32}}, scene::Scene)
    @ CairoMakie ~/Documents/github/Makie.jl/CairoMakie/src/infrastructure.jl:192
 [12] backend_show(x::CairoMakie.CairoBackend, io::IOContext{IOStream}, #unused#::MIME{Symbol("image/png")}, scene::Scene)
    @ CairoMakie ~/Documents/github/Makie.jl/CairoMakie/src/infrastructure.jl:396

This should end up in https://github.com/JuliaPlots/Makie.jl/blob/174ef914759b64fdc271a4be26d692b97a5dfa09/CairoMakie/src/primitives.jl#L624 with a LinePattern in color

right now it doesn't call this function at all, I guess one of the function on the current stack trace needs to be replaced by a specialization?

too hard right now because first we probably want to solve:
https://github.com/JuliaPlots/Makie.jl/blob/174ef914759b64fdc271a4be26d692b97a5dfa09/CairoMakie/src/utils.jl#L243-L252

Ah right, poly has it's own backend code.
I don't know Cairo well enough to know how these patterns should be implemented, but I don't think you need to worry about that branch. I assume you either need to make a new branch that transforms the pattern into an image and uses it as a repeated texture like opengl, or that Cairo has some version of hatching/patterns natively that you could use

that branch takes a Matrix (image) pattern as color, I thought it would tile the color for the entire surface, but it's not (as the comment says).
If this branch were to work correctly, I can use it to draw the inside of the bar plot? or I guess this is not the correct way to go about it.

I also didn't find anything in Cairo, judging from https://juliagraphics.github.io/Luxor.jl/stable/reference/api/#Luxor.rule we have to DIY it

https://gist.github.com/Moelf/f68af0015f96f98264194f05c544771d

We could also draw patterns onto a CairoRecordingSurface using Cairo intrinsics (set_line_width, move_to, line_to) and then set those surfaces as the pattern, and simply clip everything which is not within the area by using e.g. cairo_clip with cairo_path_to.  That would make the approach somewhat more flexible and probably render at better resolution in small or vector graphics.

What's the difference between imagesirface and recordingsurface?

@asinghvi17 I can't find any use of CairoRecordingSurface inside Makie, but I think it's much easier if we use pattern_set_extend(pattern, Cario.EXTEND_REPEAT):
https://gist.github.com/Moelf/e380d20b307901a6947881dc163a6c62

julia> p = Pattern('/');

julia> save("/tmp/f.png", poly(Point2f[(0, 0), (2, 0), (3, 1), (1, 1)], color = p))


Create Simplepicbanner.html

Banner created

@suprasinha Thank you for your contribution but I wanted a .PNG file as a banner


Add possibility to send command to tasmota via MQTT

Is your feature request related to a problem? Please describe.
I would like to send command to tasmota via MQTT like "DeepSleepTimer 0". Therfore it is neccacery to use the MQTT topic /cmnd/TASMOTANAME/DeepsleepTime 0
This is currently not possible
Describe the solution you'd like
I would like to be able to also pubilsh cmnd
Describe alternatives you've considered
i could use an origanal MQTT Broker, but then the nice parsind of the topics in json has to be done manually
Additional context
Add any other context or screenshots about the feature request here.

I found a solution. One must just create a stat in the Device with the value. This is then send to cmnd of the Tasmota Device

Hey. i would like to pm you, but this is not possible on github :D
So, how did you manage to send mqtt commands to devices?
I can't get it to work.
cmnd/friendly_name/POWER Toggle for example is funtioning on the console on the tasmota device itself, but not from anywhere else.
The app would like to have this format:
"name": "Back Light",       "setTopic": "lights/hue/00:17:88:01:02:3c:49:f8-0b/set/on",       "getTopic": "lights/hue/00:17:88:01:02:3c:49:f8-0b/get/on",       "onValue": "true",       "offValue": "false"
But i don't get it, how this should look like with my tasmota devices?
Maybe you got an idea?


Initial jit support

Started to work on jit support. TorchScript is a limited statically typed subset of Python and requires some adaptations.
Jit can be configured via jit config flag on module level. Unjittable code parts can be wrapped in @torch.jit.ignore.
This PR contains jit fixes for Resnet backbone.
I've done a benchmark on a K80 GPU for a single image. The Resnet 50 backbone inference time is decreased from ~10-12ms before jitting to ~6ms after jitting.
I'm going to continue incrementally enable jit support for Mask R-CNN architecture.

Thanks for your efforts to add JIT support! Just a reminder that you may need to consider the back compatibility, and keep the original features (such as checkpointing, which is useful for large models).

@hellock , checkpointing is done in native Python code - jit-compiled code can call it. I haven't tested it in train pipeline yet.
Nevertheless jit option is disabled by default and eager execution mode is default one.
Currently TorchScript doesn't support functions with variadic arguments or keyword only arguments.
For optional layers I had either to mark them as a constant or make them nonoptional - like self.downsample attribute is either a nn.Identity instance or a given downsample module instance.

@hellock , I've adapted ResNext for TorchScript as well. And added a couple of doctests with jitting.

I've done a series of steps to be TorchScript compatible and maintain backward compatibility. The steps are described below. @hellock , is it an acceptable route to go?

First I had to get rid of getattr calls and make all module names known during compile time.
Res layers with name prefixes like 'backbone.layer1.' are moved to prefix backbone.res_layers.0. TorchScript supports iteration over constant module list ( self.res_layers ) and unrolls the loop in compile time.
Normalization layers got fixed names like backbone.norm1.
To support backward compatibility I've looked through pytorch load state dict machinery and decided to use load_state_dict_pre_hooks
mmdet doesn't use native nn.Module.load_state_dict method and doesn't support hooks. I've changed the implementation.
At this point I could track compatibility issues loading state dict in strict mode.
load_state_dict_pre_hooks are implemented and I was able to use the snapshot that was done before the changes in this PR.
In JIT mode I had to copy the hooks from nonjitted module instances to WeakScriptModuleProxy instances. The latter wrap compiled modules.
After that I was able to use old state dict with JIT-compiled modules.

Many thanks! This is indeed an important and large PR, and I will try my best to have it merged soon.

@hellock , I've tested against Pytorch 1.3.0, changed the hook restore function to use public API methods.
My current interest is switched to async inference support so I've finished to work on JIT support for now.

Thanks for your excellent job for jit support.
Is there a example of using jit to trace detectors, e.g. TwoStage/SingleStageDetector?
If provided, maybe more people can join to jit support.

@DXist Hi, I tried to use your method（added jit=True keyword arguments to model['backbone'], model['neck'] and model['rpn_head'] in the detector config and these modules were replaced with ScriptModule instances.）, but failed. Could you provide a complete case. Thanks.

@blankWorld do you have error if you jit only backbone component? Do you use Pytorch 1.3+?
I've used config similar to https://github.com/open-mmlab/mmdetection/blob/master/configs/mask_rcnn_r50_fpn_1x.py
Currently I'm focused on https://github.com/open-mmlab/mmdetection/pull/1647 since async inference has higher speed up potential than micro optimizations done via JIT compilation to TorchScript.

@DXist Thank you very much for your reply. I used pytorch1.3.0 and set 'jit=True' in backbone config.
When i used torch.jit.script the ERROR became:
Traceback (most recent call last):
File "./demo/jit_demo.py", line 51, in
main()
File "./demo/jit_demo.py", line 34, in main
jitted = torch.jit.script(model(return_loss=False,**data))
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/init.py", line 1205, in script
qualified_name = _qualified_name(obj)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/_jit_internal.py", line 635, in _qualified_name
name = obj.name
AttributeError: 'tuple' object has no attribute 'name'
I cloned your uploaded mmdetection-712f32a  to my own github project.
The running script I used is in 'https://github.com/blankWorld/mmdetection-jit/tree/master/712f32a/demo/jit_demo.py'.

@DXist  Thank you very much for your reply. I used pytorch1.3.0 and set 'jit=True' in backbone config.
When i used torch.jit.script the ERROR became:
#----------------------------
Traceback (most recent call last):
File "./demo/jit_demo.py", line 51, in
main()
File "./demo/jit_demo.py", line 34, in main
jitted = torch.jit.script(model(return_loss=False,**data))
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/init.py", line 1205, in script
qualified_name = _qualified_name(obj)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/_jit_internal.py", line 635, in _qualified_name
name = obj.name
AttributeError: 'tuple' object has no attribute 'name'
#----------------------------
I cloned your uploaded mmdetection-712f32a  to my own github project.
The running script I used is in 'https://github.com/blankWorld/mmdetection-jit/tree/master/712f32a/demo/jit_demo.py'.

@blankWorld try to script only backbone nn.Module instance - not entire model. Use configuration file for the model and set jit=True in the backbone config.

@DXist OK, I script only backbone nn.Module instance and set jit=True in the backbone config.
with torch.no_grad():
backbone = build_backbone(config.model.backbone)
backbone.eval()
The above scripts ran successfully, but it failed when I called the "backbone.save('./backbone.pt')" script.
#----------------------------
Traceback (most recent call last):
File "./demo/jit_demo.py", line 76, in
main()
File "./demo/jit_demo.py", line 40, in main
backbone.save('./backbone.pt')
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/init.py", line 1559, in save
return self._c.save(*args, **kwargs)
RuntimeError:
Could not export Python function call '_checkpointed_forward'. Remove calls to Python functions before export. Did you forget add @script or @script_method annotation? If this is a nn.ModuleList, add it to constants:
at /home/user/jin/jit/mmdetection-712f32a/mmdet/models/backbones/resnet.py:221:18
def forward(self, x):
if self.with_cp and x.requires_grad:
out = self._checkpointed_forward(x)
~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
else:
out = self._inner_forward(x)
out = self.relu(out)
return out
#----------------------------
I uploaded the script to 'https://github.com/blankWorld/mmdetection-jit/tree/master/712f32a/demo/jit_demo.py'.

TorchScript models have own serialization machinery with API methods torch.jit.save and torch.jit.load. Partially scripted models should use default model.save / model.load mechanism.
_checkpointed_forward calls functions that can't be statically analyzed/scripted and was excluded from scripting. To use model.save you need separate config without enabled jit flags.

Thanks a lot. I have passed the test for the 'ResNet' and 'FPN' modules, but there was an error when I was executing 'RPNHead' module. My configuration is the same as that above and set 'jit=True' in 'rpn_head' config.
#---------------------------------------------
Traceback (most recent call last):
File "./demo/jit_demo.py", line 85, in
main()
File "./demo/jit_demo.py", line 36, in main
rpn_head = build_head(config.model.rpn_head)
File "/home/user/jin/jit/mmdetection-712f32a/mmdet/models/builder.py", line 35, in build_head
return build(cfg, HEADS)
File "/home/user/jin/jit/mmdetection-712f32a/mmdet/models/builder.py", line 15, in build
return build_from_cfg(cfg, registry, default_args)
File "/home/user/jin/jit/mmdetection-712f32a/mmdet/utils/registry.py", line 91, in build_from_cfg
jitted = torch.jit.script(orig)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/init.py", line 1203, in script
return torch.jit.torch.jit._recursive.recursive_script(obj)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/_recursive.py", line 173, in recursive_script
return copy_to_script_module(mod, overload_stubs + stubs)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/_recursive.py", line 95, in copy_to_script_module
torch.jit._create_methods_from_stubs(script_module, stubs)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/init.py", line 1423, in _create_methods_from_stubs
self._c._create_methods(self, defs, rcbs, defaults)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/_recursive.py", line 222, in try_compile_fn
return torch.jit.script(fn, _rcb=rcb)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/init.py", line 1223, in script
ast = get_jit_def(obj)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/frontend.py", line 169, in get_jit_def
return build_def(ctx, py_ast.body[0], type_line, self_name)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/frontend.py", line 198, in build_def
param_list = build_param_list(ctx, py_def.args, self_name)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/frontend.py", line 220, in build_param_list
raise NotSupportedError(ctx_range, _vararg_kwarg_err)
torch.jit.frontend.NotSupportedError: Compiled functions can't take variable number of arguments or use keyword-only arguments with defaults:
at /home/user/jin/jit/mmdetection-712f32a/mmdet/core/utils/misc.py:21:30
def multi_apply(func, *args, **kwargs):
~~~~~~~ <--- HERE
pfunc = partial(func, **kwargs) if kwargs else func
map_results = map(pfunc, *args)
return tuple(map(list, zip(*map_results)))
#---------------------------------------------
I uploaded the script to 'https://github.com/blankWorld/mmdetection-jit/tree/master/712f32a/demo/jit_demo.py'.

@DXist Thanks a million. I have passed the test for the backbone and neck module, but there was an error when i was executing the 'RPNHead' module. My configuration is the same as above, just set 'jit = true' in 'rpn_head' config.
#--------------------------------------------------
Traceback (most recent call last):
File "./demo/jit_demo.py", line 85, in
main()
File "./demo/jit_demo.py", line 36, in main
rpn_head = build_head(config.model.rpn_head)
File "/home/user/jin/jit/mmdetection-712f32a/mmdet/models/builder.py", line 35, in build_head
return build(cfg, HEADS)
File "/home/user/jin/jit/mmdetection-712f32a/mmdet/models/builder.py", line 15, in build
return build_from_cfg(cfg, registry, default_args)
File "/home/user/jin/jit/mmdetection-712f32a/mmdet/utils/registry.py", line 91, in build_from_cfg
jitted = torch.jit.script(orig)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/init.py", line 1203, in script
return torch.jit.torch.jit._recursive.recursive_script(obj)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/_recursive.py", line 173, in recursive_script
return copy_to_script_module(mod, overload_stubs + stubs)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/_recursive.py", line 95, in copy_to_script_module
torch.jit._create_methods_from_stubs(script_module, stubs)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/init.py", line 1423, in _create_methods_from_stubs
self._c._create_methods(self, defs, rcbs, defaults)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/_recursive.py", line 222, in try_compile_fn
return torch.jit.script(fn, _rcb=rcb)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/init.py", line 1223, in script
ast = get_jit_def(obj)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/frontend.py", line 169, in get_jit_def
return build_def(ctx, py_ast.body[0], type_line, self_name)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/frontend.py", line 198, in build_def
param_list = build_param_list(ctx, py_def.args, self_name)
File "/home/user/anaconda3/envs/torch/lib/python3.6/site-packages/torch/jit/frontend.py", line 220, in build_param_list
raise NotSupportedError(ctx_range, _vararg_kwarg_err)
torch.jit.frontend.NotSupportedError: Compiled functions can't take variable number of arguments or use keyword-only arguments with defaults:
at /home/user/jin/jit/mmdetection-712f32a/mmdet/core/utils/misc.py:21:30
def multi_apply(func, *args, **kwargs):
~~~~~~~ <--- HERE
pfunc = partial(func, **kwargs) if kwargs else func
map_results = map(pfunc, *args)
return tuple(map(list, zip(*map_results)))
#--------------------------------------------------
I uploaded the script to 'https://github.com/blankWorld/mmdetection-jit/tree/master/712f32a/demo/jit_demo.py'.

It looks like I committed a fix for this in another PR. Here is a revert of the fix - https://github.com/DXist/mmdetection/commit/da223f618518e475dd8edfdad600c4a55fad5320

@DXist So far, the "rpn_head", "backbone", "neck" and "bbox_head" modules have been successfully used, but there are still some problems with the "SingleRoIExtractor" and "TwoStageDetector". If the downloaded PR is not correct, could you provide a correct PR ? Thank you very much !

@blankWorld I've stopped torch scripting work on rpn_head and decided to look into async inference. All changes I've made are in this PR and in the diff I've mentioned earlier.

@hellock @DXist Thanks for your contributions and is there any plan to update/merge this PR?

@loveunk I see there an opportunity to escape the GIL when inference is multithreaded but currently it's not a priority for me.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

Any news regarding JIT Support ?

This PR is closed since it is too old to be merged. Will have better design and plan to support torch JIT in the future. New PRs are also welcomed!


Documentation Around New Nagios Playbook & Automation

Created documentation  Around New Nagios Playbook & Automation
Fixes #2960
signed off by @lumuchris256

Closing as this content has been superseded and incorporated into #3034