Lost interactive features during MNE Matplotlib integration in to Kivy application

Hi all,
I'm currently trying to integrate MNE functionality in to a Kivy application, the plots display, however, i lose all interactive functionality, i suspect from the Kivy garden matplotlib backend (https://github.com/kivy-garden/garden.matplotlib/blob/master/backend_kivy.py) being called after any mpl_connect requests are made in the creation of the MNE returned figure from the command fig = raw.plot() or fig = mne.viz.raw_plot(raw)
I don't suppose anyone has any recommendations or ideas to reconnect the functionality? My guess is i need to find and import all required functions called by mpl_connect() in the MNE distribution files and call them again in my Kivy application fig.canvas.mpl_connect().
Any help or comments would be greatly appreciated.
Regards,
Liam

Thread Bump
I'm slowly editing my way through the MNE plotting functions to work with Kivy, is it known when rev0.21 will be released?

Currently scheduled for Sept 15th (two weeks-ish)

@LMBooth note that the changes in #7955 will not be part of 0.21 stable release.  They are big changes and will probably get merged into master a few weeks after the release so that we have a long period of time to find and fix bugs before they become part of a stable release.

Thank you @drammock and @larsoner  for clarifying that, i'll keep my eyes peeled for when i can grab a copy and see if it works within a Kivy environment. I'm currently modifying ERP plots to integrate in to an application and about to have a go with the MNE-realtime LSL example to work within Kivy too.

@LMBooth I played around today with allowing to pass a Figure instance to the new version of raw.plot().  My naive attempt was to change the _figure() function in mne/viz/_figure.py to the following:
def _figure(toolbar=True, FigureClass=MNEFigure, **kwargs):
    """Instantiate a new figure."""
    from matplotlib import rc_context
    from matplotlib.pyplot import figure
    title = kwargs.pop('window_title', None)  # extract title before init
    fig = kwargs.pop('fig', None)
    if fig is None:
        rc = dict() if toolbar else dict(toolbar='none')
        with rc_context(rc=rc):
            fig = figure(FigureClass=FigureClass, **kwargs)
    else:
        fig.__class__ = FigureClass
        fig.__init__(**kwargs)
    if title is not None:
        _set_window_title(fig, title)
    return fig

The only other modifications I made were to mne.viz.raw.py to add a fig=None to the signature of plot_raw_alt, and to add fig=fig in the params dictionary in that same function.  All of this "worked" in the sense that it did take an existing figure instance and plot data, annotations, scrollbars, etc. into it, and with the correct layout.  But the interactivity was gone. I confess that it was a fairly quick-and-dirty attempt and I didn't spend a ton of time trying other things, but realistically I can't prioritize getting this working --- I have other development priorities that are grant-related so they can't be bumped. But you're welcome to pick up where I left off and see if you can get it working.  If you succeed, and the changes needed are not too byzantine, I would advocate for getting them merged in after #7955 is merged.

Thank you @drammock  for having a go for me, i'll have a play with this to see if i can get it working without needing to alter too much of the code, i've taken a copy of the current #7955.
Instead of me locally calling the kivy backend in after each matplotlib call, i could just change the backend to use in my .matplotlib/rcsetup file, so there's even less i need to do within the MNE functions, I'm new to Github and making commits so i'll make sure to go through the contributions guide before suggesting any mergers.

I've followed your suggestion above and got the figure loading in to kivy with the new classes and by passing in a created figure, however, same as you i don't have any interactive capabilities. I'll spend tomorrow afternoon on it and see if i can solve the problem 'elegantly'.

def _figure(toolbar=True, FigureClass=MNEFigure, **kwargs):
    """Instantiate a new figure."""
    from matplotlib import rc_context
    from matplotlib.pyplot import figure
    title = kwargs.pop('window_title', None)  # extract title before init
    fig = kwargs.pop('figs', None)
    if fig is None:
        rc = dict() if toolbar else dict(toolbar='none')
        with rc_context(rc=rc):
            fig = figure(FigureClass=FigureClass, **kwargs)
    #else:
        #fig.__class__ = FigureClass
        #fig.__init__(**kwargs)
    #if title is not None:
    #    _set_window_title(fig, title)
    return fig```

Slight other snag, so it seems to be an interactive plot with the raw object returned in raw = mne.io.read_raw_fif(sample_data_raw_file), however, i get an error returned with my raw object from raw = mne.io.read_raw_bdf('test_bdf.bdf')  i assume some functions are still in need of updating?

Can you post the error traceback, and a link to the problematic file?

The traceback is as follows:
 Traceback (most recent call last):
   File "C:\Users\Liam\Documents\python\kivy\screen.py", line 41, in <module>
     TestApp().run()
   File "C:\python37\lib\site-packages\kivy\app.py", line 829, in run
     root = self.build()
   File "C:\Users\Liam\Documents\python\kivy\screen.py", line 39, in build
     return Test()
   File "C:\Users\Liam\Documents\python\kivy\screen.py", line 32, in __init__
     self.fig = plt.figure(FigureClass=MNEBrowseFigure, **params)
   File "C:\python37\lib\site-packages\matplotlib\pyplot.py", line 545, in figur
e
     **kwargs)
   File "C:\python37\lib\site-packages\kivy\garden\matplotlib\backend_kivy.py",
line 374, in new_figure_manager
     thisFig = FigureClass(*args, **kwargs)
   File "C:\python37\lib\site-packages\mne\viz\_figure.py", line 391, in __init_
_
     ax_main=ax, ax_help=ax_help, ax_proj=ax_proj,
 UnboundLocalError: local variable 'ax_proj' referenced before assignment

C:\Users\Liam\Documents\python\kivy>

Here's a link to the bdf file i'm using, i did create the bdf file myself with my own built converter from a separate in house eeg file format we were using, though it can be loaded in to EEGLab with no problems and it works in 0.20 of MNE in and out of Kivy.

That is a bug in init.  I'll push a commit today to fix it.

OK, I've just pushed 52be66c that should fix the error.

Seems to be working great now, i'll keep you posted in case i come across any other issues.

Hi @drammock , i'd like to contribute toward your work on #7955 to allow the passing of figures to plotting functions, would you be okay with me creating a fork and submitting proposed changes?

@LMBooth the best practice would be to fork mne-tools/mne-python (rather than forking drammock/mne-python) and then add my fork as an additional remote.  That will make it easier in the long run to (1) keep mne-python current, and (2) submit your changes as a separate PR (if that turns out to make more sense than rolling it into #7955).  After forking the main repository to your user account via the GitHub website, I would do something like:
$ git clone https://github.com/LMBooth/mne-python.git
$ cd mne-python
$ git remote add upstream https://github.com/mne-tools/mne-python.git
$ git remote add drammock https://github.com/drammock/mne-python.git
$ git fetch --all

Then you would have 3 remotes (origin=your fork, drammock=my fork, and upstream=the main shared codebase).    This setup makes it fairly easy to get new changes I've done without immediately sqashing changes that you've made, e.g.:
$ git fetch drammock
$ git checkout -b drammocks_version drammock/mpl_refactor

it also makes rebasing easy, if needed:
$ git fetch drammock
$ git checkout my_version
$ git rebase drammock/mpl-refactor

Finally, you can set it up as a PR-into-my-PR:
$ git push -u origin my_version
$ # then create a PR from LMBooth/mne-python:my_version into drammock/mne_python:mpl-refactor

Let me know if any of that is confusing or if you hit any roadblocks.  I can't guarantee I'll be willing to merge your changes into #7955 until I've seen the diff --- It's already a monster PR and I want to be kind to the other devs who have to review it.  It may end up making more sense to wait until my PR is merged and do yours as a separate PR into upstream after that, just so the diffs are easier to review.

Thank you so much for explaining that to me Daniel (I'm a total novice to github). I can completely understand not wanting to merge with #7955 due to it complicating the review process. I'll do as you've suggested with the 3 remotes between my own and your forks and the mne main and like you said, save for a separate PR.
I've got the plot_raw_alt function working, when do you expect the psd or epoch functions to have the new figure classes integrated?

when do you expect the psd or epoch functions to have the new figure classes integrated?

hard to say. In principle #7955 could be merged without adding Epoch or ICA support, and those could be separate PRs.  If my colleagues agree we should go that route, it might be merged as soon as a week from now.  If we wait until Epochs and ICA support are finished, and/or the addition of proposed new functionality (click-drag to show a spectrum plot of the selected time span; right-click channel names to show sensor location) then it's harder to predict...  4-6 weeks maybe?

@LMBooth just a note to say that #7955 has been merged into master for a couple weeks now, and appears to be working reasonably well (only a couple minor bugs have had to be addressed so far).  Note that only Raw.plot() is using the new figure class so far; #8381 has Epochs and ICA support mostly working, but will probably be another couple weeks before that's wrapped up and merged.

Comments and feedback are welcome on if this is acceptable and how to move forward.
I've found a return to functionality, i've taken the first half of plot_raw_alt up until the point that the params dict is created and made a new function, return_params to return the params dict, i needed to do this as i believe the issue is when the _figure function is called in the else: when fig is renitialised, it overwrote... something i'm not too sure of yet, so i changed that to the following:
def _figure(toolbar=True, FigureClass=MNEFigure, **kwargs):
    """Instantiate a new figure."""
    from matplotlib import rc_context
    from matplotlib.pyplot import figure
    title = kwargs.pop('window_title', None)  # extract title before init
    fig = kwargs.pop('figs', None)
    if fig is None:
        rc = dict() if toolbar else dict(toolbar='none')
        with rc_context(rc=rc):
            fig = figure(FigureClass=FigureClass, **kwargs)
    #else:
        #fig.__class__ = FigureClass
        #fig.__init__(**kwargs)
    #if title is not None:
    #    _set_window_title(fig, title)
    return fig

Then in the creation of the figure i import the MNEBrowseFigure with the params dict (**kwargs), now i have an interactive plot within a Kivy application. To tidy up, it would be nice to get an empty params dict to pass in the figure creation so i don't have to pass a copy of raw beforehand, though i'm not entirely sure if this is possible yet.
class Test(BoxLayout):
	def __init__(self, *args, **kwargs):
		super(Test, self).__init__(*args, **kwargs)
		sample_data_folder = mne.datasets.sample.data_path()
		sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
											'sample_audvis_raw.fif')
		self.raw = mne.io.read_raw_fif(sample_data_raw_file)
		params = return_params(self.raw)
		self.fig = plt.figure(FigureClass=MNEBrowseFigure, **params)
		canvas = FigureCanvas(self.fig)
		plot_raw_alt(self.raw,  butterfly=False, figs = self.fig)
		self.add_widget(canvas)

I also changed the fig=None to figs=None as i didn't want to confuse myself with the created fig object in the raw_plot_alt function.
The function for return_params was placed in viz.raw.py has not been refined in any form, found below:
_RAW_CLIP_DEF = 1.5
def return_params(raw, events=None, duration=10.0, start=0.0, n_channels=20,
                 bgcolor='w', color=None, bad_color=(0.8, 0.8, 0.8),
                 event_color='cyan', scalings=None, remove_dc=True, order=None,
                 show_options=False, title=None, show=True, block=False,
                 highpass=None, lowpass=None, filtorder=4,
                 clipping=_RAW_CLIP_DEF,
                 show_first_samp=False, proj=True, group_by='type',
                 butterfly=False, decim='auto', noise_cov=None, event_id=None,
                 show_scrollbars=True, show_scalebars=True, verbose=None,figs=None):
    """."""
    from ..io.base import BaseRaw
    from . import browse_figure

    info = raw.info.copy()
    sfreq = info['sfreq']
    projs = info['projs']
    # this will be an attr for which projectors are currently "on" in the plot
    projs_on = np.full_like(projs, proj, dtype=bool)
    # disable projs in info if user doesn't want to see them right away
    if not proj:
        info['projs'] = list()

    # handle defaults / check arg validity
    color = _handle_default('color', color)
    scalings = _compute_scalings(scalings, raw, remove_dc=remove_dc,
                                 duration=duration)
    _validate_type(raw, BaseRaw, 'raw', 'Raw')
    decim, picks_data = _handle_decim(info, decim, lowpass)
    noise_cov = _check_cov(noise_cov, info)
    units = _handle_default('units', None)
    unit_scalings = _handle_default('scalings', None)
    _check_option('group_by', group_by,
                  ('selection', 'position', 'original', 'type'))

    # clipping
    _validate_type(clipping, (None, 'numeric', str), 'clipping')
    if isinstance(clipping, str):
        _check_option('clipping', clipping, ('clamp', 'transparent'),
                      extra='when a string')
        clipping = 1. if clipping == 'transparent' else clipping
    elif clipping is not None:
        clipping = float(clipping)

    # be forgiving if user asks for too many channels / too much time
    n_channels = min(info['nchan'], n_channels)
    duration = min(raw.times[-1], float(duration))

    # determine IIR filtering parameters
    if highpass is not None and highpass <= 0:
        raise ValueError(f'highpass must be > 0, got {highpass}')
    if highpass is None and lowpass is None:
        ba = filt_bounds = None
    else:
        filtorder = int(filtorder)
        if filtorder == 0:
            method = 'fir'
            iir_params = None
        else:
            method = 'iir'
            iir_params = dict(order=filtorder, output='sos', ftype='butter')
        ba = create_filter(np.zeros((1, int(round(duration * sfreq)))),
                           sfreq, highpass, lowpass, method=method,
                           iir_params=iir_params)
        filt_bounds = _annotations_starts_stops(
            raw, ('edge', 'bad_acq_skip'), invert=True)

    # compute event times in seconds
    if events is not None:
        event_times = (events[:, 0] - raw.first_samp).astype(float)
        event_times /= sfreq
        event_nums = events[:, 2]
    else:
        event_times = event_nums = None

    # determine trace order
    ch_names = np.array(raw.ch_names)
    ch_types = np.array(raw.get_channel_types())
    if order is None:
        ch_type_order = _DATA_CH_TYPES_ORDER_DEFAULT
        order = [pick_idx for order_type in ch_type_order
                 for pick_idx, pick_type in enumerate(ch_types)
                 if order_type == pick_type]
    elif not isinstance(order, (np.ndarray, list, tuple)):
        raise ValueError('order should be array-like; got '
                         f'"{order}" ({type(order)}).')
    order = (np.arange(len(order)) if group_by == 'original' else
             np.asarray(order))
    # adjust order based on channel selection, if needed
    selections = None
    if group_by in ('selection', 'position'):
        selections = _setup_channel_selections(raw, group_by)
        order = np.concatenate(list(selections.values()))
        default_selection = list(selections)[0]
        n_channels = len(selections[default_selection])

    # if event_color is a dict
    if isinstance(event_color, dict):
        event_color = {_ensure_int(key, 'event_color key'): value
                       for key, value in event_color.items()}
        default = event_color.pop(-1, None)
        default_factory = None if default is None else lambda: default
        event_color_dict = defaultdict(default_factory)
        for key, value in event_color.items():
            if key < 1:
                raise KeyError('event_color keys must be strictly positive, '
                               f'or -1 (cannot use {key})')
            event_color_dict[key] = value
    # if event_color is a string or other MPL color-like thing
    else:
        event_color_dict = defaultdict(lambda: event_color)

    # handle first_samp
    first_time = raw._first_time if show_first_samp else 0
    start += first_time
    event_id_rev = {v: k for k, v in (event_id or {}).items()}

    # generate window title; allow instances without a filename (e.g., ICA)
    if title is None:
        title = '<unknown>'
        fnames = raw._filenames.copy()
        if len(fnames):
            title = fnames.pop(0)
            extra = f' ... (+ {len(fnames)} more)' if len(fnames) else ''
            title = f'{title}{extra}'
            prefix = '...' if len(title) > 60 else ''
            title = f'{prefix}{title[-60:]}'
    elif not isinstance(title, str):
        raise TypeError(f'title must be None or a string, got a {type(title)}')

    # gather parameters and initialize figure
    params = dict(inst=raw,
                  info=info,
                  # channels and channel order
                  ch_names=ch_names,
                  ch_types=ch_types,
                  ch_order=order,
                  picks=order[:n_channels],
                  n_channels=n_channels,
                  picks_data=picks_data,
                  group_by=group_by,
                  ch_selections=selections,
                  # time
                  t_start=start,
                  duration=duration,
                  n_times=raw.n_times,
                  first_time=first_time,
                  decim=decim,
                  # events
                  event_color_dict=event_color_dict,
                  event_times=event_times,
                  event_nums=event_nums,
                  event_id_rev=event_id_rev,
                  # preprocessing
                  projs=projs,
                  projs_on=projs_on,
                  apply_proj=proj,
                  remove_dc=remove_dc,
                  filter_coefs=ba,
                  filter_bounds=filt_bounds,
                  noise_cov=noise_cov,
                  # scalings
                  scalings=scalings,
                  units=units,
                  unit_scalings=unit_scalings,
                  # colors
                  ch_color_bad=bad_color,
                  ch_color_dict=color,
                  # display
                  butterfly=butterfly,
                  clipping=clipping,
                  scrollbars_visible=show_scrollbars,
                  scalebars_visible=show_scalebars,
                  window_title=title,
				  figs=figs)

    return params

For anyone else interested here is the base main Kivy file (it does require installing Kivy, Kivy-garden and the garden matplotlib extension too):
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
import os
import matplotlib
matplotlib.use("module://kivy.garden.matplotlib.backend_kivy")
from kivy.garden.matplotlib.backend_kivyagg import FigureCanvas
import matplotlib.pyplot as plt
import mne
from mne.viz._figure import MNEBrowseFigure
from mne.viz.raw import return_params, plot_raw_alt
kv = """
<Test>:
	orientation: 'vertical'
	Button:
		text: "MNE Kivy Test Button"
		size_hint_y: None
		height: 40
		on_press: print("testing")
"""
Builder.load_string(kv)

class Test(BoxLayout):
	def __init__(self, *args, **kwargs):
		super(Test, self).__init__(*args, **kwargs)
		sample_data_folder = mne.datasets.sample.data_path()
		sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
											'sample_audvis_raw.fif')
		self.raw = mne.io.read_raw_fif(sample_data_raw_file)
		params = return_params(self.raw)
		self.fig = plt.figure(FigureClass=MNEBrowseFigure, **params)
		canvas = FigureCanvas(self.fig)
		plot_raw_alt(self.raw,  butterfly=False, figs = self.fig)
		self.add_widget(canvas)

class TestApp(App):
	def build(self):
		return Test()
if __name__ == '__main__':
	TestApp().run()```

