Magic-class

Latest version: v0.7.14

Safety actively analyzes 715032 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 9 of 11

0.5.5

Changes
----------
- Set window geometry to avoid `magicgui` popping up outside the screen.
- All the custom widgets are in "magicclass/widgets" folder now so they are all available by `from magicclass.widgets import ...`.
- Add copy, save and close functions in the menu bar of macro edit.
- Updates for documentation.

0.5.4

New Features
--------------
- `bind` method of `magicgui` is compatible with `magicclass` now:
python
set_options(x={"bind": value})
def func(self, x):
...

The bind callback can be a class methods which take `self` and an `EmptyWidget` as arguments.
- Many new popup modes. Changing the popup mode with `popup=False` is now deprecated and from now on `popup_mode=...` should be used.
- Disable error handling in message box by setting `error_mode="stderr"`.
- Close button at the upper left corner of `magicgui` widget if it is not popped up.
- `Parameters` class is available, which is very useful to make "set global variable" function like:
python
magicclass
class A:
class Set_Parameters(Parameters):
i = 1
s = "a"

... and a "Set Parameters" button appears in the main widget.
- `magicclass` can be nested in `magicmenu` now.
- `qtgraph.Canvas` and `qtgraph.ImageCanvas` have more consistent API now. In both class you can add plot/scatter, connect mouse click callbacks and refer to items.

Bug fixes
----------
- Compatibility of `magicgui` decorator and `wraps` decorator.

0.5.3

New Features
--------------
- Add prototype of linear region selection in the `Canvas` widget.
- Drag-and-droppable QListWidget based container is available with keyword argument `magicclass(widget_type="list")`.
- `magiccontext` can make a context menu in a same API as `magicclass` and `magicmenu`.
- `bind` option of `ValueWidget` is now compatible with `magicclass`. Furthermore, you can use instance method as the callback, in which `self.bind_method(widget)` is always called.

Bug Fixes
----------
- `ImageCanvas` was not working.
- `Console` widget detected wrong parent class.
- Macro recording bug fix.

0.5.2

New Features
---------------
- `pyqtgraph` based plot widget and image viewer widget. They have similar API with . Import by: `from magicclass.qtgraph import Canvas, ImageCanvas`.

Bug Fixes
-----------
- `wraps` method was not compatible with macro recording.
- Macro of `__getitem__` did not have double quotation.

0.5.1

New Features
---------------
- Many updates in macro. This will be the prototype for general usage of macro recording functionalities. Now you can define a macro recordable function with a decorator:
python
m = Macro()
m.record
def func(a): ...


Changes
----------
- `Image` and `Table` no longer show labels in magic classes.
- Instead of creating FunctionGui on every function call, FunctionGui objects are always tagged on push button widgets respectively, and visibility changes upon button click and function call.
- `__call__` method is now converted into push button.
- License change (GPL to BSD).

Bug fixes
----------
- `wraps` function contained unnecessary lines.
- `wraps` resulted in wrong macro recording.

0.5.0

Changes
---------
- `magicclass>=0.5` only works with `magicgui>=0.3` because all the `EventEmitter`s are changed to `Signal`.

New Features
---------------
- `MagicClassCreator` can create GUI and its Python script template. Available at `>>> from magicclass.creator import MagicClassCreator`.
- `Console` is a Jupyter QtConsole embeded in a Container. It can be used as other magicgui/magicclass widgets and you can programmatically execute code with the `execute()` method. Available at `>>> from magicclass.console import Console`
- `MagicField` now has many properties common to `ValueWidget`, thus IDE can complete code.
- `Enum` support in macro.

Bug fixes
----------
- Buttons whose bound methods wrapped with `wraps` were not correctly recorded in macro. Now macro works fine but is not a good solution.
- Magic classes often had wrong names.
- If magic classes are inserted into others after construction, they were not correctly dealt with.
- `QSplitter` API bug fix.
- Inline definition of magic class was working but magic class instance was not inserted correctly.

Page 9 of 11

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.