Hi, now I am using PyQT5 to embed the interactive figure from plot_raw inside a GUI, and I have encountered the same question. I tried to reproduce your work but it seems that mne has changed a lot. For example, there is no return_params and plt_raw_alt in mne.viz.raw. Which version of mne did you use? And any methods to solve the same problem using the latest version of mne?

And I think I get your main idea to solve this problem, which is get the params of the raw data and set up a Figure instance.

No plot_raw_alt now? What's the alternative?

@BarryLiu-97 plot_raw_alt was a temporary function name used during development of the new Figure class in #7955.  Once it was working properly, its name changed to plot_raw and it replaced the old version of that function.  If you want to try out @LMBooth's approach, you can do so in your own fork of current master version, by modifying mne.viz.plot_raw and some of the functions in mne/viz/_figure.py, as described above.
If you find a way of making interactivity work when embedding the result raw.plot() into an existing canvas/GUI, please open a PR to discuss whether the solution is one that is general enough (and does not create too much maintenance burden) to be included in MNE-Python.

Hi, recently I was trying to embed an interactive matplotlib figure into a PyQt5 GUI. I think I have some progress. While here is one sample I think is relevent.
import matplotlib
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
# from matplotlib.backends.qt_compat import QtCore
from PyQt5 import QtCore
from matplotlib.figure import Figure
from PyQt5 import QtWidgets
import sys
import numpy as np

class My_Main_window(QtWidgets.QMainWindow):
    def __init__(self, parent=None):
        super(My_Main_window, self).__init__(parent)

        self.canvas = FigureCanvas(Figure(constrained_layout=True))
        self.canvas.draw()
        self.ax = self.canvas.figure.add_subplot()

        self.con_1 = np.random.random((30, 40, 10))
        self.num = 0
        con_plot = self.con_1[:, :, self.num]
        self.im = self.ax.matshow(con_plot)
        self.ax.set_title(self.num)
        self.canvas.figure.colorbar(self.im)
        self.canvas.mpl_connect('key_press_event', self.on_move)
        self.canvas.mpl_connect(
            "button_press_event", lambda *args, **kwargs: print(args, kwargs)
        )
        self.canvas.mpl_connect(
            "key_press_event", lambda *args, **kwargs: print(args, kwargs)
        )

        self.setCentralWidget(self.canvas)

        # Give the keyboard focus to the figure instead of the manager:
        # StrongFocus accepts both tab and click to focus and will enable the
        # canvas to process event without clicking.
        # https://doc.qt.io/qt-5/qt.html#FocusPolicy-enum
        self.canvas.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.canvas.setFocus()
        print(type(self.canvas))

    def on_move(self, event):
        print(f"activate this {event.key}, {self.num}")
        if event.key == "left":
            if self.num == 0:
                self.num = 0
                con_plot = self.con_1[:, :, self.num]
            else:
                self.num -= 1
                con_plot = self.con_1[:, :, self.num]
        elif event.key == "right":
            if self.num == self.con_1.shape[2] - 1:
                self.num = 0
                con_plot = self.con_1[:, :, self.num]
            else:
                self.num += 1
                con_plot = self.con_1[:, :, self.num]
        else:
            con_plot = self.con_1[:, :, self.num]
        # update the image in place
        self.im.set_data(con_plot)
        self.ax.set_title(self.num)
        # tell Qt that the widget needs to be re-repainted
        self.canvas.draw_idle()

if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    app.setApplicationName("Plot")
    main_win = My_Main_window()
    main_win.show()
    app.exec()

The key part is
self.canvas.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.canvas.setFocus()

so the gui will focus on the events aiming at the canvas. While it doesn't work when I  used it i mne.viz.plot()

I think there is nothing to do for this issue at this point so I'll close, but feel free to comment/reopen if I'm mistaken

@LMBooth I don't know if you're still working on this, but I wonder if the new-ish Matplotlib subfigure feature might be helpful?

Hi again @drammock, i switched my github account so missed your previous tags, i've actually just come back round to doing post analysis again using mne, i've moved away from Kivy and like @BarryLiu97 am looking at integrating the MNE viewer in to a custom PyQt5 data plotter and xdf logger for some custom in-house EEG and ECG devices, i'll have a look at the subfigure feature and see if it's what i'm after.
I'm pretty sure the 0.23 build of MNE should be fine without any modification if the layout you want the canvas to sit in is created after getting the figure from calling raw.plot().
If i get it working I'll post a short working example.

I've just implemented focus settings similar to that discussed by @BarryLiu97 above and i have full functionality of my plots, great stuff!

One issue i am having actually is getting the selected channels from the plot. According to the handling bad channels tutorial, around the section discussing 'Blocking Execution' it states how block should be set to True if you want to mark selected channels as bad.
I've attached a modified example of @BarryLiu97 code to illustrate the problem i'm having:
`from PyQt5 import QtWidgets, QtGui
import matplotlib
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.qt_compat import QtCore
import sys
from mne.datasets import sample
import mne
import os
class My_Main_window(QtWidgets.QMainWindow):
def init(self, parent=None):
super(My_Main_window, self).init(parent)
    sample_data_folder = sample.data_path()
    sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
                                'sample_audvis_filt-0-40_raw.fif')
    self.raw = mne.io.read_raw_fif(sample_data_raw_file)
    self.fig = self.raw.plot(show=False, block=False)

    self.canvas = FigureCanvas(self.fig)
    self.canvas.draw()
    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(self.canvas)
    self.button = QtWidgets.QPushButton('Print Dropped', self)
    self.button.clicked.connect(self.dropButton)
    layout.addWidget(self.button)

    self.stack = QtWidgets.QTabWidget()
    self.stack.setLayout(layout)
    self.setCentralWidget(self.stack)

    # Give the keyboard focus to the figure instead of the manager:
    # StrongFocus accepts both tab and click to focus and will enable the
    # canvas to process event without clicking.
    # https://doc.qt.io/qt-5/qt.html#FocusPolicy-enum
    self.canvas.setFocusPolicy(QtCore.Qt.StrongFocus | QtCore.Qt.WheelFocus)
    self.canvas.setFocus()

def dropButton(self):
    print(self.raw.info['bads'])

if name == 'main':
app = QtWidgets.QApplication(sys.argv)
app.setApplicationName("Plot")
main_win = My_Main_window()
main_win.show()
app.exec()`


Expression Parsing

The expression parser will organize and expression into an interpretation sequence consisting of operator groups and sub-expressions.

This has been build and positive tested.  Needs to be negative (error) tested

error testing done.


Report 0 mementos in the X-Mementos-Count header when none are found

The current implementation returns a 404 but having this redundant information will allow cleaner logic in tools using MemGator.

It should not be difficult to add because the the decision of returning 404 is made based on the total count when it's zero. I have initially intentionally did not include it because it was returning 404 anyway. However, I agree that if a tool is only interested in the memento count, it will be a lot easier to always check just one thing and not add unnecessary conditionals to derive conclusion.

f51db8e6f7156fd7ca91d74c89c4d4503c808fd5 implements this and also limits the X-Memento-Count only to TimeMap requests.

@ibnesayeed Has this been deployed at WS-DL? I still don't get the header:
curl -I http://memgator.cs.odu.edu:1208/timemap/json/matkelly.comxxxx
HTTP/1.1 404 Not Found
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Link, Location, X-Memento-Count, X-Generator
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
X-Generator: MemGator:1.0-rc2
Date: Wed, 04 Nov 2015 16:34:28 GMT
Content-Length: 19

No, it's not released yet, so not running on WSDL machine.

Will this feature be provided in another RC or in the GM (1.0 proper)?

I think we will see more RCs before the stable release. The reason for that are some changes in the router and endpoint naming for the sake of similarity with the LANL service.

:+1:


Hound.SessionServer // (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}

Hello,
As first mentioned in: #49 but now formally as its own issue.
Following this tutorial: https://lord.io/blog/2015/elixir-scraping/
And I'm getting this error:
:ok, []}
iex(2)> Scraper.start
Starting now...

23:11:03.991 [error] GenServer Hound.SessionServer terminating
** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}
    (hound) lib/hound/request_utils.ex:43: Hound.RequestUtils.send_req/4
    (hound) lib/hound/session_server.ex:22: Hound.SessionServer.handle_call/3
    (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4
    (stdlib) gen_server.erl:661: :gen_server.handle_msg/5
    (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:find_or_create_session, #PID<0.168.0>}
State: #HashDict<[]>
** (exit) exited in: :gen_server.call(Hound.SessionServer, {:find_or_create_session, #PID<0.168.0>}, 60000)
    ** (EXIT) an exception was raised:
        ** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}
            (hound) lib/hound/request_utils.ex:43: Hound.RequestUtils.send_req/4
            (hound) lib/hound/session_server.ex:22: Hound.SessionServer.handle_call/3
            (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4
            (stdlib) gen_server.erl:661: :gen_server.handle_msg/5
            (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
     (stdlib) gen_server.erl:212: :gen_server.call/3
    (scraper) lib/scraper.ex:6: Scraper.start/0

With this mix.exs:
defmodule Scraper.Mixfile do
  use Mix.Project

  def project do
    [app: :scraper,
     version: "0.0.1",
     elixir: "~> 1.1",
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     deps: deps]
  end

  # Configuration for the OTP application
  #
  # Type "mix help compile.app" for more information
  def application do
    [applications: [:logger, :httpoison, :hound]]
  end

  # Dependencies can be Hex packages:
  #
  #   {:mydep, "~> 0.3.0"}
  #
  # Or git/path repositories:
  #
  #   {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"}
  #
  # Type "mix help deps" for more examples and options
  defp deps do
    [
      {:httpoison, "~> 0.8.0"},
      {:floki,  "~> 0.7.1"},
      {:hound, "~> 0.7.6"}
    ]
  end
end

Additional information:
I created this test:
defmodule ScraperTest do
  use ExUnit.Case
  use Hound.Helpers

  hound_session

  test "the truth", meta do
    navigate_to("http://example.com/guestbook.html")

    find_element(:name, "message")
    |> fill_field("Happy Birthday ~!")
    |> submit_element()

    assert page_title() == "Thank you"
  end

end

and received this output:

➜  scraper  iex -S test
Erlang/OTP 18 [erts-7.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

** (UnicodeConversionError) invalid encoding starting at <<207, 250, 237, 254, 7, 0, 0, 1, 3, 0, 0, 128, 2, 0, 0, 0, 16, 0, 0, 0, 80, 6, 0, 0, 133, 0, 32, 0, 0, 0, 0, 0, 25, 0, 0, 0, 72, 0, 0, 0, 95, 95, 80, 65, 71, 69, 90, 69, 82, 79, ...>>
    (elixir) lib/string.ex:1418: String.to_char_list/1
    (elixir) lib/code.ex:363: Code.require_file/2

➜  scraper
➜  scraper  a
zsh: command not found: a
➜  scraper  mix test
==> idna (compile)
WARN:  Missing plugins: [rebar3_hex]
==> mimerl (compile)
==> ssl_verify_hostname (compile)
==> poison
Compiled lib/poison.ex
Compiled lib/poison/parser.ex
Compiled lib/poison/decoder.ex
Compiled lib/poison/encoder.ex
Generated poison app
==> certifi (compile)
==> hackney (compile)
==> httpoison
Compiled lib/httpoison/base.ex
Compiled lib/httpoison.ex
Generated httpoison app
==> hound
Compiled lib/hound/helpers.ex
Compiled lib/hound.ex
Compiled lib/hound/connection_server.ex
Compiled lib/hound/matchers.ex
Compiled lib/hound/helpers/session.ex
lib/hound/response_parser_utils.ex:4: warning: unused import Logger
Compiled lib/hound/response_parser_utils.ex
Compiled lib/hound/response_parsers/chrome_driver.ex
Compiled lib/hound/internal_helpers.ex
Compiled lib/hound/request_utils.ex
Compiled lib/hound/response_parsers/phantom_js.ex
Compiled lib/hound/response_parsers/selenium.ex
Compiled lib/hound/helpers/script_execution.ex
Compiled lib/hound/session.ex
Compiled lib/hound/helpers/screenshot.ex
Compiled lib/hound/helpers/window.ex
Compiled lib/hound/helpers/orientation.ex
Compiled lib/hound/helpers/navigation.ex
Compiled lib/hound/helpers/dialog.ex
Compiled lib/hound/helpers/page.ex
Compiled lib/hound/helpers/cookie.ex
Compiled lib/hound/supervisor.ex
lib/hound/matchers/text.ex:67: warning: variable error is unused
lib/hound/matchers/text.ex:69: warning: variable error is unused
Compiled lib/hound/matchers/text.ex
Compiled lib/hound/session_server.ex
Compiled lib/hound/helpers/element.ex
Generated hound app
==> mochiweb (compile)
==> floki
Compiled src/floki_selector_lexer.erl
Compiled lib/floki/combinator.ex
Compiled lib/floki/deep_text.ex
Compiled lib/floki/filter_out.ex
Compiled lib/floki/attribute_selector.ex
Compiled lib/floki/flat_text.ex
Compiled lib/floki/parser.ex
Compiled lib/floki/finder.ex
Compiled lib/floki/selector_tokenizer.ex
Compiled lib/floki.ex
Compiled lib/floki/selector.ex
Compiled lib/floki/selector_parser.ex
Generated floki app
==> scraper
Compiled lib/scraper.ex
Generated scraper app
test/scraper_test.exs:7: warning: variable meta is unused

23:14:36.599 [error] GenServer Hound.SessionServer terminating
** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}
    (hound) lib/hound/request_utils.ex:43: Hound.RequestUtils.send_req/4
    (hound) lib/hound/session_server.ex:22: Hound.SessionServer.handle_call/3
    (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4
    (stdlib) gen_server.erl:661: :gen_server.handle_msg/5
    (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:find_or_create_session, #PID<0.587.0>}
State: #HashDict<[]>

  1) test the truth (ScraperTest)
     test/scraper_test.exs:7
     ** (exit) exited in: :gen_server.call(Hound.SessionServer, {:find_or_create_session, #PID<0.587.0>}, 60000)
         ** (EXIT) an exception was raised:
             ** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}
                 (hound) lib/hound/request_utils.ex:43: Hound.RequestUtils.send_req/4
                 (hound) lib/hound/session_server.ex:22: Hound.SessionServer.handle_call/3
                 (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4
                 (stdlib) gen_server.erl:661: :gen_server.handle_msg/5
                 (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
     stacktrace:
       (stdlib) gen_server.erl:212: :gen_server.call/3
       test/scraper_test.exs:5: ScraperTest.__ex_unit_setup_0/1
       test/scraper_test.exs:1: ScraperTest.__ex_unit__/2

Finished in 0.1 seconds (0.06s on load, 0.08s on tests)
1 test, 1 failure

Randomized with seed 467310
➜  scraper  mix test
test/scraper_test.exs:7: warning: variable meta is unused

23:20:12.187 [error] GenServer Hound.SessionServer terminating
** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}
    (hound) lib/hound/request_utils.ex:43: Hound.RequestUtils.send_req/4
    (hound) lib/hound/session_server.ex:22: Hound.SessionServer.handle_call/3
    (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4
    (stdlib) gen_server.erl:661: :gen_server.handle_msg/5
    (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:find_or_create_session, #PID<0.166.0>}
State: #HashDict<[]>

  1) test the truth (ScraperTest)
     test/scraper_test.exs:7
     ** (exit) exited in: :gen_server.call(Hound.SessionServer, {:find_or_create_session, #PID<0.166.0>}, 60000)
         ** (EXIT) an exception was raised:
             ** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}
                 (hound) lib/hound/request_utils.ex:43: Hound.RequestUtils.send_req/4
                 (hound) lib/hound/session_server.ex:22: Hound.SessionServer.handle_call/3
                 (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4
                 (stdlib) gen_server.erl:661: :gen_server.handle_msg/5
                 (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
     stacktrace:
       (stdlib) gen_server.erl:212: :gen_server.call/3
       test/scraper_test.exs:5: ScraperTest.__ex_unit_setup_0/1
       test/scraper_test.exs:1: ScraperTest.__ex_unit__/2

Finished in 0.2 seconds (0.1s on load, 0.1s on tests)
1 test, 1 failure

Randomized with seed 36365

Additional information 2:
Created directory dev_deps to mess around with dependencies that don't work, in this case, hound
Ran git clone https://github.com/HashNuke/hound and did the following:
➜  dev_deps  git clone https://github.com/HashNuke/hound
Cloning into 'hound'...
remote: Counting objects: 2316, done.
remote: Compressing objects: 100% (56/56), done.
remote: Total 2316 (delta 26), reused 0 (delta 0), pack-reused 2258
Receiving objects: 100% (2316/2316), 313.32 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1423/1423), done.

23:27:55.639 [info]  Application hound exited: :stopped

23:27:56.295 [error] GenServer Hound.SessionServer terminating
** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}
    (hound) lib/hound/request_utils.ex:43: Hound.RequestUtils.send_req/4
    (hound) lib/hound/session_server.ex:22: Hound.SessionServer.handle_call/3
    (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4
    (stdlib) gen_server.erl:661: :gen_server.handle_msg/5
    (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:find_or_create_session, #PID<0.529.0>}
State: #HashDict<[]>
** (EXIT from #PID<0.47.0>) shutdown

  1) test Input into prompt (DialogTest)
     test/helpers/dialog_test.exs:32
     ** (exit) exited in: :gen_server.call(Hound.SessionServer, {:find_or_create_session, #PID<0.529.0>}, 60000)
         ** (EXIT) an exception was raised:
             ** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}
                 (hound) lib/hound/request_utils.ex:43: Hound.RequestUtils.send_req/4
                 (hound) lib/hound/session_server.ex:22: Hound.SessionServer.handle_call/3
                 (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4
                 (stdlib) gen_server.erl:661: :gen_server.handle_msg/5
                 (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
     stacktrace:
       (stdlib) gen_server.erl:212: :gen_server.call/3
       test/helpers/dialog_test.exs:7: DialogTest.__ex_unit_setup_0/1
       test/helpers/dialog_test.exs:1: DialogTest.__ex_unit__/2

23:27:56.314 [error] GenServer Hound.SessionServer terminating
** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}
    (hound) lib/hound/request_utils.ex:43: Hound.RequestUtils.send_req/4
    (hound) lib/hound/session_server.ex:22: Hound.SessionServer.handle_call/3
    (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4
    (stdlib) gen_server.erl:661: :gen_server.handle_msg/5
    (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:find_or_create_session, #PID<0.534.0>}
State: #HashDict<[]>

  2) test Accept dialog (DialogTest)
     test/helpers/dialog_test.exs:24
     ** (exit) exited in: :gen_server.call(Hound.SessionServer, {:find_or_create_session, #PID<0.534.0>}, 60000)
         ** (EXIT) an exception was raised:
             ** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}
                 (hound) lib/hound/request_utils.ex:43: Hound.RequestUtils.send_req/4
                 (hound) lib/hound/session_server.ex:22: Hound.SessionServer.handle_call/3
                 (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4
                 (stdlib) gen_server.erl:661: :gen_server.handle_msg/5
                 (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
     stacktrace:
       (stdlib) gen_server.erl:212: :gen_server.call/3
       test/helpers/dialog_test.exs:7: DialogTest.__ex_unit_setup_0/1
       test/helpers/dialog_test.exs:1: DialogTest.__ex_unit__/2

23:27:56.343 [error] GenServer Hound.SessionServer terminating
** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}
    (hound) lib/hound/request_utils.ex:43: Hound.RequestUtils.send_req/4
    (hound) lib/hound/session_server.ex:22: Hound.SessionServer.handle_call/3
    (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4
    (stdlib) gen_server.erl:661: :gen_server.handle_msg/5
    (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:find_or_create_session, #PID<0.536.0>}
State: #HashDict<[]>

23:27:56.355 [error] GenServer Hound.SessionServer terminating
** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}
    (hound) lib/hound/request_utils.ex:43: Hound.RequestUtils.send_req/4
    (hound) lib/hound/session_server.ex:22: Hound.SessionServer.handle_call/3
    (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4
    (stdlib) gen_server.erl:661: :gen_server.handle_msg/5
    (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:find_or_create_session, #PID<0.538.0>}
State: #HashDict<[]>

Let me know if I can do anything to help debug, maybe Selenium isn't running in the background?

@arthurcolle Are you running Selenium or Phantomjs or Chrome driver in the background or another shell?

@arthurcolle Looks like you aren't running any webdriver in the background.
From the readme:

You'll need a webdriver server running, like Selenium Server or Chrome Driver. If you aren't sure what it is, then read this.

If you want to use Phantomjs or Chromedriver directly, then you can do it by configuring Hound appropriately - https://github.com/HashNuke/hound/blob/master/notes/configuring-hound.md
To run the tests within Hound, you'll need to export an env var with the name of the webdriver  like WEBDRIVER=phantomjs. The .travis.yml config has info about this.

For anyone else unfamiliar with starting a webdriver server that's getting this issue, running the following in another terminal got the PhantomJS webdriver working for me:
$ phantomjs --wd

@bchase Thank you. I just went around checking the repo. Looks like I assumed too much that people will know that. I'll add more information about it.

No success here.
Phantomjs is running, tests ran with
 WEBDRIVER=phantomjs mix test

Still the same error
OS: Vagrant Ubuntu 14.04

Ok. Setting
config :hound, driver: "phantomjs"

In config.exs fixed the problem
Although that should be better documented in README file
It can be understood as if  WEBDRIVER=phantomjs should be enough

@HashNuke
I followed tutorial http://hashnuke.com/2015/06/07/hound-phoenix-framework-integration-testing.html and http://blog.plataformatec.com.br/2016/01/writing-acceptance-tests-in-phoenix/
But when i execute mix test i get these error.

Finished in 0.4 seconds (0.2s on load, 0.2s on tests)
6 tests, 2 failures
Randomized with seed 199676`>
This is my test/sample_test.exs file
defmodule Hello.SampleTest do
use Hello.ConnCase
use ExUnit.Case
Import Hound helpers
use Hound.Helpers
#Start Hound session
hound_session
test "GET Phoenix framework page" do
navigate_to("http://localhost:4000")
:timer.sleep(9000) # puts server to sleep
assert page_source =~ "Welcome to Phoenix"
assert("Hello HelloPhoenix!" == page_title)
end
test "should fill a field with a value" do
navigate_to "https://accounts.google.com/AddSession?hl=en&continue=https://mail.google. com/mail&service=mail#identifier"
IO.puts " "
IO.puts current_url
:timer.sleep(8000)
element_id = find_element(:name, "Email")
fill_field(element_id<EMAIL_ADDRESS>:timer.sleep(8000) # puts server to sleep
assert attribute_value(element_id, "value") ==<EMAIL_ADDRESS>element_id = find_element(:id, "next")
click element_id
IO.puts current_url
:timer.sleep(2000)
element_id = find_element(:id, "Passwd")
fill_field(element_id, "mypassword")
:timer.sleep(8000) # puts server to sleep
assert attribute_value(element_id, "value") == "mypassword"
element_id = find_element(:id, "signIn")
click element_id
:timer.sleep(9000) # puts server to sleep
end
end
This is my config/config.exs file
use Mix.Config
config :hello, Hello.Endpoint,
url: [host: "localhost"],
root: Path.dirname(DIR),
secret_key_base: "13uOu4yUSaAqVY4twbhbKpPleQM5X8oypM77tSdGsmhX/HFPk/yM275wtV3hNMoc",
render_errors: [accepts: ~w(html json)],
pubsub: [name: Hello.PubSub,
adapter: Phoenix.PubSub.PG2]
config :logger, :console,
format: "$time $metadata[$level] $message\n",
metadata: [:request_id]
import_config "#{Mix.env}.exs"
config :hound, driver: "phantomjs"
#config:hound, driver: "chrome_driver"
#config:hound, driver: "selenium"
#config :hound, browser: "chrome"
#config :hound, browser: "firefox"
#config :hound, port: 4444, browser: "firefox"
This is my mix.exs file
defmodule Hello.Mixfile do
use Mix.Project
def project do
[app: :hello,
version: "0.0.1",
elixir: "~> 1.0",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps]
end
def application do
[mod: {Hello, []},
applications: app_list(Mix.env) ]
end
def app_list do
[:phoenix, :phoenix_html, :cowboy, :logger, :gettext]
end
def app_list(:test), do: [:hound | app_list]
def app_list(_),     do: app_list
defp elixirc_paths(:test), do: ["lib", "web", "test/support"]
defp elixirc_paths(_),     do: ["lib", "web"]
defp deps do
[{:phoenix, "~> 1.1.2"},
{:httpoison, "~>0.8.1"},
{:hound, "~> 0.8"},
{:phoenix_html, "~> 2.3"},
{:phoenix_live_reload, "~> 1.0", only: :dev},
{:gettext, "~> 0.9"},
{:cowboy, "~> 1.0"}]
end
end
i started phantomjs in another terminal using
sharathkumar@dkarnik1:/usr/local/bin$ phantomjs --wd
PhantomJS is launching GhostDriver...
[INFO  - 2016-02-22T09:59:17.032Z] GhostDriver - Main - running on port 8910
In the same way i also started chromedriver using ./chromedriver command but still i get the error.
Please help me resolve it. And also can you guide me through a right way to start selenium webdriver? Because no tutorial tells how to start a selenium webdriver. It might be simple but a beginner like me may find it helpful if you include it in the hound documentation.
Thanks


Package request: python310Packages.g4f

Project description
Free GPT 3/3.5/4 python library
Metadata

homepage URL: https://github.com/xtekky/gpt4free
source URL: https://github.com/xtekky/gpt4free
license: GNU/GPL 3
platforms: aarch64-linux, aarch64-darwin, i686-linux, x86_64-linux, x86_64-darwin (like python)

I'm sorry, python310Packages.g4f and python311Packages.g4f packages, they are pretty similar

https://github.com/TheSaintDiratof/g4f-nix
maybe this help someone who knows how to commit to nixpkgs


Cannot pip install fold_to_ascii for py2.7

Is the package written only for Python3? I'm trying to pip install it on my Mac and I am using Python 2.7 but I get this error:
Could not find a version that satisfies the requirement fold-to-ascii (from versions: )
No matching distribution found for fold-to-ascii

Thanks for reporting. This should work fine with Python 2.7 -- in fact, that's what we're running it with in our projects!
Until we fix the underlying problem, please try this to get it installed: pip install<EMAIL_ADDRESS>

@sebrahimi1988 This should be fixed now:
$ pip install fold-to-ascii
Collecting fold-to-ascii
  Downloading https://files.pythonhosted.org/packages/e7/ec/e5ffcffa3d71e51205a27232df1ed9e74e558520eaf6d181d72dc685a829/fold_to_ascii-1.0.1-py2-none-any.whl
Installing collected packages: fold-to-ascii
Successfully installed fold-to-ascii-1.0.1

I'm going to close the issue, but definitely let me know if you try it and it doesn't work.


Unable to connect [ip_address]/admin

Hey everyone,
maybe this is not really a bug, but whenever I try to connect to pihole (locally on the rasp_pi or from another device) I receive the message "unable to connect" inside the browser.
I checked if ping [ip_address] has a result, and yes. There is no timeout or anything, only positive results.
Thanks in advance for your help <3

Hi @foxmulder4223,
what address are you trying?
http://[ip-address]:38080/admin or something else?

Hi @martinbrose,
actually it is any address with my local pi ip.

Ok, but are you using the port as well? 38080?

I wanted to access the pihole page. Even with the port I am unable to establish a connection.
Even reinstalling everything won't help.
My inventory file looks like this:
[internet_pi]
#<IP_ADDRESS> ansible_user=pi

# Comment out the previous line and uncomment this to run inside Raspberry Pi.
connection=local ansible_connection=local ansible_user=pi

The congig file is more or less untuched, except for the passwords.
Probably there is the error burried somewhere.

Well, you didn't mention any install errors. So that seems to have run okay?
Let's establish basics and see if your pi-hole docker container is running.
Could you please check the output of 'docker ps' on you Pi?

Alright. There it is..
Sorry I haven't paid much attention to it, since this is just something on the side from regular work. Docker daemon seems to be the problem.
docker ps
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/container/json": dial unix /var/run/docker.sock: connect: permission denied

When I execute the ansible playbook main.yml command docker is skipped due to [connection=local] which I set up in the inventory.

Make copies of the following files and customize them to your liking:

example.inventory.ini to inventory.ini (replace IP address with your Pi's IP, or comment that line and uncomment the connection=local line if you're running it on the Pi you're setting up).
example.config.yml to config.yml

Maybe the way I set it up is not correct.

Ok, you're problem is deeper than just an access problem to the Pi-Hole web frontend.
Your docker permission error would have me believe that your user is not part of the docker group. Which can be a common problem when the install doesn't finish successfully. So I would expect to see an error during your run of the ansible playbook.
Could you please ensure you follow the setup instructions here: https://github.com/geerlingguy/internet-pi?tab=readme-ov-file#setup
If you run the install locally on your Raspberry Pi, then the second option in the first point in step 4 is the option to pick.
If there are any error messages in the setup process, please let me know and we'll take it from there.

In case you don't see any errors, have a look at the following closed issue:
https://github.com/geerlingguy/internet-pi/issues/393
Your comment that docker is skipped in the setup process might indicate that you have docker already installed and only a user permission problem.

Alright...
So my inventory.yml looks now like this:
[internet_pi]
#<IP_ADDRESS> ansible_user=pi

# Comment out the previous line and uncomment this to run inside Raspberry Pi.
<IP_ADDRESS> ansible_connection=local ansible_user=pi

But actually it does not make any difference if line 4 starts with <IP_ADDRESS> or connection=local. The summary is the same, as you see below:
daniel@raspberrypi:~/git_rep/internet-pi $ ansible-playbook main.yml

PLAY [Configure Internet Pi.] **************************************************

TASK [Gathering Facts] *********************************************************
ok: [<IP_ADDRESS>]

TASK [Load configuration (with defaults from example file).] *******************
ok: [<IP_ADDRESS>] => (item=example.config.yml)
ok: [<IP_ADDRESS>] => (item=config.yml)

TASK [Ensure apt cache is up to date.] *****************************************
ok: [<IP_ADDRESS>]

TASK [Ensure pacman cache is up to date] ***************************************
skipping: [<IP_ADDRESS>]

TASK [Check if Docker is already present.] *************************************
ok: [<IP_ADDRESS>]

TASK [Download Docker install convenience script.] *****************************
skipping: [<IP_ADDRESS>]

TASK [Run Docker install convenience script.] **********************************
skipping: [<IP_ADDRESS>]

TASK [Ensure Docker is started.] ***********************************************
ok: [<IP_ADDRESS>]

TASK [Ensure dependencies are installed (Debian).] *****************************
ok: [<IP_ADDRESS>]

TASK [Ensure dependencies are installed (Archlinux).] **************************
skipping: [<IP_ADDRESS>]

TASK [Ensure user is added to the docker group: pi] ****************************
ok: [<IP_ADDRESS>]

TASK [Reset connection so docker group is picked up.] **************************
[WARNING]: Reset is not implemented for this connection

TASK [Gather package facts.] ***************************************************
skipping: [<IP_ADDRESS>]

TASK [Add Buster backports apt key.] *******************************************
skipping: [<IP_ADDRESS>] => (item=04EE7237B7D453EC)
skipping: [<IP_ADDRESS>] => (item=648ACFD622F3D138)
skipping: [<IP_ADDRESS>] => (item=0E98404D386FA1D9)
skipping: [<IP_ADDRESS>] => (item=6ED0E7B82643E131)
skipping: [<IP_ADDRESS>]

TASK [Add Buster backports for fixed libseccomp2.] *****************************
skipping: [<IP_ADDRESS>]

TASK [Install >libseccomp2.4.4 to fix 32-bit OS issue.] ************************
skipping: [<IP_ADDRESS>]

TASK [Synchronize internet-monitoring directory.] ******************************
ok: [<IP_ADDRESS>]

TASK [Ensure internet-monitoring directory is not a Git repository.] ***********
ok: [<IP_ADDRESS>]

TASK [Copy templated internet-monitoring files into place.] ********************
ok: [<IP_ADDRESS>] => (item={'src': 'docker-compose.yml.j2', 'dest': 'docker-compose.yml'})
ok: [<IP_ADDRESS>] => (item={'src': 'grafana-config.monitoring.j2', 'dest': 'grafana/config.monitoring'})
ok: [<IP_ADDRESS>] => (item={'src': 'prometheus.yml.j2', 'dest': 'prometheus/prometheus.yml'})
ok: [<IP_ADDRESS>] => (item={'src': 'prometheus-pinghosts.yaml.j2', 'dest': 'prometheus/pinghosts.yaml'})

TASK [Ensure internet-monitoring environment is running.] **********************
fatal: [<IP_ADDRESS>]: FAILED! => {"changed": false, "cmd": "/usr/bin/docker --host unix:///var/run/docker.sock version --format '{{ json . }}'", "msg": "permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version\": dial unix /var/run/docker.sock: connect: permission denied", "rc": 1, "stderr": "permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version\": dial unix /var/run/docker.sock: connect: permission denied\n", "stderr_lines": ["permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version\": dial unix /var/run/docker.sock: connect: permission denied"], "stdout": "{\"Client\":{\"Platform\":{\"Name\":\"\"},\"Version\":\"20.10.24+dfsg1\",\"ApiVersion\":\"1.41\",\"DefaultAPIVersion\":\"1.41\",\"GitCommit\":\"297e128\",\"GoVersion\":\"go1.19.8\",\"Os\":\"linux\",\"Arch\":\"arm64\",\"BuildTime\":\"Thu May 18 08:41:26 2023\",\"Context\":\"default\",\"Experimental\":true},\"Server\":null}\n", "stdout_lines": ["{\"Client\":{\"Platform\":{\"Name\":\"\"},\"Version\":\"20.10.24+dfsg1\",\"ApiVersion\":\"1.41\",\"DefaultAPIVersion\":\"1.41\",\"GitCommit\":\"297e128\",\"GoVersion\":\"go1.19.8\",\"Os\":\"linux\",\"Arch\":\"arm64\",\"BuildTime\":\"Thu May 18 08:41:26 2023\",\"Context\":\"default\",\"Experimental\":true},\"Server\":null}"]}

PLAY RECAP *********************************************************************
<IP_ADDRESS>                  : ok=10   changed=0    unreachable=0    failed=1    skipped=8    rescued=0    ignored=0

<3
That did the trick. No more errors. Pihole gets loaded. It was "just" the matter of adding the $USER to the docker group.

Glad that solved it. Enjoy!


Image Not Found Failure

Currently if an image file is not found in media on page load then the whole CMS is brought to a halt with SourceImageIOError here rather than rendering a missing image stub.
I think the fix might be as easy as switching out get_rendition  with get_rendition_or_not_found?

Fixed by #53


Type error on event properties in actions

Description
Typescript compiler is not detecting the properties of additional event type definitions that are joined by ORs (|) when the properties are referenced in actions
Expected Result
No error when the event is properly typed
Actual Result
Error is thrown: TS2339: property 'payload' does not exist on type 'MachineEvent'
This is the error thrown by the savePayload action in the below linked codesandbox
Reproduction
https://codesandbox.io/s/priceless-sun-bogjb?file=/src/index.tsx

Use interface:
interface MachineEvent {
  type: 'TOGGLE' | 'SAVE';
  payload?: string;
}

TypeScript isn't smart enough to know where the action will be used, so without upcoming tools like the VS Code XState extension with typegen, you will have to ensure that this is the expected event:
    actions: {
      savePayload: assign((context, event) => {
+       if (event.type !== 'SAVE') { return context; }
        const newContext = Object.assign({}, context);
        const { payload } = event;
        newContext.payload = payload;

        return newContext;
      })
    }


Support for RHEL 7

Red hat now uses a new timezone command and is no longer using sysconfig/clock. I would make the changes myself if I were good at module writing.  Thank you

You're correct in that /etc/sysconfig/clock is no longer used in EL7.  However, timedatectl is just setting the symlinks to /etc/localtime anyway, so the module functions as expected.


Handle non traditional storage querying methodology

Currently we have a message queue that is persisted to SQL. It's a simple table structure: Message(MessageId, Timestamp, MessageContent) essentially.
When we process a message we have a meta table with distinct fields for later querying MessageMeta (MessageId, FirstName, LastName) that we query to pull the list of messages that match and then we can pull the entire message from the Message table.
Is there a way to abstract away this concept for the where clause and then deserialize MessageContent through a deserializer we already have to a CS object so we can run Linq queries on it?
Ideally some form of attributes would be awesome, eg.
[MetaFilter(table: "MessageMeta", key: "MessageId", filterFields: new List() {"FirstName", "LastName"}]
Any guidance would be extremely appreciated.

Hey,
We discussed this as a team but weren't able to work out exactly what you are after. Can you share an example of the code you would want to write for your entity classes, the LINQ query you want to be able to write, the SQL that would be generated, and what the results would look like.
~Rowan

Hi Rowan,
Thank you and your team for reviewing.  I hope the below code makes sense. Please let me know if you have any questions.
The code below is a very simple example, but our actual use case (HL7 v2 messages: https://en.wikipedia.org/wiki/Health_Level_7#HL7_version_2 ) is a lot more complex of a serialized message object which is why I've spent the time trying to develop this example.  We have a custom serializer and deserializer for this, but I've substituted JSON for ease of understandibility.
I believe if your team implemented something similar to this it would allow for a lot of instances when you don't want an entire relational database around your data, but still need ease to query it, a psuedo NOSQL layer on top of SQL server if you will.
public class Program
{
    public static void Main()
    {
		// Example of how I'd like to write my code.
        var coolMsgs = DbContext.Message.Where(msg => msg.FirstName == "Michael" && msg.Gender == "Male").ToList();

        //Instead of...
        // Handle MetaQueryFields against Meta table first.
        var messagesMeta = DbContext.MessageMeta
            .Where(mm => mm.FirstName == "Michael")
            .Select(mm => new { MessageId = mm.MessageId }).ToList();

        // Then we Deserialize to local objects
        var messagesFromDb = DbContext.MessageStore
            .Where(msg => messagesMeta.Contains(msg.MessageId))
            .Select(
                m => JsonConvert.DeserializeObject<Message>(m.MessageContent)
            ).ToList();

        //Finally we handle querying on the deserialized object.
        var lameMsgs = messagesFromDb.Where(msg => msg.Gender == "Male").ToList();

        var msgs = coolMsgs;

        foreach (var msg in msgs)
        {
            Console.WriteLine("MessageId: {0}, FirstName: {1}, LastName: {2}, Gender: {3}", msg.MessageId, msg.FirstName, msg.LastName, msg.Gender);
        }
    }
}

public class DbContext
{
    public DbSet<MessageStore> MessageStore;
    public DbSet<MessageMeta> MessageMeta;

    [Serialized]
    public List<Message> Messages;
}

[Table("Messages")]
[DeserializeOutTo(typeof(Message), "MessageContent")]
public class MessageStore
{
    [Key]
    public string MessageId { get; set; }

    public string MessageContent { get; set; }
}

[Table("MessageSearch")]
public class MessageMeta
{
    [Key]
    public string MessageId { get; set; }

    public string FirstName { get; set; }
    public string LastName { get; set; }
}

[SerializeInto(typeof(MessageStore))]
[MetaQuery(typeof(MessageMeta))]
[JsonObject]
public class Message
{
    [Key]
    public string MessageId { get; set; }

    [MetaQueryField("FirstName")]
    public string FirstName { get; set; }

    [MetaQueryField("LastName")]
    public string LastName { get; set; }

    public string Gender { get; set; }
}

public class DeserializeOutToAttribute : Attribute
{
    public string ClassName;
    public string StoredInField;

    public DeserializeOutToAttribute(string className, string storedInField)
    {
        this.ClassName = className;
        this.StoredInField = storedInField;
    }
}

public class SerializeIntoAttribute : Attribute
{
    public string ClassName;

    public SerializeIntoAttribute(string className)
    {
        this.ClassName = className;
    }
}

public class MetaQueryAttribute : Attribute
{
    public string ClassName;

    public MetaQueryAttribute(string className)
    {
        this.ClassName = className;
    }
}

public class MetaQueryFieldAttribute : Attribute
{
    public string FieldName;

    public MetaQueryFieldAttribute(string fieldName)
    {
        this.FieldName = fieldName;
    }
}

Hey,
Thanks for the details, that makes sense now. This boils down to a couple of features that are needed to achieve this.

Ability to map multiple properties to a single column (by serializing/deserializing to JSON, xml, etc.)
Ability to query based on values stored in a JSON column

This had a lot of overlap with https://github.com/aspnet/EntityFramework/issues/2141, so I generalized that issue a bit to cover this whole area.


Merge #843: add dependency to Microsoft.visualstudioEng.Microbuild.Core

for fixing the ApiPort NuGet package signing issue

Merely adding this won't cause the binaries inside the package to be signed. It will only sign the package itself.
To sign everything in the package as well, the easiest way is to simply add a PackageReference to Microbuild.VisualStudio. If you need to customize the public key token you can do that too.

@AArnott Thanks for the comment. The current issue is that APIPort Nuget package is not signed when it is built as global tool. Hope this change help.

Hope this change help.

FYI you can fully test this locally on a dev box using test signing. No reason to check in and 'hope' it works. :)


Upgrade Node

Node version is getting far out of date. Upgrade node (and sharp image with it with it)

#165


Azure Bastion example (No Public IP access)

Azure bastion example, setting up a HPC cluster with no public IP access.
Access Windows or Linux VM in the private VNET using Azure bastion.

Any chances to merge this example into master branch? I have a customer project where we need Bastion to connect to Linux VM

@lmiroslaw can you describe the customer scenario ? is it about doing all deployment thru the Bastion ? adding a bastion access after a deployemnt have been done thru a jumpbox with a public IP ?

We use Azure Bastion (with public IP but behind RBACs) to connect to a jumpbox VM over HTTPS. From the jumpbox we want to browse or CLI to the CycleCloud  and SSH into any node as needed.

I will add a second config file to create a bastion and jumpbox (private IP) with the intention of deploying the rest of your resources from the jumpbox.

I added a second config file (config_no_pub_ip.json), which will deploy the Azure bastion, VNET and a jumpbox(No pub IP). The idea would be to use the jumpbox to deploy the rest of the azurehpc deployment. (This would work for sites which have a strict policy of no pub IP's allowed).


Lazy downloaded index header

[ ] I added CHANGELOG entry for this change.
[x] Change is not relevant to the end user.

Changes
This pr allows index header to be lazily downloaded by checking block metadata info when lazy mmap is enabled.
Currently, it is set to always disable lazy download. But in the future we can utilize it to lazy download indexes if needed.
This can be useful if we know block size is small and it is fast to download index headers. Or we don't need to eagerly download blocks that are one year old at startup time since they might be never queried.
Verification

Currently, it is set to always disable lazy download.

From what I understand we can't enable it yet? Why is it hardcoded to be always disabled?
I think you provide good enough arguments to allow this to be enabled. Particularly the last reason, when combined with a good store.index-header-lazy-reader-idle-timeout to periodically clean up files, will provide great disk savings in environments with lots of blocks.

This can be useful if we know block size is small and it is fast to download index headers. Or we don't need to eagerly download blocks that are one year old at startup time since they might be never queried.

Hi @douglascamata,

From what I understand we can't enable it yet? Why is it hardcoded to be always disabled?

I hardcoded it to always disable lazy downloading so that the behavior is the same as what we have right now.
We can enable it but I think we need additional strategies first to configure what kind of blocks we want to lazy download. Like older than X days or Index Size < X MB. It is also possible to lazy download all blocks but I haven't tested it and it might impact query performance a lot.
Anyway, to me those strategies are next steps of this pr and we can make it always disable first and gradually add more strategies. What do you think?

I was thinking about having a dedicated cli arg to turn this on.
For now we can defer the decision to turn it on to the users. Example: I can shard my store gw and turn it on only for the ones answering queries on old data.

For now we can defer the decision to turn it on to the users. Example: I can shard my store gw and turn it on only for the ones answering queries on old data.

Sounds good. I can try to implement a flag for it.

PTAL @MichaHoffmann @douglascamata


[QUESTION] Google maps API

Have you created the Google maps nugets, or we just need to create them by ourselves?
If second, then what if I create the nugets for google maps api and put the prefix of your name like it is for firebase? like AdamE.Firebase.iOS.ABTesting but for maps AdamE.Google.iOS.Maps to consolidate the full repo namings?

I'd like to know this too, we want to update our Google.Maps nugget for cloud based styling.

Hello @Alex-Dobrynin and @katkusmt,
We've released the bindings for GoogleMaps v9.1.1 as a NuGet package here. Feedback is appreciated.

@Digifais  Hi, you have done very important thing. Appreciate your work and time


Support for public keys that have a nostr: prefix/uri

For example https://cowdle.gg/ publish their public key as following:
nostr:npub136ljffk35zaknaauukrrlmpgdle6p6a0mlcw383w6gvas0epjguqc8mumr

Pasting this string into add a person does nothing, and I don't get an error messages.

The Blockcore Wallet extension will add support for parsing links like that, but obviously if you copy and paste into Blockcore Notes it should work.


A whole bunch of changes

Hey! I'm happy to split this up into multiple PRs, let me know what works best for you.
There were no tests as far as I can see, but I'm happy to add some tests to make sure it doesn't change functionality where I changed existing code.
This

Fixes some issues in the interface for MatrixProfile using Stumpy
Adds a numeric stability work-around to MCD
Adds joblib parallelization to the univariate evaluation script
refactors the GPU initialization code and picks the least occupied GPU (which allows easy distribution across GPUs)
rewrites range_convers_new to be vectorized - it was a bottleneck in running the benchmarks
rewrites existence_reward to be a bit more efficient and easier to read
adds two kinds of random baselines
adds the spectral residual method

Let me know if there's any subset that I should separate out.

I removed the random baselines and the Spectral Residual.

Really appreciate the contributions, Andreas!


Check that output files can be read with xarray and iris

In #58, @vnaik60 reported that the time dimension of the written files couldn't be read by xarray. I suspect this is because of how iris is writing the files.
For the next iteration:

[ ] Add a check that the output files can be written with both xarray and iris. This check should probably go into input4mips-validation

Handled by https://github.com/climate-resource/input4mips_validation


Tidy up before downloading pinned libraries

It seems that go.sum could be messed up, leading to failure to download
the newest version of a released library, as seen in #199.
Tidying up before attempting the download should resolve this.
Resolves: #199
Signed-off-by: Mike Kolesnik<EMAIL_ADDRESS>

It's not that go.sum is messed up. It seems the golang proxy modifies the check sum for some dependencies when storing - not sure why. So if you try to get a dependency by bypassing the proxy and compare the checksum against a version previously retrieved via the proxy, you might get a mismatch when comparing. We removed bypassing the proxy so this should no longer be an issue. Hence this change isn't necessary although it doesn't hurt.

Hence this change isn't necessary (and wouldn't have fixed the issue anyway), although it doesn't hurt.

Actually it does fix the issue and you can see it manually by running the commands (with GOPROXY=direct) inside a make shell in submariner-operator.
Anyhow I don't see a reason not to do this if it can avoid issues in the future

Hence this change isn't necessary (and wouldn't have fixed the issue anyway), although it doesn't hurt.

Actually it does fix the issue and you can see it manually by running the commands (with GOPROXY=direct) inside a make shell in submariner-operator.

I assume by also running go mod tidy with GOPROXY=direct - makes sense that would work - so you need to be consistent and run all commands with or without GOPROXY=direct.

Anyhow I don't see a reason not to do this if it can avoid issues in the future

Sure it doesn't hurt - I stated that previously.


BugFix: Add support for withControlled from<EMAIL_ADDRESS>

Vee validate introduced a method property on handleSubmit which we are wrapping in our useForm composition. This caused a type error because we didn't implement the same type.
Added support for withControlled which fixes the type error.
Replaces #701

@stackoverfloweth yesg it's just keeping things up to date so dependabot can do it's thing

@stackoverfloweth - yes it's an old PR that was sitting there unreviewed.  Totally fine if we remove vee validate soon.


Decoder Fails for large files

Describe the bug
For large files (~1GB+), Decoder seems to running out of memory while training on the CPU. This either happens 1) While Decoding large files for the compressed data and/or 2) While renormalizing decoded output.
To Reproduce
Try Decompressing any large file (~1GB+) on the CPU
Screenshot
Attached

I'm assuming the PR (#267)  I just merged fixed this. If you put the issue name in the commit message or PR message it will autoclose the corresponding issue.
See this https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
Nonetheless, is this done?

Yes This is done !
Closed in #267


Extract options decoder from Image

Coverage increased (+0.05%) to 96.673% when pulling 5b8c4720cfe9d032f217439f38e0574c7281e609 on options_decoder into a4c9189e13a53c3ccdc66aae02a0ea9796e58b22 on master.


proper seed operations

The seed operation in the exec spec was written for clarity of reading and is not secure. We need approval from the cryptographers on a real implementation, and we need to use this operation in the actual implementation.

This was suggested by one of the cryptographers:
VRF(key; [universal constant] @ SHA256(slot,epoch nonce,previous hash))

Where @ denotes XOR and the idea is that the universal constant has the same number of bits as produced by the hash function.


provider_settings validation fails when respository is dynamic

Describe the bug
When using the resource buildkite_pipeline in a module with a repository containing variable interpolation, the validation of the provider_settings fails
To Reproduce
A small reproducer
resource "buildkite_pipeline" "main" {
  name        = var.name
  repository  = "git@github.com:${var.repository}.git"

  provider_settings = {
    trigger_mode = "code"
  }
}

Trigger this output
╷
│ Error: Could not parse repository URL
│
│   with module.agent_release.buildkite_pipeline.main,
│   on modules/buildkite_release/main.tf line 3, in resource "buildkite_pipeline" "main":
│    3: resource "buildkite_pipeline" "main" {
│
╵
╷
│ Error: Invalid attribute value
│
│   with module.agent_release.buildkite_pipeline.main,
│   on modules/buildkite_release/main.tf line 3, in resource "buildkite_pipeline" "main":
│    3: resource "buildkite_pipeline" "main" {
│
│ Invalid use when repository is:
╵

Additional context
terraform-provider-buildkite Version 1.0
Probably introduced in https://github.com/buildkite/terraform-provider-buildkite/pull/387/files

Hmm damn. That is an edge that wasn't considered or tested. Thanks for reporting @jderusse 👍
It seems that validation runs prior to interpolation, even with known variables. I think we could fix this by implementing a plan modifier instead or perhaps we ignore the validation when the string is empty. But that would mean there is no validation when interpolating the repository URL which I suspect would be how many people use this provider. Let us have a think about which approach and implement a fix

I am also encountering this problem. In my case my module is:
resource "buildkite_pipeline" "pipeline" {
  # See: https://registry.terraform.io/providers/buildkite/buildkite/latest/docs/resources/pipeline
  for_each = local.pipelines

  # Required settings
  default_branch = each.value.default_branch
  description    = each.value.description
  name           = each.key
  repository     = each.value.repository
  ...snip...

And from this I'm getting:
│ Error: Invalid attribute value
│
│   with buildkite_pipeline.pipeline["persona-identity"],
│   on main.tf line 1, in resource "buildkite_pipeline" "pipeline":
│    1: resource "buildkite_pipeline" "pipeline" {
│
│ Invalid use when repository is: git@bitbucket.org:persona-id/persona-identity.git

I'm also seeing similar issues using variables for provider settings. I have:
  provider_settings = {
   ...snip...
    pull_request_branch_filter_configuration = lookup(each.value, "pull_request_branch_filter_configuration", "")
    pull_request_branch_filter_enabled = lookup(each.value, "pull_request_branch_filter_enabled", false)
    ...snip...
  }

And as a result I'm geting plans failing with:
│ Error: Invalid Attribute Value
│
│   with buildkite_pipeline.pipeline["persona-identity"],
│   on main.tf line 1, in resource "buildkite_pipeline" "pipeline":
│    1: resource "buildkite_pipeline" "pipeline" {
│
│ Attribute provider_settings.pull_request_branch_filter_enabled true, got: false

Note: false is actually what the value should be here as it's not set explicitly in the instantiated instance of the module.

Thanks @ianchesal. This looks semi-related, but distinct enough that I'd like to ask you raise a separate issue for us (I think it could be a bit more complex). Could you also provide a reproduction example for us to figure out the issue

This got us too. Simply using a variable for repository leads to validation failures.
In our simpler module, we just create a pipeline from the variables directly
resource "buildkite_pipeline" "buildkite_pipeline" {
  name           = var.service_name
  repository     = var.repository
  description    = var.description
  steps          = var.steps
  default_branch = var.default_branch

  provider_settings = {
    build_branches                                = true
    build_pull_requests                           = true
    publish_commit_status                         = true
    publish_commit_status_per_step                = true
    skip_pull_request_builds_for_existing_commits = true
    trigger_mode                                  = var.trigger_mode
  }
}

variable "repository" {
  type = string
}
...

Our more complex module creates a pipeline as a side effect of creating a GitHub repo, this also fails:
resource "buildkite_pipeline" "buildkite_pipeline" {
  count          = var.build_pipeline ? 1 : 0
  name           = github_repository.github_repository.name
  repository     = github_repository.github_repository.ssh_clone_url
  steps          = var.buildkite_steps
  default_branch = (var.build_default_branch != null) ? var.build_default_branch : var.repo_default_branch

  provider_settings = {
    build_branches                                = true
    build_pull_requests                           = true
    publish_commit_status                         = true
    publish_commit_status_per_step                = true
    skip_pull_request_builds_for_existing_commits = true
    trigger_mode                                  = "code"
  }
}

Hi all, we've released v1.0.2 with a fix for this. Can you give it a shot and let us know if it still doesn't work or raise a new issue if some other bug comes up

@jradtilbrook I encountered this today, trying to create a module that generated a GH repository and an associated pipeline. This was with version 1.3.0


Property 'signTransaction' does not exist on type 'TransferTransaction'

Documentation currently says to sign and return a tx with signer you should
let signer = hashconnect.getSigner(accountId);

let trans = await new TransferTransaction()
    .addHbarTransfer(fromAccount, -1)
    .addHbarTransfer(toAccount, 1)
    .freezeWithSigner(signer);

let response = await trans.signTransaction(signer);

As of "@hashgraph/sdk": "^2.40.0" TransferTransaction API does not have a .signTransaction() method

PR with correct method https://github.com/Hashpack/hashconnect/pull/194


Add documentation for annotated arbitrary types

This is the documentation for
Add arbitrary param parsers #3143

It seems it worked like I wanted. Should the test be a separate pull request?


K8SPXC-895 - Fixes in tests for kubernetes 1.22

Here's the test run with 1.22: https://cloud.cd.percona.com/view/PXC/job/pxc-operator-gke-version/810/#showFailuresLink

3 chaos-mesh tests failed because chaos-mesh helm chart doesn't support 1.22 yet
scheduled-backup fails a lot so we will probably need to investigate it more (although in the above test run it passed, but after many failures)

Some of the diffs this fixes:
+ diff -u /mnt/jenkins/workspace/pxc-operator-gke-latest/source/e2e-tests/proxysql-sidecar-res-limits/compare/service_side-car-proxysql.yml /tmp/tmp.fPAY2stbOt/service_side-car-proxysql.yml
--- /mnt/jenkins/workspace/pxc-operator-gke-latest/source/e2e-tests/proxysql-sidecar-res-limits/compare/service_side-car-proxysql.yml	2021-10-19 00:05:35.000000000 +0000
+++ /tmp/tmp.fPAY2stbOt/service_side-car-proxysql.yml	2021-10-19 01:41:17.990410614 +0000
@@ -14,7 +14,9 @@
       kind: PerconaXtraDBCluster
       name: side-car
 spec:
+  allocateLoadBalancerNodePorts: true
   externalTrafficPolicy: Cluster
+  internalTrafficPolicy: Cluster
   ports:
     - name: mysql
       port: 3306

+ diff -u /mnt/jenkins/workspace/pxc-operator-gke-latest/source/e2e-tests/security-context/compare/job.batch_xb-on-demand-backup-pvc.yml /tmp/tmp.adrHH7uZmM/job.batch_xb-on-demand-backup-pvc.yml
--- /mnt/jenkins/workspace/pxc-operator-gke-latest/source/e2e-tests/security-context/compare/job.batch_xb-on-demand-backup-pvc.yml	2021-10-19 00:05:35.000000000 +0000
+++ /tmp/tmp.adrHH7uZmM/job.batch_xb-on-demand-backup-pvc.yml	2021-10-19 00:47:01.448299286 +0000
@@ -3,6 +3,7 @@
 metadata:
   annotations:
     openshift.io/scc: privileged
+  generation: 1
   labels:
     cluster: sec-context
     job-name: xb-on-demand-backup-pvc
@@ -14,6 +15,7 @@
       name: on-demand-backup-pvc
 spec:
   backoffLimit: 10
+  completionMode: NonIndexed
   completions: 1
   manualSelector: true
   parallelism: 1
@@ -22,6 +24,7 @@
       cluster: sec-context
       job-name: xb-on-demand-backup-pvc
       type: xtrabackup
+  suspend: false
   template:
     metadata:
       annotations:

+ diff -u /mnt/jenkins/workspace/cloud-pxc-operator_PR-1023/e2e-tests/init-deploy/compare/service_some-name-proxysql-unready.yml /tmp/tmp.8tUVrddmnN/service_some-name-proxysql-unready.yml
--- /mnt/jenkins/workspace/cloud-pxc-operator_PR-1023/e2e-tests/init-deploy/compare/service_some-name-proxysql-unready.yml	2021-10-19 09:24:27.931233339 +0000
+++ /tmp/tmp.8tUVrddmnN/service_some-name-proxysql-unready.yml	2021-10-19 09:59:57.513813927 +0000
@@ -1,7 +1,6 @@
 apiVersion: v1
 kind: Service
 metadata:
-  annotations: {}
   labels:
     app.kubernetes.io/component: proxysql
     app.kubernetes.io/instance: some-name

demand-backup-encrypted-with-tls:
error: unable to recognize "/var/folders/fw/lxhtthdn7d9610w5p3wb33340000gn/T/tmp.7TW56kSg/csr.yaml": no matches for kind "CertificateSigningRequest" in version "certificates.k8s.io/v1beta1"

error: error validating "/var/folders/fw/lxhtthdn7d9610w5p3wb33340000gn/T/tmp.4mTk05HK/csr.yaml": error validating data: ValidationError(CertificateSigningRequest.spec): missing required field "signerName" in io.k8s.api.certificates.v1.CertificateSigningRequestSpec; if you choose to ignore these errors, turn validation off with --validate=false

Test name
Status

big-data
passed

scaling
passed

upgrade-haproxy
passed

scheduled-backup
failed

recreate
passed

haproxy
passed

storage
passed

scaling-proxysql
passed

self-healing
passed

self-healing-chaos
passed

init-deploy
passed

security-context
passed

restore-to-encrypted-cluster
passed

upgrade-proxysql
passed

self-healing-advanced
passed

self-healing-advanced-chaos
failed

limits
passed

demand-backup
passed

monitoring-2-0
passed

smart-update
passed

affinity
passed

operator-self-healing
passed

operator-self-healing-chaos
failed

one-pod
passed

auto-tuning
passed

pitr
passed

proxysql-sidecar-res-limits
passed

users
passed

upgrade-consistency
passed

tls-issue-self
passed

demand-backup-encrypted-with-tls
passed

tls-issue-cert-manager
passed

tls-issue-cert-manager-ref
passed

validation-hook
passed

commit: https://github.com/percona/percona-xtradb-cluster-operator/pull/1023/commits/c250b9513119f97a67745e0c4600cea095bb090f
image: perconalab/percona-xtradb-cluster-operator:PR-1023-c250b951

Test name
Status

recreate
passed

restore-to-encrypted-cluster
passed

demand-backup
passed

pitr
passed

demand-backup-encrypted-with-tls
passed

storage
passed

upgrade-haproxy
passed

haproxy
passed

big-data
passed

self-healing
passed

init-deploy
passed

self-healing-chaos
passed

limits
passed

self-healing-advanced
passed

monitoring-2-0
passed

self-healing-advanced-chaos
passed

scheduled-backup
passed

affinity
passed

scaling
passed

operator-self-healing
passed

operator-self-healing-chaos
passed

one-pod
passed

scaling-proxysql
passed

security-context
passed

auto-tuning
passed

proxysql-sidecar-res-limits
passed

users
passed

tls-issue-self
passed

tls-issue-cert-manager
passed

tls-issue-cert-manager-ref
passed

validation-hook
passed

upgrade-proxysql
passed

smart-update
passed

upgrade-consistency
passed

commit: https://github.com/percona/percona-xtradb-cluster-operator/pull/1023/commits/c250b9513119f97a67745e0c4600cea095bb090f
image: perconalab/percona-xtradb-cluster-operator:PR-1023-c250b951

Test name
Status

upgrade-haproxy
passed

recreate
passed

haproxy
passed

big-data
failed

scaling
passed

storage
passed

scheduled-backup
failed

scaling-proxysql
passed

self-healing
passed

self-healing-chaos
passed

init-deploy
passed

security-context
passed

restore-to-encrypted-cluster
passed

upgrade-proxysql
passed

self-healing-advanced
passed

self-healing-advanced-chaos
passed

demand-backup
passed

limits
passed

operator-self-healing
passed

operator-self-healing-chaos
passed

monitoring-2-0
passed

affinity
passed

one-pod
passed

auto-tuning
passed

pitr
passed

proxysql-sidecar-res-limits
passed

smart-update
passed

users
passed

demand-backup-encrypted-with-tls
failed

tls-issue-self
passed

upgrade-consistency
passed

tls-issue-cert-manager
passed

tls-issue-cert-manager-ref
passed

validation-hook
passed

commit: https://github.com/percona/percona-xtradb-cluster-operator/pull/1023/commits/4264646579ca3d7abf8bfd6537d48287800d9261
image: perconalab/percona-xtradb-cluster-operator:PR-1023-42646465

Test name
Status

haproxy
passed

scheduled-backup
passed

upgrade-haproxy
passed

big-data
passed

scaling
passed

storage
passed

recreate
passed

scaling-proxysql
passed

self-healing
passed

self-healing-chaos
failed

init-deploy
passed

restore-to-encrypted-cluster
passed

security-context
passed

upgrade-proxysql
passed

self-healing-advanced
passed

self-healing-advanced-chaos
failed

limits
passed

operator-self-healing
passed

operator-self-healing-chaos
failed

demand-backup
passed

monitoring-2-0
passed

smart-update
passed

affinity
passed

one-pod
passed

auto-tuning
passed

pitr
passed

proxysql-sidecar-res-limits
passed

users
passed

upgrade-consistency
passed

demand-backup-encrypted-with-tls
passed

tls-issue-self
passed

tls-issue-cert-manager
passed

tls-issue-cert-manager-ref
passed

validation-hook
passed

commit: https://github.com/percona/percona-xtradb-cluster-operator/pull/1023/commits/62053d87f2f5bae21ca5de3187a76c057f9f7275
image: perconalab/percona-xtradb-cluster-operator:PR-1023-62053d87

Test name
Status

recreate
passed

haproxy
passed

upgrade-haproxy
passed

scheduled-backup
passed

big-data
passed

scaling
passed

storage
passed

scaling-proxysql
passed

self-healing
passed

self-healing-chaos
passed

init-deploy
passed

restore-to-encrypted-cluster
passed

security-context
passed

upgrade-proxysql
passed

self-healing-advanced
passed

self-healing-advanced-chaos
passed

limits
passed

demand-backup
passed

monitoring-2-0
passed

smart-update
passed

operator-self-healing
passed

operator-self-healing-chaos
passed

affinity
passed

one-pod
passed

auto-tuning
passed

pitr
passed

proxysql-sidecar-res-limits
passed

users
passed

upgrade-consistency
passed

demand-backup-encrypted-with-tls
passed

tls-issue-self
passed

tls-issue-cert-manager
passed

tls-issue-cert-manager-ref
passed

validation-hook
passed

commit: https://github.com/percona/percona-xtradb-cluster-operator/pull/1023/commits/8d52c7a23a65788c588105098ac6e36077a2e1f5
image: perconalab/percona-xtradb-cluster-operator:PR-1023-8d52c7a2


x86: lower cmpl to cmp

Herd7 doesn't support cmpl (yet).  This lowering should be fine if the source and destination are both 32-bit (which they invariably will be in our examples).

Fixed in 6f9fb9ab56e8964222fac66cd2380ba4afe63e63.


Client启动失败求助，缺乏包pynput

root@34657c994c1d:/DeepSpeech# CUDA_VISIBLE_DEVICES=0 python -u deploy/demo_client.py --host_ip 'localhost' --host_port 8086
Traceback (most recent call last):
  File "deploy/demo_client.py", line 2, in <module>
    from pynput import keyboard
ImportError: No module named pynput

(venv) demodeMacBook-Pro:DeepSpeech-release-v1.8.5 demo$ CUDA_VISIBLE_DEVICES=0 python -u deploy/demo_client.py --host_ip '<IP_ADDRESS>' --host_port 8086
Traceback (most recent call last):
File "deploy/demo_client.py", line 2, in
import keyboard
ModuleNotFoundError: No module named 'keyboard'
(venv) demodeMacBook-Pro:DeepSpeech-release-v1.8.5 demo$ pip show keyboard
Name: keyboard
Version: 0.13.5
Summary: Hook and simulate keyboard events on Windows and Linux
Home-page: https://github.com/boppreh/keyboard
Author: BoppreH
Author-email<EMAIL_ADDRESS>License: MIT
Location: /Users/demo/PaddlePaddle/DeepSpeech-release-v1.8.5/tools/venv/lib/python3.7/site-packages
Requires: pyobjc
Required-by:
(venv) demodeMacBook-Pro:DeepSpeech-release-v1.8.5 demo$


Bump ignition version 2.19 -> 2.20

What this PR does / why we need it:
Ignition 2.20 was recently released. This PR updates the patches to 2.20.
Special notes for your reviewer:
The patches of the Debian build system remain as is. The patches for the source code were modified to apply them in the prepare_source hook. This simplifies working with the patches with the original source and simplify git workflows.

sry, will reopen this one from a branch since I had to change main for some other testing


Errors with Group Actors

I seem to be getting a lot of errors with group actors in v11. First, just for having one in the sidebar:

And then if I drag to the canvas:

I feel like I can just ignore these but thought you should know. Doesn't seem to matter if I turn vision on or off. The group actor doesn't actually seem to be able to see at all.
Thanks for an awesome module btw, one of the biggest new features of v11! ;)

Thanks for the report! Forgot to skip non-character/NPC actors. Fixed in 1.3.2.

Thanks for jumping on this so quickly. Sorry to say I'm seeing the exact same errors. All other modules disabled, world scripts disabled. I tried creating a new group actor with Starter Heroes and same issues. Maybe it's a dnd5e bug?

I missed half of the problem, because I didn't actually test a group token with vision enabled. Fixed it in 1.3.3.

So speedy! Can confirm we're now error-free.
Thanks heaps.


How to consume earliest/latest offset?

Given an EventConsumer, what is the proper way to start consuming from:
a.First possible offset from all partitions
b.Last possible offset from all partitions
I looked into the underlying C library and thought that the above is achievable via doing:
consumer.Subscribe(new List { ... });
a.consumer.Assign(new List() {new TopicPartitionOffset(topicName,0, -2) });
b.consumer.Assign(new List() {new TopicPartitionOffset(topicName,0,-1) });
, but that does not look like it works. I got the magic values from rdkafka.h:
define RD_KAFKA_OFFSET_BEGINNING -2  //< Start consuming from beginning of kafka partition queue: oldest msg
define RD_KAFKA_OFFSET_END       -1  //< Start consuming from end of kafka partition queue: next msg
Can you please tell me what the correct way to do a and b is? Should I use consumer.Asign zero/long.MaxValue?

You almost got it, the trick is that the .Assign with the custom offset has to happen within the OnPartitionsAssigned event.
Try this:
consumer.OnPartitionsAssigned += (obj, partitions) => {
    Console.WriteLine($"Assigned partitions: [{string.Join(", ", partitions)}], member id: {consumer.MemberId}");
    var fromBeginning = partitions.Select(p => new TopicPartitionOffset(p.Topic, p.Partition, Offset.Beginning)).ToList();
    Console.WriteLine($"Updated assignment: [{string.Join(", ", fromBeginning)}]");
    consumer.Assign(fromBeginning);
};

There are now constants for the magic values, and I'm very much considering just making offset numbers strongly typed with their own struct that then also prints those magic numbers properly.
I've started an FAQ wiki page here: https://github.com/ah-/rdkafka-dotnet/wiki/Faq so it's documented somewhere. Please feel free to update and extend!

This is great and very quick of you! Thank very much. It works as "advertised" :)

Sorry for reopening this. Is it possible to rewind an existing consumer? So i can set the offset at instantiation when OnPartitionAssigned triggers. But how do i make the assignment after? Do i need to create a new consumer? Would be great if you can do it with the existing instance.

Yes, just modify the consumers assignment:
var reset = consumer.Assignment.Select(p => new TopicPartitionOffset(p.Topic, p.Partition, Offset.Beginning)).ToList();
consumer.Assign(reset);

Does this work for you? There's a couple of alternative ways but this is the most straightforward.

Interestingly that was what i tried and thought it did not work. But indeed you are correct it works, i just had to wait longer :). Thanks! Case closed again!

@ah- you said assign must be called within onPartitionsAssigned, but I set it before calling consumer.Consume(). in your example SimpleConsumer you also call Assign before
consumer.Assign(new List<TopicPartitionOffset> {new TopicPartitionOffset(topics.First(), 0, 5)});
consumer.Start();

what is the correct way?


Check arch package installation for group too

While I want to install Arch packages in base-devel group with just writing package 'base-devel' in itamae recipe, we can't check whether the group is installed or not by pacman -Q. To check package group, I changed check_is_installed to check pacman -Qg too.
Since package group itself does not have version, I didn't care about version for package group in this change.

Thanks!

Released as v2.50.2.

Thank you! :sparkles:


Merge 3.17.2 in master

Issue
https://github.com/gravitee-io/issues/issues/7617
Description
Merge 3.17.2 in master

🚀 CI was able to deploy the build of this PR, so you can now try it directly here
Notes: The deployed app is linked to the management API of APIM master. (Same login and password as APIM master)

Looks like the build is 🔴


Bad yml

I was working on a package and the yml was malformed and it produced this error:
> ./pantry.core/scripts/build.ts lame.sourceforge.io
~/Github/Tea/pantry.extra_mag/projects/lame.sourceforge.io/package.yml
error: parser: pantry: package.yml (spilt-tea-102)
pantry entry invalid. please report this bug!

    https://github.com/teaxyz/pantry.core/issues/new

I tried to figure it out but it looks like the error is in the cli when it tries to read all of the yml files.

We need to tease the underlying error out of the YAML parser.
But also, would be nice if we knew this was not a bug to report. Not sure how we can know that this file is new without checking git.

0.16.1 has better error handling in 4f1fb57

I was thinking of just having it say "couldn't load /path/to/file.yml".

It now says it cannot parse the YAML with a reason. LMK if this is good enough in 0.16.1

Yes! This is great! Thank you!


Install OpenTelemetry applications (excluding observability stack)

Feature Request
Is your feature request related to a problem?

Currently the opentelemetry-demo compose file/helm chart contains all applications (frontend, adservice, accountingservice, ...) and observability stack (otel-collector, grafana, prometheus, ...), which is not possible to reuse the applications in other places.
In details, I am building my own repository which contains my observability stack (otel-collector, grafana, loki, prometheus, tempo, or even saas-based stack), and I want to have the demo apps running along with my observability stack without copying the whole implementation (source code + manifest files)

Describe the solution you'd like:

With docker compose, it has an experimental feature include with remote importing by a path (reference: https://www.docker.com/blog/scaling-docker-compose-up)
If we make the demo apps reusable in a separate compose file (demo-compose.yaml) which contains only demo apps, no observability stack, we can import it as:

my-compose.yaml
- include: git@github.com:open-telemetry/opentelemetry-demo.git
  path: demo-compose.yaml

Describe alternatives you've considered.
N/A
Additional Context
N/A

Using Helm, this is possible. You can set the enabled: false property for each of the observability components, which will disable them from being included.
For Docker Compose, last year, we explored multiple different ways to run the demo. We did this because we received feedback that the demo with Kafka and some other components was becoming too large. This is where the docker-compose.minimal.yml file comes from. While doing this, we also explored making the observability and other demo components optional, but we decided not to because of user complexity.

@tranngoclam does the ability to disable the default observability components in the Helm chart satisfy your needs?

@tranngoclam does the ability to disable the default observability components in the Helm chart satisfy your needs?

yes @puckpuck, for helm chart it satisfy my requirement, let me use it and close this issue